- Joined
- Jan 8, 2015
- Messages
- 155
- Reaction score
- 22
- Primarily Uses
Hello there!
I'm currently creating a scene (made out of Window_Selectable and Window_Base) and I want the player to exit the scene only by pressing the button I have drawn in the scene.
In the Window_Selectable part I have already a processCancel function present in which I have attempted to stop player from exiting the scene:
I also have a Window_CardsIndex.prototype.processTouch function present, and this is the second attempt to prevent the player from exiting the scene:
Can someone please help me with this? I want the player just to not be able to exit the scene other way than the way I have made for him. This has a gameplay purpose.
Thank you for your time!
I'm currently creating a scene (made out of Window_Selectable and Window_Base) and I want the player to exit the scene only by pressing the button I have drawn in the scene.
In the Window_Selectable part I have already a processCancel function present in which I have attempted to stop player from exiting the scene:
Code:
Window_CardsIndex.prototype.processCancel = function() {
Window_Selectable.prototype.processCancel.call(this);
Window_CardsIndex.lastTopRow = this.topRow();
Window_CardsIndex.lastIndex = this.index();
console.log("you have exited"); // < This does not work when I right click in the window
};
Code:
Window_CardsIndex.prototype.processTouch = function() {
if (this.isOpenAndActive()) {
if (TouchInput.isTriggered() && this.isTouchedInsideFrame()) {
this._touching = true;
this.onTouch(true);
} else if (TouchInput.isCancelled()) {
console.log("you have exited"); // < this does not work
return false; // < this does not work either. The scene still can be exited normally.
}
if (this._touching) {
if (TouchInput.isPressed()) {
this.onTouch(false);
} else {
this._touching = false;
}
}
} else {
this._touching = false;
}
};
Can someone please help me with this? I want the player just to not be able to exit the scene other way than the way I have made for him. This has a gameplay purpose.
Thank you for your time!


