Cancel button with imagemaps
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.
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.
Cancel button with imagemaps
I know how to do confirm button for options "hotspot (x,x,x,x) action Return()" but how do I make cancel button for options that will discard changes? Is it "action Return(value=None)" or is there completely different action for that?
- Ocelot
- Lemma-Class Veteran
- Posts: 2404
- Joined: Tue Aug 23, 2016 10:35 am
- Github: MiiNiPaa
- Discord: MiiNiPaa#4384
- Contact:
Re: Cancel button with imagemaps
Do either Return(True) for confirmation or Return(False) for canceling. In calling code inspect returned value and act accordingly.
< < insert Rick Cook quote here > >
Re: Cancel button with imagemaps
Thanks.
Re: Cancel button with imagemaps
I checked this and it's actually not working. Both buttons works like OK. What's more after pressing them they start new game instead of returning to previous menu or to game. I'm pretty sure I'm missing something but what?
P.S. Noob here.
P.S. Noob here.
Re: Cancel button with imagemaps
Did you call the screen instead of showing it?
Code: Select all
call screen my_screen
if _return:
# do stuff
"resume game here"
Re: Cancel button with imagemaps
I didn't. This is my options menu where I want it to use:
I honestly don't know where to bite it.
Code: Select all
screen options:
tag menu
add "gui/menu_ground.png"
imagemap:
ground "gui/options_ground.png"
idle "gui/options_idle.png"
hover "gui/options_hover.png"
selected_idle "gui/options_selected_idle.png"
selected_hover "gui/options_selected_hover.png"
alpha False
hotspot(75,151,93,32) action Preference("display", "window")
hotspot(194,151,130,32) action Preference("display", "fullscreen")
hotspot(68,271,132,32) action Preference("skip", "seen")
hotspot(228,271,103,32) action Preference("skip", "all")
hotspot(573,113,38,32) action Preference("music mute", "disable")
hotspot(624,113,49,32) action Preference("music mute", "enable")
hotspot(573,233,38,32) action Preference("sound mute", "disable")
hotspot(624,233,49,32) action Preference("sound mute", "enable")
hotspot(685,233,51,32) action Play("sound","sound/SE002.ogg")
hotspot(573,353,38,32) action Preference("voice mute", "disable")
hotspot(624,353,49,32) action Preference("voice mute", "enable")
hotspot(685,353,51,32) action Play("voice","voice/nana0213.ogg")
hotspot(456,489,137,40) action Return(True)
hotspot(648,489,100,40) action Return(False)
Who is online
Users browsing this forum: Google [Bot]