Imagebutton that acts as the ESCAPE key

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
Yuvan raj
Regular
Posts: 38
Joined: Wed Feb 17, 2021 11:24 am
Contact:

Imagebutton that acts as the ESCAPE key

#1 Post by Yuvan raj »

Hello, in my game the player can name the save file. I managed to include an 'OK' button so that the touch screen players can use it. But I don't know how to include the button so that the player may cancel this naming. Clicking 'ESCAPE' button on the keyboard does this but can I make an imagebutton have the same function as the Escape button?
Thank you very much in advance guys!
Image

enaielei
Veteran
Posts: 293
Joined: Fri Sep 17, 2021 2:09 am
Organization: enaielei
Tumblr: enaielei
Deviantart: enaielei
Github: enaielei
Skype: enaielei
Soundcloud: enaielei
itch: enaielei
Discord: enaielei#7487
Contact:

Re: Imagebutton that acts as the ESCAPE key

#2 Post by enaielei »

If it's a called screen you can use the Return action to continue the flow of the game.
You can use this action in your button to just simply exit from that called screen.
I'm not sure how your code looks like, because if you're using InputValue and you set it to a global variable then you're directly editing the variable on each keystroke so Return wont help here to discard the changes.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot]