On Screen Buttons [SOLVED]

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
RayDizzle
Regular
Posts: 25
Joined: Tue Jul 28, 2015 9:49 pm
Deviantart: Gem2012
Location: New Zealand
Contact:

On Screen Buttons [SOLVED]

#1 Post by RayDizzle »

Okay, so I know exactly how to place a button on screen but there's just one thing I want to do. I want you to be able to click on the button and have it display your stats (which I've already done) but then be able to click it again and hide the stats screen because it's just a simple information screen in the corner of the main screen. Could anyone help me on that please? :)
Last edited by RayDizzle on Sun Aug 30, 2015 2:51 am, edited 1 time in total.

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: On Screen Buttons

#2 Post by Kia »

put two image on top of each other and in addition to their normal function make them to hide itself and show the other one. there was a recent topic about it. try searching the forum for it

User avatar
RayDizzle
Regular
Posts: 25
Joined: Tue Jul 28, 2015 9:49 pm
Deviantart: Gem2012
Location: New Zealand
Contact:

Re: On Screen Buttons

#3 Post by RayDizzle »

But if I were using a textbutton how would I do it?

User avatar
Kia
Eileen-Class Veteran
Posts: 1040
Joined: Fri Aug 01, 2014 7:49 am
Deviantart: KiaAzad
Discord: Kia#6810
Contact:

Re: On Screen Buttons

#4 Post by Kia »

it's same for all kind of buttons, try hide screen here: http://www.renpy.org/doc/html/screen_actions.html#Hide

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: On Screen Buttons

#5 Post by trooper6 »

This is the code you want:

textbutton "Stats" action If(renpy.get_screen("stat_screen"), Hide("stat_screen"), Show("stat_screen"))

For this example I'm pretending your stat screen is called: stat_screen
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

User avatar
RayDizzle
Regular
Posts: 25
Joined: Tue Jul 28, 2015 9:49 pm
Deviantart: Gem2012
Location: New Zealand
Contact:

Re: On Screen Buttons

#6 Post by RayDizzle »

Thank you so much to both of you! That really helped a lot trooper6! You guys are amazing! :D

Post Reply

Who is online

Users browsing this forum: Google [Bot]