Screen action for hiding interface

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
Dreadwing93
Regular
Posts: 30
Joined: Mon May 20, 2013 1:44 am
Projects: 0xE125: Crimson Spiral
Contact:

Screen action for hiding interface

#1 Post by Dreadwing93 » Thu May 08, 2014 3:57 pm

If you middle click or push the H button it will hide the user interface.

I want to add a button in my quick menu that will do the same thing, but I don't know how.
Is there a way to do this?
Image

User avatar
akemicchi
Veteran
Posts: 465
Joined: Mon Dec 31, 2007 11:22 pm
Projects: Magicians of Delphine, Panaderia: Ensaimada, SweetTooth!, XOXO Droplets
Deviantart: littlebabyshoes
Contact:

Re: Screen action for hiding interface

#2 Post by akemicchi » Thu May 08, 2014 5:24 pm

The line you want is renpy.curried_call_in_new_context("_hide_windows"), so on the quick menu screen, just place it after action.

If it's a textbutton, it'd be something like:

Code: Select all

    textbutton _("X") action renpy.curried_call_in_new_context("_hide_windows")

User avatar
Dreadwing93
Regular
Posts: 30
Joined: Mon May 20, 2013 1:44 am
Projects: 0xE125: Crimson Spiral
Contact:

Re: Screen action for hiding interface

#3 Post by Dreadwing93 » Thu May 08, 2014 5:28 pm

Thank you!
Image

User avatar
PyTom
Ren'Py Creator
Posts: 15893
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Screen action for hiding interface

#4 Post by PyTom » Fri May 09, 2014 9:44 pm

As a completely stylistic thing, the best way to write this is probably:

Code: Select all

    textbutton _("X") action HideInterface()
It's a bit shorter, and more documented. (Not like I could ever substantially change _hide_windows.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom

Post Reply

Who is online

Users browsing this forum: _ticlock_