I added a window the the equip menu that is suppose to display text.
The problem is that the box is blank until I change which character is being displayed.
It seems like "refreshActor" is working, but I have no Idea how to make the text appear when the window is first created...
=================================
(function() {
Scene_Equip.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this.createHelpWindow();
this.createStatusWindow();
this.createCommandWindow();
this.createSlotWindow();
this.createItemWindow();
this.createGimmickWindow();
this.refreshActor();
};
Scene_Equip.prototype.createGimmickWindow = function() {
this._gimmickWindow = new Window_EquipGimmick(0, 100);
this.addWindow(this._gimmickWindow);
};
Scene_Equip.prototype.refreshActor = function() {
var actor = this.actor();
this._statusWindow.setActor(actor);
this._slotWindow.setActor(actor);
this._itemWindow.setActor(actor);
this._gimmickWindow.setActor(actor);
};
// Window_EquipGimmick
//
// The window for selecting a command on the equipment screen.
function Window_EquipGimmick() {
this.initialize.apply(this, arguments);
}
Window_EquipGimmick.prototype = Object.create(Window_Base.prototype);
Window_EquipGimmick.prototype.constructor = Window_EquipGimmick;
Window_EquipGimmick.prototype.initialize = function(x, y) {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Base.prototype.initialize.call(this, x, 396, width, height);
this._actor = null;
};
Window_EquipGimmick.prototype.windowWidth = function() {
return 312;
};
Window_EquipGimmick.prototype.windowHeight = function() {
return 269;
};
Window_EquipGimmick.prototype.setActor = function(actor) {
if (this._actor !== actor) {
this._actor = actor;
this.contents.clear();
this.drawTextEx( "" + actor.description, 0, 0);
}
};
The problem is that the box is blank until I change which character is being displayed.
It seems like "refreshActor" is working, but I have no Idea how to make the text appear when the window is first created...
=================================
(function() {
Scene_Equip.prototype.create = function() {
Scene_MenuBase.prototype.create.call(this);
this.createHelpWindow();
this.createStatusWindow();
this.createCommandWindow();
this.createSlotWindow();
this.createItemWindow();
this.createGimmickWindow();
this.refreshActor();
};
Scene_Equip.prototype.createGimmickWindow = function() {
this._gimmickWindow = new Window_EquipGimmick(0, 100);
this.addWindow(this._gimmickWindow);
};
Scene_Equip.prototype.refreshActor = function() {
var actor = this.actor();
this._statusWindow.setActor(actor);
this._slotWindow.setActor(actor);
this._itemWindow.setActor(actor);
this._gimmickWindow.setActor(actor);
};
// Window_EquipGimmick
//
// The window for selecting a command on the equipment screen.
function Window_EquipGimmick() {
this.initialize.apply(this, arguments);
}
Window_EquipGimmick.prototype = Object.create(Window_Base.prototype);
Window_EquipGimmick.prototype.constructor = Window_EquipGimmick;
Window_EquipGimmick.prototype.initialize = function(x, y) {
var width = this.windowWidth();
var height = this.windowHeight();
Window_Base.prototype.initialize.call(this, x, 396, width, height);
this._actor = null;
};
Window_EquipGimmick.prototype.windowWidth = function() {
return 312;
};
Window_EquipGimmick.prototype.windowHeight = function() {
return 269;
};
Window_EquipGimmick.prototype.setActor = function(actor) {
if (this._actor !== actor) {
this._actor = actor;
this.contents.clear();
this.drawTextEx( "" + actor.description, 0, 0);
}
};