Hi guys,
I search to create a command to go a next or previous actor, see below :
As you can see, in the left side on top, I have create a window. When we click on, the status window change for the next actor.
But my problem is that, I don't know wich code used for see the next actor or previous in my window, see my code below :
I think my error is somewhere there, I shouldn't use "this._actor" but something else...
Anybody can help me ?
I search to create a command to go a next or previous actor, see below :
As you can see, in the left side on top, I have create a window. When we click on, the status window change for the next actor.
But my problem is that, I don't know wich code used for see the next actor or previous in my window, see my code below :
Code:
function Window_FaceNext() {
this.initialize.apply(this, arguments);
}
Window_FaceNext.prototype = Object.create(Window_Command.prototype);
Window_FaceNext.prototype.constructor = Window_FaceNext;
Window_FaceNext.prototype.initialize = function(x, y, width, height) {
this._windowWidth = width;
this._windowHeight = height;
Window_Command.prototype.initialize.call(this, x, y);
this.refresh();
this.activate();
};
Window_FaceNext.prototype.windowWidth = function() {
return this._windowWidth;
};
Window_FaceNext.prototype.windowHeight = function() {
return this._windowHeight;
};
Window_FaceNext.prototype.standardPadding = function() {
return 0;
};
Window_FaceNext.prototype.lineHeight = function() {
return this.windowHeight();
};
Window_FaceNext.prototype.makeCommandList = function() {
this.addCommand("Before", 'before', true);
};
Window_FaceNext.prototype.processOk = function() {
if (this.isCurrentItemEnabled()) {
this.updateInputData();
this.callOkHandler();
} else {
this.playBuzzerSound();
}
};
Window_FaceNext.prototype.setActor = function(actor) {
if (this._actor !== actor) {
this._actor = actor;
this.refresh();
}
};
Window_FaceNext.prototype.refresh = function() {
this.contents.clear();
if (this._actor) {
var lineHeight = this.lineHeight();
var actor = this._actor;
this.drawActorFace(actor, 0, 0, 144, 144);
}
};
I think my error is somewhere there, I shouldn't use "this._actor" but something else...
Anybody can help me ?