Hi,
We are trying unsuccessfully to change the choice menu gui dynamically. Basically we want the color of the choice buttons to change depending on the character, so the user can play with more than one character, and the gui changes depending on which character you have selected.
We know how to change the background color (black in the screenshot), by replacing the choice_idle_background.png file, but we can only do it once before compiling the game, and not once the game has started.
Any advice?
Thank you in advance!
How to change choice menu gui dynamically
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.
- apexchimps
- Regular
- Posts: 29
- Joined: Mon Jan 25, 2016 6:12 pm
- Completed: Detective Max, Nick's Night Out!, Arthur & Susan: Almost Detectives
- Projects: Arthur & Susan: Almost Detectives
- Contact:
- PyTom
- Ren'Py Creator
- Posts: 16096
- 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: How to change choice menu gui dynamically
7.1.4 has a new feature, menu arguments, that will be perfect for this. First off, you're going to want to change the say screen in your game to read:
Once that's done, you can then pass the button argument to the menu.
Remember, this needs the prerelease to work.
Code: Select all
screen choice(items, button="choice"):
style_prefix "choice"
vbox:
for i in items:
textbutton i.caption:
action i.action
background "gui/button/{}_idle_background.png".format(button)
hover_background "gui/button/{}_hover_background.png".format(button)
Code: Select all
menu (button="sylvie"):
"To ask her right away.":
pass
"To ask her later.":
pass
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
Software > Drama • https://www.patreon.com/renpytom
- apexchimps
- Regular
- Posts: 29
- Joined: Mon Jan 25, 2016 6:12 pm
- Completed: Detective Max, Nick's Night Out!, Arthur & Susan: Almost Detectives
- Projects: Arthur & Susan: Almost Detectives
- Contact:
Re: How to change choice menu gui dynamically
That would be... perfect! I didn't see the prerelease. You are one week ahead! Thank you!
- Imperf3kt
- Lemma-Class Veteran
- Posts: 3794
- Joined: Mon Dec 14, 2015 5:05 am
- itch: Imperf3kt
- Location: Your monitor
- Contact:
Re: How to change choice menu gui dynamically
It only came out a few hours earlier, it's unlikely you would have.
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: Ocelot