[Solved] Different Idle/Hover Button Colors

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
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.
Post Reply
Message
Author
vwxyang0707
Newbie
Posts: 10
Joined: Wed Oct 25, 2017 12:08 am
Contact:

[Solved] Different Idle/Hover Button Colors

#1 Post by vwxyang0707 »

Would it be possible to have different idle/hover button colors on the main menu, and in-game?
On the main menu, I wish for the colors to be white/black, and white/blue in-game.

I have this under Colors in the gui.rpy (for the main menu)

Code: Select all

## The color used for a text button when it is neither selected nor hovered.
define gui.idle_color = '#ffffff'

## The color that is used for buttons and bars that are hovered.
define gui.hover_color = '#000000'
and this under Choice Buttons in the gui.rpy (for choice buttons in-game)

Code: Select all

define gui.choice_button_text_idle_color = "#ffffff"
define gui.choice_button_text_hover_color = "#97baff"
but it seems like the hover color under Colors is overriding the one in Choice Buttons.
Last edited by vwxyang0707 on Sun Nov 12, 2017 5:28 pm, edited 1 time in total.

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: Different Idle/Hover Button Colors

#2 Post by xavimat »

The names of all the properties can be tricky (they are for me).
In your examples, I think there is confusion between the color of the textbutton (that is, the background of the textbutton), and the color of the text inside a textbutton (the color of the letters).
What you want can be done, but you need to find the exact property to change.
Also, look in screens.rpy, there a lot of properties are defined, maybe you need to change them there.
I guess you need to change lines that these:

Code: Select all

style choice_button is button
style choice_button_text is button_text
style choice_button is default: ...
style choice_button_text is default: ...
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

vwxyang0707
Newbie
Posts: 10
Joined: Wed Oct 25, 2017 12:08 am
Contact:

Re: Different Idle/Hover Button Colors

#3 Post by vwxyang0707 »

So I looked under screens.rpy and this chunk of code was missing.

Code: Select all

style choice_button is default:
    properties gui.button_properties("choice_button")

style choice_button_text is default:
    properties gui.button_text_properties("choice_button")
Once I added that back in, I got the text color I wanted, but paired with Ren'py's default choice button.
Image
Would there be a way to not use ANY choice buttons?

User avatar
xavimat
Eileen-Class Veteran
Posts: 1461
Joined: Sat Feb 25, 2012 8:45 pm
Completed: Yeshua, Jesus Life, Cops&Robbers
Projects: Fear&Love
Organization: Pilgrim Creations
Github: xavi-mat
itch: pilgrimcreations
Location: Spain
Discord: xavimat
Contact:

Re: Different Idle/Hover Button Colors

#4 Post by xavimat »

vwxyang0707 wrote: Sun Nov 12, 2017 5:15 pmWould there be a way to not use ANY choice buttons?
Do you mean no background? Then you can add the "background None" property. Maybe on the style or on the screen choice itself.
Comunidad Ren'Py en español: ¡Únete a nuestro Discord!
Rhaier Kingdom A Ren'Py Multiplayer Adventure Visual Novel.
Cops&Robbers A two-player experiment | Fear&Love Why can't we say I love you?
Honest Critique (Avatar made with Chibi Maker by ~gen8)

vwxyang0707
Newbie
Posts: 10
Joined: Wed Oct 25, 2017 12:08 am
Contact:

Re: Different Idle/Hover Button Colors

#5 Post by vwxyang0707 »

Yes, that worked perfectly! I'm a huge newbie to Ren'py, so thank you :)

Post Reply

Who is online

Users browsing this forum: arewar, Google [Bot], Rhapsy