Closing a screen instead of return?

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
User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Closing a screen instead of return?

#1 Post by namastaii »

I know there is a ui.close() but when I'm not using that layout, and I'm using this kind of layout:

Code: Select all

imagebutton:
            idle "gui/cell_phone/close_button.png"
            hover "gui/cell_phone/close_button.png"
            action 
What should I put for the action if I want it to close that screen that was just opened and continue the story? If I put Return() it literally just ends the whole game and goes back to the main menu...

User avatar
Alex
Lemma-Class Veteran
Posts: 3093
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Closing a screen instead of return?

#2 Post by Alex »

Just hide this screen, like

Code: Select all

action Hide("name_of_the_screen")
http://www.renpy.org/doc/html/screen_ac ... ol-actions

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Closing a screen instead of return?

#3 Post by namastaii »

Oh that's why it wasn't working. I didn't put the screen name in quotation marks.

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Closing a screen instead of return?

#4 Post by namastaii »

It hides the screen..but it doesn't continue where it was before.. I can't do anything but sit there and stare a a blank background with no dialogue or GUI or anything

User avatar
Alex
Lemma-Class Veteran
Posts: 3093
Joined: Fri Dec 11, 2009 5:25 pm
Contact:

Re: Closing a screen instead of return?

#5 Post by Alex »

I suppose you've used <modal True> in your screen. Try to call this screen (not to show it) and make the screen return any value, like

Code: Select all

imagebutton:
            idle "gui/cell_phone/close_button.png"
            hover "gui/cell_phone/close_button.png"
            action Return("smth")
If that won't work for you then you'd better show the actual code you have and tell a bit more about how you want it to act.

http://www.renpy.org/doc/html/screens.html#call-screen

User avatar
namastaii
Eileen-Class Veteran
Posts: 1350
Joined: Mon Feb 02, 2015 8:35 pm
Projects: Template Maker for Ren'Py, What Life
Github: lunalucid
Skype: Discord: lunalucid#1991
Soundcloud: LunaLucidMusic
itch: lunalucid
Location: USA
Contact:

Re: Closing a screen instead of return?

#6 Post by namastaii »

the return("") seems to be working. Thank you.

Post Reply

Who is online

Users browsing this forum: Google [Bot]