Right click to exit Save menu?

chellero

Warper
Member
Joined
Jan 4, 2016
Messages
2
Reaction score
0
First Language
english
Primarily Uses
Currently, in my project I already have it set so that right click opens the Save menu (instead of the settings by default).
Is it possible to make it so that pressing right click again while in the Save menu will act as a 'back' button to return to the game?

Thank you.
 

Dr.Yami

。◕‿◕。
Developer
Joined
Mar 5, 2012
Messages
1,003
Reaction score
757
First Language
Vietnamese
Primarily Uses
Other
Currently, in my project I already have it set so that right click opens the Save menu (instead of the settings by default).
Is it possible to make it so that pressing right click again while in the Save menu will act as a 'back' button to return to the game?

Thank you.
Hi,

If you use default Save Menu, it has the "Right Click to return" by default. However, if you use a custom Save Menu Layout (script), you need to add this following line of code into the UI element that fill the whole screen (often background):
Code:
"action": { "event": "onCancel", "name": "previousLayout", "params": {}}
It should looks like this:
Code:
{
            "type": "ui.Image",
            "image": "backgroundImage",
            "frame": [0, 0, Graphics.width, Graphics.height],
            "action": { "event": "onCancel", "name": "previousLayout", "params": {}}
}
If you use Action-based UI, you can use "Wait for Input" or "Input Data" to check when the Right Button is clicked, it sets a Switch X to true, then in Update Menu common event, you put Condition Switch X is true, it will go to previous scene.

Cheer~
 

chellero

Warper
Member
Joined
Jan 4, 2016
Messages
2
Reaction score
0
First Language
english
Primarily Uses
Hi,

If you use default Save Menu, it has the "Right Click to return" by default. However, if you use a custom Save Menu Layout (script), you need to add this following line of code into the UI element that fill the whole screen (often background):
Code:
"action": { "event": "onCancel", "name": "previousLayout", "params": {}}
It should looks like this:
Code:
{
            "type": "ui.Image",
            "image": "backgroundImage",
            "frame": [0, 0, Graphics.width, Graphics.height],
            "action": { "event": "onCancel", "name": "previousLayout", "params": {}}
}
If you use Action-based UI, you can use "Wait for Input" or "Input Data" to check when the Right Button is clicked, it sets a Switch X to true, then in Update Menu common event, you put Condition Switch X is true, it will go to previous scene.

Cheer~
I didn't realize I forgot to mention that I was using action-based UI, sorry about that.
I was trying to follow your instructions for action-based UI, but I got confused. I'm an absolute beginner.
Do you think you could show some screenshots of how it should look? I appreciate it.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,040
Members
137,569
Latest member
Shtelsky
Top