choice button
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.
- DragonKnight
- Regular
- Posts: 51
- Joined: Sun Nov 12, 2017 10:16 am
- Projects: Taboo Hearts
- Contact:
choice button
How do i make choice button different colors in the same choice
Currently working on Taboo Hearts
Currently working on Forbidden
Currently working on Forbidden
-
- Regular
- Posts: 78
- Joined: Thu Feb 08, 2018 7:57 am
- Contact:
Re: choice button
Use the {color} tag.
Code: Select all
menu:
"{color=#FF0000}Red,{/color} {color=#00FF00}Greeen{/color}, {color=#0000FF}Blue.{/color}":
"Oooh, shiny."
-
- Regular
- Posts: 78
- Joined: Thu Feb 08, 2018 7:57 am
- Contact:
Re: choice button
Oh, if you mean changing the actual button then you'll have to change the choice screen in screens.rpy:
You'll have to pass the screen some kind of indication that you want to use a different background, the simplest way is simply to include your own tag in the caption. You'll also need to either create your own background for the button or use an image manipulator to recolor the default renpy background (obviously this is much less efficient, but I'm doing it here just for an example that will work 'out of the box'). For example, here I recolor the default choice button background to red (and the hover_background to a light grey) if the string '(red)' is in the choice caption:
So the menu code would look like:
Code: Select all
screen choice(items):
style_prefix "choice"
vbox:
for i in items:
textbutton i.caption action i.action
Code: Select all
screen choice(items):
style_prefix "choice"
vbox:
for i in items:
if '(red)' in i.caption:
textbutton i.caption.replace("(red)", "") action i.action:
idle_background im.MatrixColor("gui/button/choice_idle_background.png", im.matrix.colorize("#ff0000", "#ff0000"))
hover_background im.MatrixColor("gui/button/choice_idle_background.png", im.matrix.colorize("#CCCCCC", "#CCCCCC"))
else:
textbutton i.caption action i.action
Code: Select all
menu:
"This should be red.(red)":
"Yep, it's red."
"This should be normal.":
"Very normal."
- DragonKnight
- Regular
- Posts: 51
- Joined: Sun Nov 12, 2017 10:16 am
- Projects: Taboo Hearts
- Contact:
Who is online
Users browsing this forum: Google [Bot]