How to restyle Ren'Py 8's GUI: textbox, choice buttons, frames and themes
Pack for this guide: Crisp Cute VN (free sampler on itch.io).
Short answer: Most of the Ren'Py look lives in game/gui.rpy: change the define gui.* colours, fonts and sizes there, and replace the images in game/gui/ (textbox.png, namebox.png, button/choice_idle_background.png and the rest) with your own under the same names. Borders(left, top, right, bottom) tells Ren'Py how to 9-slice an image so it stretches without bending its corners. For deeper changes edit the styles in screens.rpy, and for themes the player can switch, use gui.preference() with gui.SetPreference().
1. Know which file does what
game/gui.rpy: colours, fonts, text sizes, positions and the 9-slice borders of the stock GUI.game/screens.rpy: the screens (say, choice, preferences, save) and the styles they use.game/gui/: the images. Replacing a file with one of the same name and size changes the look with no code at all.
A new Ren'Py 8 project is 1920 x 1080 unless you chose otherwise; draw for the size in gui.init(). The numbers below are for 1920 x 1080 and match the free Crisp Cute VN sampler images.
2. Change colours and fonts
gui.rpy (change the existing lines)
## Colours and fonts
define gui.accent_color = "#cc5c84"
define gui.idle_color = "#925c70"
define gui.hover_color = gui.accent_color
define gui.text_color = "#6d2f47"
define gui.interface_text_color = "#6d2f47"
define gui.text_font = "fonts/Fredoka.ttf"
define gui.name_text_font = "fonts/Fredoka.ttf"
define gui.interface_text_font = "fonts/Fredoka.ttf"
## Textbox and name box
define gui.textbox_height = 310
define gui.namebox_height = 78
define gui.namebox_borders = Borders(84, 8, 42, 14)
## Choice buttons
define gui.choice_button_height = 88
define gui.choice_button_borders = Borders(96, 10, 96, 18)
define gui.choice_button_text_idle_color = "#6d2f47"
define gui.choice_button_text_hover_color = "#ffffff"
define gui.choice_button_text_insensitive_color = "#be9dae"
Put the font file in game/fonts/. Fredoka is a free rounded font under the SIL Open Font License; a copy is in the Crisp Cute free sampler. Text stays real text, so translations and long names keep working.
3. Replace the textbox and name box
The dialogue window draws gui/textbox.png at the bottom of the screen in an area gui.textbox_height tall. The name box draws gui/namebox.png as a 9-slice frame using gui.namebox_borders, so it grows with the speaker's name. With the Crisp Cute VN Free images that is a 310 px textbox and a 78 px heart name tag, the values in the block above.
If the text does not sit where your art expects it, move it with gui.dialogue_xpos, gui.dialogue_ypos, gui.dialogue_width, gui.name_xpos and gui.name_ypos.
4. 9-slice any image with Frame()
Frame() cuts an image into nine parts: the corners are drawn as they are, the edges stretch one way and the middle both ways. Frame("gui/frame.png", 40, 40) uses 40 px on the left and right and 40 px top and bottom; give four numbers or a Borders for different sides, and tile=True to repeat a patterned edge instead of stretching it.
screens.rpy or any .rpy file
screen letter(message):
frame:
background Frame("gui/frame.png", 40, 40)
padding (56, 48)
xalign 0.5
yalign 0.4
xmaximum 900
text message
Show it with show screen letter("Dear friend, the picnic is at noon."). The padding keeps the text off the border.
5. Style the choice buttons
Menu choices use gui/button/choice_idle_background.png, choice_hover_background.png and choice_insensitive_background.png, sliced with gui.choice_button_borders and coloured by the gui.choice_button_text_* lines in the block above. To show a choice the player cannot pick yet as a locked button instead of hiding it, turn on config.menu_include_disabled:
script.rpy
define config.menu_include_disabled = True
default has_key = False
label picnic:
menu:
"Share the strawberry cake":
jump share_cake
"Open the garden gate" if has_key:
jump garden_gate
6. Let players switch themes
Keep one folder of images per theme (gui/themes/strawberry/, gui/themes/matcha/) and read the theme from a GUI preference. Put the gui.theme line below the gui.init() block in gui.rpy: above it, the preference store does not exist yet and lint fails.
gui.rpy
define gui.theme = gui.preference("theme", "strawberry")
define gui.accent_color = {"strawberry": "#cc5c84", "matcha": "#5c913d"}[gui.theme]
In screens.rpy, point the styles at the theme folder:
screens.rpy (style window: change the background line; style choice_button: add one line)
style window:
background Image("gui/themes/" + gui.theme + "/textbox.png", xalign=0.5, yalign=1.0)
style choice_button is default:
properties gui.button_properties("choice_button")
background Frame("gui/themes/" + gui.theme + "/button/choice_[prefix_]background.png", gui.choice_button_borders)
Then add the picker to the preferences screen:
screens.rpy, inside screen preferences()
vbox:
style_prefix "radio"
label _("Theme")
textbutton _("Strawberry Milk") action gui.SetPreference("theme", "strawberry")
textbutton _("Matcha") action gui.SetPreference("theme", "matcha")
gui.SetPreference() saves the choice in persistent data, rebuilds the GUI so every define gui.* line and style above is evaluated again, and marks the matching button as selected. Rebuilding is slow, so use it on click, never on hover.
How this was tested
These edits were applied to the stock project that ships with the Ren'Py 8.5.3 SDK, with the Crisp Cute VN Free images and the Fredoka font. Lint reports no errors, and a headless run switched the textbox, choice buttons and accent colour from Strawberry Milk to Matcha with gui.SetPreference().
Free assets to try
Crisp Cute VN Free: 17 images from the Strawberry Milk theme at 1920 x 1080 scale: the stitched textbox, heart name tag, click-to-continue heart, choice buttons (idle, hover, locked), quick menu tray, confirm box, notify and skip pop-ups, a frame and the cursor, with set-up notes. The numbers on this page are for these images. Download Crisp Cute VN Free.
The full Crisp Cute VN ($6.99) is a complete Ren'Py 8 project with every screen already restyled in 6 pastel themes, a theme picker in Preferences that does what step 6 describes, and the Fredoka font. Claude (an AI assistant) designed everything in this pack: every image is drawn by code it wrote. All 19 Crisp packs are also in the Crisp Everything Bundle for $17.99.