Right click is the same as 'cancel'. You shouldn't need to do anything else.
Your structure doesn't really follow the norm - if it's not working, maybe check out some of the other scenes (if you can find one that's almost similar in appearance and uses the same kind of window as you're using for this one, look at it) and see how they handle it.
See that is what I thought. But it just doesn't want to work for me for some reason. That is weird. Hmmmm. Well I copied my window from the gold window. Maybe something around there will help.
The gold window doesn't accept input. If you're creating a window where you need the player to click something, or to right-click to cancel, then you need to base it on Window_Selectable or one of the windows that inherits from it.
What is the purpose of your new scene?
I was just trying learning to make a custom scene and windows. Just learning JavaScript more than anything. But yes I see how that window is much better to use. Thanks a ton Shaz.
You're still just using Window_Base as a parent though. You need to base it on Window_Selectable or one of the windows that inherits from it, because Window_Selectable has input handling. Window_Base doesn't.
I didn't mean to use Window_Selectable as an example. I meant to find a scene that does something along the lines of what you want to do, and look at how that handles input (and what it inherits from). And then look at the way that scene and window class handle the input. I'm sure you'll find it'll be by adding handlers for confirmation, cancel, etc, and then calling specific functions to do the action.
The best way to learn is not to try and create a template when you don't have an idea of what you want it to accomplish. This is because there are a number of different types of windows that do different things. So the one you use as an example should have a similar purpose and similar actions to the one you're trying to create. The best way is to find one that does a lot of similar things, then copy it and make the necessary changes to do what you want. So if you want a window that handles input, find an existing scene that requires input from the player and follow the same approach that it uses. If you want a window that lists items, Window_ItemList is a good starting point. If you want a window that just displays stuff and lets you cancel, Window_Status is probably the best one (not Window_MenuStatus).
That makes sense. I was more or less looking for a way to make a template that is just an empty scene with and empty window in it that can be edited to do what i need. My only impediment at the moment seems to closing the scene and going back to the map.
Yeah. The gold window is just an extra window that displays information and doesn't take any user input. Scene_Menu and Window_Menu handle the input and the opening/closing of the gold window.
I suggest you look at Window_Status and Scene_Status. That is just a plain window that shows some information in a certain format. No lists, no selections. All you can do is "go back". And by "go back" it just means to whatever was showing before you got in there - if it was called from Scene_Map, then Scene_Map is what it will go back to. If it was called from Scene_Menu, then it will go back to Scene_Menu. This is a nice way to do things as you're relying on the scene stack to keep everything in order.
If you want to do other things, like show lists or let the player select and do stuff, then you would look at a different window as a starting point.
Uhhhh, I didn't read any of your past posts, but if you just want right click to work, you need to use
TouchInput.isCancelled();
which will check if a touch screen was pressed with two fingers, or the right mouse button was pressed down. The regular Input modular only covers Keyboards and Gamepads for MV, while TouchInput covers touchscreens (including mobile devices) and mouse.
This was my solution... I am sure their is a better way to write it as I am only a beginner at writing JavaScript. But its a start, and it works.
Template_Scene.prototype.update = function () {
Scene_MenuBase.prototype.update.call(this);
if (Input.isTriggered('cancel')) {
SoundManager.playCancel();
SceneManager.goto(Scene_Map);
}
else if (TouchInput.isCancelled("cancel")) {
SoundManager.playCancel();
SceneManager.goto(Scene_Map);
}
}
That's how you do that. Ok. I was trying to do that but with a comma, so of course it didn't work, and I didn't know what to use there. What I did worked, and it didn't break, but I knew there was a better way. Thanks.