Hiding and showing buttons
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.
-
- Regular
- Posts: 51
- Joined: Tue Jul 17, 2018 10:32 am
- Location: Philippines
- Contact:
Hiding and showing buttons
Hello. I want to ask how I can hide an image button by pressing it and showing another image button. I will implement this on my main menu. Instead of transitioning from screen to screen, I just want to be able to show or hide buttons. Any help would be greatly appreciated.
- Kia
- Eileen-Class Veteran
- Posts: 1040
- Joined: Fri Aug 01, 2014 7:49 am
- Deviantart: KiaAzad
- Discord: Kia#6810
- Contact:
Re: Hiding and showing buttons
you need a variable and some "if"
default hidebtn = 1
I didn't test this code, might contain mistakes
default hidebtn = 1
Code: Select all
if hidbtn:
button:
text "1st"
action SetScreenVariable("hidbtn", 0)
else:
button:
text "2nd"
action SetScreenVariable("hidbtn", 1)
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: Hiding and showing buttons
This seems unnecessarily complicated, are you sure you want to do this?
Warning: May contain trace amounts of gratuitous plot.
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Twitter
pro·gram·mer (noun) An organism capable of converting caffeine into code.
Current project: GGD Mentor
Who is online
Users browsing this forum: No registered users