I can't figure out how to code the choice buttons so that previously selected choices are greyed out. I found this previous post viewtopic.php?f=8&t=12622 but no matter what I do with the given coding answers nothing works.
I notice the solution was posted back in 2011. Is the information in that post still accurate?
Change appearance of previously chosen menu options?
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.
- Dovahkitteh
- Veteran
- Posts: 229
- Joined: Wed Sep 02, 2015 4:51 pm
- Completed: YDD, RE, CoB, Req
- Projects: Red Embrace: Hollywood, The Black Hand
- Organization: Argent Games
- Tumblr: argentgames
- Skype: Dovahkitteh
- itch: argent-games
- Contact:
Re: Change appearance of previously chosen menu options?
Hey there! Here's a sample of the screens code from my last project that served the same function as what you want to do. I had a few extra choice settings (locked/unlocked choices) as well, but this is just the base chosen/not chosen version.
The choice screen itself:
The styles below it:
Let me know if this works/helps at all!
The choice screen itself:
Code: Select all
screen choice(items):
window:
style "menu_window"
background None
xalign 0.5
yalign 0.5
vbox:
style "choice_vbox"
yalign 0.5
xalign 0.5
spacing 30
for caption, action, chosen in items:
if action:
if not chosen:
button:
action action
style "menu_choice_button"
focus_mask True
text caption style "menu_choice"
elif chosen == True:
button:
action action
style "menu_choice_chosen_button"
focus_mask True
text caption style "menu_choice_chosen"
else:
text caption style "menu_caption"
Code: Select all
style choice_vbox is vbox
style menu_choice_button is button
style menu_choice_chosen_button is menu_choice_button:
idle_background "gui/button/choice_chosen_idle_background.png" #replace with greyed out image or whatever you like
style menu_choice is button_text
style choice_vbox:
xalign 0.5
ypos 330
yanchor 0.5
spacing 44
style menu_choice_button is default:
properties gui.button_properties("choice_button")
style menu_choice is default:
properties gui.button_text_properties("choice_button")
ypos -7
xalign 0.5
xpos 356
style menu_choice_chosen is default:
properties gui.button_text_properties("choice_button")
ypos -7
xalign 0.5
xpos 356
Re: Change appearance of previously chosen menu options?
Thank you so much for replying! This gets me half way there, but I can't figure out how to change the text as well as the background image.
It's probably obvious, but I've been learning how to use ren'py for all of 48 hours now.
It's probably obvious, but I've been learning how to use ren'py for all of 48 hours now.
-
- Miko-Class Veteran
- Posts: 793
- Joined: Fri Feb 09, 2018 12:05 am
- Location: Canada
- Contact:
Re: Change appearance of previously chosen menu options?
for backgrounds for menu
for background for the game itself you put the background in images folder in the script you would put this
Code: Select all
background "gui/overlay/main_menu.png"
Code: Select all
scene imagename
- Dovahkitteh
- Veteran
- Posts: 229
- Joined: Wed Sep 02, 2015 4:51 pm
- Completed: YDD, RE, CoB, Req
- Projects: Red Embrace: Hollywood, The Black Hand
- Organization: Argent Games
- Tumblr: argentgames
- Skype: Dovahkitteh
- itch: argent-games
- Contact:
Re: Change appearance of previously chosen menu options?
Do you mean the text style for the previously chosen choice? That would be in here I think:
Code: Select all
style menu_choice_chosen is default:
properties gui.button_text_properties("choice_button")
hover_color "#ddd7d7" #example change
ypos -7
xalign 0.5
xpos 356
Code: Select all
elif chosen == True:
button:
action action
style "menu_choice_chosen_button"
focus_mask True
text caption style "menu_choice_chosen" hover_color "#000" size 40 #example text changes
else:
text caption style "menu_caption"
Re: Change appearance of previously chosen menu options?
I used your first example and that worked perfectly! Thank you so much, I'd been trying for hours just to do that simple thing, lol.
Who is online
Users browsing this forum: No registered users