theme.roundrect - Ren'Py

documentation index ◦ reference manual ◦ function index

# theme.roundrect

Function: | theme.roundrect | (widget="#003c78", widget_hover="#0050a0", widget_text="#c8e1ff", widget_selected="#ffffc8", disabled="#404040", disabled_text="#c8c8c8", label=,"#ffffff" frame="#6496c8", window="#000000c0", text_size=None, small_text_size=None, mm_root=..., gm_root=..., less_rounded=False):

This enables the use of the roundrect theme. By default, this theme styles the game in a blue color scheme. However, by supplying one or more of the parameters given below, the color scheme can be changed.

widget - The background color of non-focued buttons and sliders.

widget_hover - The background color of focused buttons and sliders.

widget_text - The text color of non-selected buttons.

widget_selected - The text color of selected buttons.

disabled - The background color of disabled buttons.

disabled_text - The text color of disabled buttons.

label - The text color of non-selected labels.

frame - The background color of frames.

mm_root - A displayable (such as an Image or Solid) that will be used as the background for the main menu.

gm_root - A displayable (such as an Image or Solid) that will be used as the background for the game menu.

less_rounded - If True, causes the buttons to appear less rounded in 800x600 mode (has no effect in 640x480 mode).

text_size - The size of text, such as button captions, labels, and prompts. Defaults to 18 if the screen is 640 pixels wide or less, and 22 otherwise.

small_text_size - The size of the text on large buttons. Defaults to 12 if the screen is 640 pixels wide or less, and 16 otherwise.

widget, widget_hover, disabled, and frame may either be single colors, or tuples containing two colors. In the latter case, a vertical gradient is used.

### Component functions

The following functions exist to allow you to add elements of the roundrect theme to another theme. The other theme must have been set up before these functions can be used. Arguments are as for roundrect, except that all must be specified (no defaulting occurs).

- theme.roundrect_labels(text_size, label)
- theme.roundrect_frames(less_rounded, frame)
- theme.roundrect_buttons(text_size, less_rounded, widget, widget_hover, widget_text, widget_selected, disabled, disabled_text)
- theme.roundrect_large_buttons(text_size, less_rounded, widget, widget_hover, widget_text, widget_selected, disabled, disabled_text)
- theme.roundrect_prompts(text_size, label)
- theme.roundrect_bars(widget, widget_hover)

## Example

This code usually lives in options.rpy.

    init -1:
        python hide:

            theme.roundrect(

                ## The color of an idle widget face.
                widget = ("#005c98", "#003c78"),

                ## The color of a focused widget face.
                widget_hover = ("#0070c0", "#0050a0"),

                ## The color of the text in a widget.
                widget_text = "#c8ffff",

                ## The color of the text in a selected widget. (For
                ## example, the current value of a preference.)
                widget_selected = "#ffffc8",

                ## The color of a disabled widget face.
                disabled = ("#606060", "#404040"),

                ## The color of disabled widget text.
                disabled_text = "#c8c8c8",

                ## The color of informational labels.
                label = "#ffffff",

                ## The color of a frame containing widgets.
                frame = "#6496c8",

                ## The background of the main menu. This can be a color
                ## beginning with '#', or an image filename. The latter
                ## should take up the full height and width of the screen.
                mm_root = "mainmenu.jpg",

                ## The background of the game menu. This can be a color
                ## beginning with '#', or an image filename. The latter
                ## should take up the full height and width of the screen.
                gm_root = "#dcebff",

                ## 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.
                )

documentation index ◦ reference manual ◦ function index