Code: Select all
## The color of an idle widget face.
widget = "images/button_idle.png",
## The color of a focused widget face.
widget_hover = "images/button_idle.png",
## The color of the text in a widget.
widget_text = "#FFFFFF",
## The color of the text in a selected widget. (For
## example, the current value of a preference.)
widget_selected = "images/button_idle.png",
## The color of a disabled widget face.
disabled = "images/button_idle.png",
## The color of disabled widget text.
disabled_text = "#969CA1",
## The color of informational labels.
label = "#ADC9E0",
frame = "images/frame.png",
These values must be hexadecimal colors. theme.regal is a roundrect_based_theme which is a default theme that when called, sets the style options according to the color modifier values you give it.
A renpy theme is just a fancy and convenient wrapper for setting up the game's style options. If you are making a custom theme that will only be used in one specific way, there isn't a need to make an @theme function, you should just set your desired style values for the game. Using the @theme decorator is good if you wish to share a dynamic theme you made with others, or even allow the user to pick their own parameters for the game's theme.
Have a look at the /renpy/common/00themes.rpy file. There are a few examples of how you can setup a theme.
1) If you want to just use an existing theme with default values, just call theme.regal (or whatever theme you wish to copy from) with the desired colors. You can find the default themes near line 420 (blaze it
)
2) If you want to make a custom static theme, have a look at the ancient theme on line 429. All it takes is a call to theme.ancient() and it sets up all the hardcoded style options for you.
3) If you want to make a custom dynamic theme, have a look at line 745 and onward. That is the a_white_tulip theme. It's a bit more verbose and has a lot more customization to the style options than the default roundrect themes.
4) If you just want to customize an existing theme beyond the color options, call the theme you want with the desired options (that will set the initial styles) then override any styles you wish. Note: there are a lot of style options that rely on the widget and widget_hover colors, so if you want to have a custom image for those, please look at the roundrect_based_theme for what uses those options.
Example: (the colors are random)
Code: Select all
theme.regal(
## The color of an idle widget face.
widget = "#BCF431",
## The color of a focused widget face.
widget_hover = "#47BF8C",
## The color of the text in a widget.
widget_text = "#FFFFFF",
## The color of the text in a selected widget. (For
## example, the current value of a preference.)
widget_selected = "88AABB",
## The color of a disabled widget face.
disabled = "#446677",
## The color of disabled widget text.
disabled_text = "#969CA1",
## The color of informational labels.
label = "#ADC9E0",
## The color of a frame containing widgets.
frame = "#ACB4FC"
## And we're done with the theme. The theme will customize
## various styles, so if we want to change them, we should
## do so below.
)
#Then set any of the style options you wish to use.
style.frame.background = Box("images/frame.png", False)
I believe that covers most of what themes are for. Hope that helps.