By default, the choice menu buttons keep the text colour the same but have a background bar that is black on idle and a different colour on hover.
I'm making a custom screen. How do I have this changing background rather than having the text itself change colour?
Highlighted background on choice buttons[SOLVED]
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.
- TellerFarsight
- Veteran
- Posts: 230
- Joined: Sun Jun 04, 2017 8:09 pm
- Projects: Vora, Secrets Untold
- Location: Toronto, ON
- Contact:
Highlighted background on choice buttons[SOLVED]
Last edited by TellerFarsight on Wed Jun 21, 2017 11:26 am, edited 1 time in total.
- DannyGMaster
- Regular
- Posts: 113
- Joined: Fri Sep 02, 2016 11:07 am
- Contact:
Re: Highlighted background on choice buttons
I assume you want to make a completely new screen that behaves this way? You could set it up with auto imagebuttons.
In your gui folder, you need to add a set of buttons with that name but where %s in the code is you put the state you want that button to show with. Each should be the same button but with a different design, or color.
my_button_idle.png
my_button_hover.png
my_button_selected_idle.png
my_button_selected_hover.png
And so on. Here's a complete list https://www.renpy.org/doc/html/screens. ... magebutton
If unsure, see in the gui folder, the default choice buttons should be there and they are a fine example.
Code: Select all
screen my_screen():
vbox xalign .5 yalign .5:
imagebutton auto "gui/my_button_%s.png" action MyAction()
my_button_idle.png
my_button_hover.png
my_button_selected_idle.png
my_button_selected_hover.png
And so on. Here's a complete list https://www.renpy.org/doc/html/screens. ... magebutton
If unsure, see in the gui folder, the default choice buttons should be there and they are a fine example.
The silent voice within one's heart whispers the most profound wisdom.
- TellerFarsight
- Veteran
- Posts: 230
- Joined: Sun Jun 04, 2017 8:09 pm
- Projects: Vora, Secrets Untold
- Location: Toronto, ON
- Contact:
Re: Highlighted background on choice buttons
So I just need to make that background bar a .png file? Is there no way to have it purely with code and hex color codes?
- DannyGMaster
- Regular
- Posts: 113
- Joined: Fri Sep 02, 2016 11:07 am
- Contact:
Re: Highlighted background on choice buttons
Well, I suggested imagebuttons because I think it's the easiest way to do it. I know you can generate images
with pygame using pure code, and Ren'py can use pygame code, but I don't know if that code can be used for
screens in place of image files, in theory it should be possible but you would probably need a lot of code. Don't know if this will be useful but check here https://www.renpy.org/doc/html/udd.html and https://www.renpy.org/doc/html/displayables.html
with pygame using pure code, and Ren'py can use pygame code, but I don't know if that code can be used for
screens in place of image files, in theory it should be possible but you would probably need a lot of code. Don't know if this will be useful but check here https://www.renpy.org/doc/html/udd.html and https://www.renpy.org/doc/html/displayables.html
The silent voice within one's heart whispers the most profound wisdom.
- TellerFarsight
- Veteran
- Posts: 230
- Joined: Sun Jun 04, 2017 8:09 pm
- Projects: Vora, Secrets Untold
- Location: Toronto, ON
- Contact:
Re: Highlighted background on choice buttons
Alright, so I used inspection on one of the default choice buttons and
Is this background frame the thing I'm talking about? Can I use this for custom buttons?
It doesn't look like it's done with imagebuttons, so I'm just wondering how this is done by default Ren'Py
Code: Select all
style choice_button:
background <Frame at 779ba50>
padding (100, 5, 100, 5)
xsize 790
It doesn't look like it's done with imagebuttons, so I'm just wondering how this is done by default Ren'Py
- TellerFarsight
- Veteran
- Posts: 230
- Joined: Sun Jun 04, 2017 8:09 pm
- Projects: Vora, Secrets Untold
- Location: Toronto, ON
- Contact:
Re: Highlighted background on choice buttons
Wait no never mind I found it. It is a .png file.
Thanks for the help!
Thanks for the help!
Who is online
Users browsing this forum: Alex, Andredron, Bing [Bot], geoWaffle