GUI Customization Guide
Ren'Py features a GUI system that (we hope) looks attractive out of the box,can be customized somewhat, and can be replaced entirely if necessary. Thispage explains how to do simple and intermediate levels of GUI customization.
For more advanced customization, please take a look at the documentation forstyles (including the list ofstyle properties)andscreens (includingscreen actionsandspecial screens).
This assumes that you're using a new-style Ren'Py GUI (contained in thegui.rpyfile). Older GUIs (that use thescreens.rpy file) should be treated as advancedGUI customization for the purposes of this guide.
Simple GUI Customization
There are a few simple pieces of GUI customization that make sense forall but the simplest visual novels. What these customizations have incommon is that they do not require editinggui.rpy. These customizationschange the GUI somewhat, but do not drastically change the look of theGUI.
Change Size and Colors
The easiest thing to change about the GUI is to change the size andcolor of the GUI. Ren'Py will prompt you to make these choices whenyou first create a project, but choosing "Change/Update GUI" in thelauncher will let you change your choice.
When changing the GUI through the launcher, Ren'Py will prompt if youwant to simply change the launcher, or updategui.rpy. Both choiceswill overwrite most image files, and overwritinggui.rpy will get ridof changes to that file.
As a result, you probably want to do this before any other customization.
Ren'Py will prompt for the default resolution of the project, and thenalso for the color scheme to use. Once you select those, it will updatethe GUI to match your choices.
Options.rpy
There are a couple of variables inoptions.rpy that are used by theGUI.
config.nameA string giving a human-readable name for the game. This is used as thewindow title, and throughout the GUI wherever the title of thegame is needed.
gui.show_nameThis should be set to False to hide the title and version number fromthe main menu. (Say, because the title is "baked into" the main menuimage.)
config.versionA string giving the version of the game. This is presented to theuser in various places in the default GUI. It has other uses apartfrom that, such as error messages or tracebacks.
gui.aboutAdditional text that is added to the about screen. If you want multipleparagraphs of credits, \n\n can be used to separate the paragraphs.
Here's an example of these defines:
defineconfig.name=_('Old School High School')definegui.show_name=Truedefineconfig.version="1.0"definegui.about=_("Created by PyTom.\n\nHigh school backgrounds by Mugenjohncel.")
For convenience, it might make sense to define gui.about using a triple-quotedstring, in which case line endings are respected.
definegui.about=_("""\Created by PyTom.High school backgrounds by Mugenjohncel.""")
Game and Main Menu Background Images
The images used by the GUI can be found in the game/gui directory,which can be opened by choosing "Open Directory: gui" from thelauncher. The relevant files are:
- gui/main_menu.png
A file that contains an image that is used in the background ofall screens of the main menu.
- gui/game_menu.png
A file that contains an image that is used in the background ofall screens of the game menu.

The main menu, with onlygui/main_menu.png replaced.

The about screen can be part of the game menu (usinggui/game_menu.pngas the background) or the main menu (usinggui/main_menu.png as thebackground). Both can be set to the same image.
Window Icon
The window icon is the icon that is displayed (in places like the Windowstask bar and Macintosh dock) by a running application.
The window icon can be changed by replacinggui/window_icon.png.
Note that this only changes the icon used by the running game. To changethe icon used by Windows .exe files and Macintosh applications, see thebuild documentation.
Intermediate GUI Customization
Next, we will demonstrate the intermediate level of GUI customization.At the intermediate level, it's possible to change the colors, fonts,and images used by the game. In general, intermediate customizationkeeps the screens mostly the same, with buttons and bars in the sameplaces, although modifying the screens to add new functionalityis certainly possible.
Many of these changes involve editing variables ingui.rpy. For example,to increase the dialogue font size, find the line that reads:
definegui.text_size=22
and increase or decrease it, for example, to:
definegui.text_size=20
Note that the default values are often different than what's found inthis documentation. The default values can changed based on size andcolors selected for the game, and the values in this file are an exampleof extensive GUI customization. It's best to searchgui.rpy for define andthe variable in question – for example,definegui.text_size.
Some of the adjustments below either partially or completely effect imagefiles. As a result, the changes only take effect when the image filesthemselves are updated, which can be done by choosing "Change GUI" inthe launcher, and telling it to regenerate image files. (But note thatdoing so will overwrite any image files you have already modified.)
You may want to consider waiting until your game is nearly complete beforecustomizinggui.rpy in this way. While oldgui.rpy files will work in newerRen'Py versions, newergui.rpy files may have features and fixes that olderversions lack. Customizing the GUI early may make it harder to takeadvantage of such improvements.
Dialogue
There are a number of relatively easy customizations that can be performedto change how dialogue is displayed to the player. The first is changingthe textbox.
- gui/textbox.png
This file contains the background of the text window, displayed as partof the say screen. While this should be the full width of the game, textis only displayed in the central 60% of the screen, with a 20% borderon either side.
In addition, there are a number of variables that can be customized to changedialogue.
- definegui.text_color="#402000"
This sets the color of the dialogue text.
- definegui.text_font="ArchitectsDaughter.ttf"
This sets the font that is used for dialogue text, menus, inputs, andother in-game text. The font file should exist in the game directory.
- definegui.text_size=33
Sets the size of the dialogue text. This may need to be increased ordecreased to fit the selected font in the space allotted.
- definegui.name_text_size=45
Sets the size of character names.
By default, the character name label uses the accent color. The color canbe easily changed when defining a character:
definee=Character("Eileen",who_color="#104010")

An example textbox image.

Dialogue customized using the textbox image and the variablesettings given above.
Choice Menus
The choice screen is used by the menu statement to display choices tothe player. Again, there are some relatively easy customizations thatcan be performed on the choice screen. The first are the two imagefiles:
- gui/button/choice_idle_background.png
This image is used as the background of choice buttons that are notfocused.
- gui/button/choice_hover_background.png
This image is used as the background of choice buttons that are focused.
By default, text is placed in the central 75% of these images. There arealso a couple of variables that control the color of the text in choicebuttons.
- definegui.choice_button_text_idle_color='#888888'
The color used for the text of unfocused choice buttons.
- definegui.choice_button_text_hover_color='#0066cc'
The color used for the text of focused choice buttons.
These should suffice for simple customization, where the size of the imagesdoes not need to be changed. For more complex customizations, check out thesection on buttons, below.

An examplegui/button/idle_background.png image.

An examplegui/button/choice_hover_background.png image.

An example of the choice screen, as customized using the imagesand variable settings given above.
Overlay Images
There are also a pair of overlay images. These are used to darken orlighten the background image to make buttons and other user interfacecomponents more readable. These images are in the overlay directory:
- gui/overlay/main_menu.png
The overlay used by the main menu screen.
- gui/overlay/game_menu.png
The overlay used by game-menu-like screens, including load, save,preferences, about, help, etc. This overlay is selected by thescreen in question, and is used even when at the main menu.
- gui/overlay/confirm.png
The overlay used in the confirm screen to darken the background.
Here are a pair of example overlay images, and what the game looks likewith the overlay images added.

An examplegui/overlay/main_menu.png image.

An examplegui/overlay/game_menu.png image.

The main menu after changing the overlays.

The game menu after changing the overlays.
Colors, Fonts, and Font Sizes
There are a number of GUI variables that can be used to change the color, font,and size of text.
These variables should generally be set to hexadecimal color codes, which areare strings of the form "#rrggbb" (or "#rrggbbaa" to specify an alpha component),similar to color codes used by web browsers. For example, "#663399" is the codefor a shade ofpurple.There are many tools online that let you create HTML color codes, such asthis one.
In addition togui.text_color,gui.choice_idle_color, andgui.choice_hover_color,documented above, the following variables exist:
- definegui.accent_color='#000060'
The accent color is used in many places in the GUI, including titlesand labels.
- definegui.idle_color='#606060'
The color used for most buttons when not focused or selected.
- definegui.idle_small_color='#404040'
The color used for small text (like the date and name of a save slot,and quick menu buttons) when not hovered. This color often needs to be abit lighter or darker than idle_color to compensate for the smaller sizeof the font.
- definegui.hover_color='#3284d6'
The color used by focused items in the GUI, including the text ofof buttons and the thumbs (movable areas) of sliders and scrollbars.
- definegui.selected_color='#555555'
The color used by the text of selected buttons. (This takes priorityover the hover and idle colors.)
- definegui.insensitive_color='#8888887f'
The color used by the text of buttons that are insensitive to user input.(For example, the rollback button when no rollback is possible.)
- definegui.interface_text_color='#404040'
The color used by static text in the game interface, such as text on thehelp and about screens.
- definegui.muted_color='#6080d0'
- definegui.hover_muted_color='#8080f0'
Muted colors, used for the sections of bars, scrollbars, and sliders thatdo not represent the value or visible area. (These are only used whengenerating images, and will not take effect until images are regeneratedin the launcher.)
In additional togui.text_font, the following variables selects thefonts used for text. These fonts should also be placed in the game directory.
- definegui.interface_text_font="ArchitectsDaughter.ttf"
The font used for text for user interface elements, like the main andgame menus, buttons, and so on.
- definegui.system_font="DejaVuSans.ttf"
The font used for system text, like exception messages and the shift+Aaccessibility menu. This should be able to handle both ASCII and thegame's translated language.
- definegui.glyph_font="DejaVuSans.ttf"
A font used for certain glyphs, such as the arrow glyphs used by the skipindicator. DejaVuSans is a reasonable default for these glyphs, and isautomatically included with every Ren'Py game.
In addition togui.text_size andgui.name_text_size, the followingvariables control text sizes.
- definegui.interface_text_size=36
The size of static text in the game's user interface, and the default sizeof button text in the game's interface.
- definegui.label_text_size=45
The size of section labels in the game's user interface.
- definegui.notify_text_size=24
The size of notification text.
- definegui.title_text_size=75
The size of the game's title.

The game menu after customizing text colors, fonts, and sizes.
Borders
There are a number of GUI components – such as buttons and bars – that usescalable backgrounds configured using Border objects. Before discussing,how to customize buttons and bars, we'll first describe how this works.
Borders are given to theFrame() displayable.A Frame takes an image, and divides it into nine parts – the four corners,the four sides, and the center. The corners always remain the same size,the left and right sides are stretched vertically, the top and bottom sidesare stretched horizontally, and the center is stretched in both directions.
A Borders object gives the size of each of the borders, in left, top, right,bottom order. So if the following border image is used:

along with the following borders:
Borders(40,40,40,40)
one possible result is this:

As the child changes size, so will the background.
A Border object can also be given padding, including negative padding thatcauses the child to overlap the borders. For example, these borders:
Borders(40,40,40,40,-20,-20,-20,-20)
allow the child to overlap the sides. Note that due to this overlap, theresult is smaller, since the borders themselves now take up less space.

Borders can also be tiled, rather than scaled. This is invoked by variables,and produces this result.

These example images are a bit ugly, since we need to show what's going on.In practice, this system can produce quite pleasing results. This is the case whena Frame displayable is used as the background of a frame window holdinguser interface components.
These frame windows can be customized in two ways. The first is by changing thebackground image file:
- gui/frame.png
The image used as the background of frames windows.
And the second is by customizing variables.
- definegui.frame_borders=Borders(15,15,15,15)
The borders applied to frame windows.
- definegui.confirm_frame_borders=Borders(60,60,60,60)
The borders applied to the fame used in the confirm screen.
- definegui.frame_tile=True
If true, the sides and center of the confirm screen are tiled. If false,they are scaled.

An examplegui/frame.png image.

The confirm screen after applying the customizations givenabove.
Buttons
The Ren'Py user interface includes a large number of buttons, buttonsthat come in different sizes and that are used for different purposes.The various kinds of buttons are:
- button
A basic button. Used for navigation within the user interface.
- choice_button
A button used for choices in the in-game menu.
- quick_button
A button, displayed in-game, that is intended to allow quick accessto the game menu.
- navigation_button
A button used in main and game menu for navigation between screens,and to start the game.
- page_button
A button used to switch between pages on the load and save screens.
- slot_button
Buttons that represent file slots, and contain a thumbnail, the savetime, and an optional save name. These are described in more detailbelow.
- radio_button
A button used for multiple-choice preferences on the preferencesscreen.
- check_button
A button used for toggleable preferences on the preferences screen.
- test_button
A button used to test audio playback on the preferences screen. Thisshould be the same height as a horizontal slider.
- help_button
A button used to select what kind of help the player wants.
- confirm_button
A button used on the confirm screen to select yes or no.
- nvl_button
A button used for an NVL-mode menu choice.
The following image files are used to customize button backgrounds,if they exist.
- gui/button/idle_background.png
The background image used by buttons that are not focused.
- gui/button/hover_background.png
The background image used by buttons that are focused.
- gui/button/selected_idle_background.png
The background image used by buttons that are selected but notfocused. This is optional, and is used in preference to
idle_background.pngif it exists.- gui/button/selected_hover_background.png
The background image used by buttons that are selected but notfocused. This is optional, and is used in preference to
hover_background.pngif it exists.
More specific backgrounds can be given for each kind of button, byprefixing it with the kind. For example,gui/button/check_idle_background.pngis used as the background of check buttons that are not focused.
Four image files are used as foreground decorations on radio and checkbuttons, to indicate if the option is chosen or not.
- gui/button/check_foreground.png, gui/button/radio_foreground.png
These images are used when a check or radio button is not selected.
- gui/button/check_selected_foreground.png, gui/button/radio_selected_foreground.png
These images are used when a check or radio button is selected.
The following variables set various properties of buttons:
- definegui.button_width=None
- definegui.button_height=64
The width and height of a button, in pixels. If None, the size isautomatically determined based on the size of the text inside a button,and the borders given below.
- definegui.button_borders=Borders(10,10,10,10)
The borders surrounding a button, in left, top, right, bottom order.
- definegui.button_tile=True
If true, the sides and center of the button background are tiled toincrease or decrease their size. If false, the sides and center arescaled.
- definegui.button_text_font=gui.interface_font
- definegui.button_text_size=gui.interface_text_size
The font and size of the button text.
- definegui.button_text_idle_color=gui.idle_color
- definegui.button_text_hover_color=gui.hover_color
- definegui.button_text_selected_color=gui.accent_color
- definegui.button_text_insensitive_color=gui.insensitive_color
The color of the button text in various states.
- definegui.button_text_xalign=0.0
The horizontal alignment of the button text. 0.0 is left-aligned,0.5 is centered, and 1.0 is right-aligned.
- definegui.button_image_extension=".png"
The extension for button images. This could be changed to .webpto use WEBP button images instead of png ones.
These variables can be prefixed with the button kind to configure aproperty for a particular kind of button. For example,gui.choice_button_text_idle_color configures the color ofan idle choice button.
For example, we customize these variables in our sample game.
- definegui.navigation_button_width=290
Increases the width of navigation buttons.
- definegui.radio_button_borders=Borders(40,10,10,10)
- definegui.check_button_borders=Borders(40,10,10,10)
Increases the width of radio and check button borders, leaving extraspace on the left for the check mark.
Here's an example of how the play screen can be customized.

An examplegui/button/idle_background.png image.

An examplegui/button/hover_background.png image.

An image that can be used asgui/button/check_foreground.png andgui/button/radio_foreground.png.

An image that can be used asgui/button/check_selected_foreground.png andgui/button/radio_selected_foreground.png.

The preferences screen with the customizations described in thissection applied.
Save Slot Buttons
The load and save screens use slot buttons, which are buttons that presenta thumbnail and information about when the file was saved. The followingvariables are quite useful when it comes to customizing the size ofthe save slots.
- definegui.slot_button_width=414
- definegui.slot_button_height=309
The width and height of the save slot button.
- definegui.slot_button_borders=Borders(15,15,15,15)
The borders applied to each save slot.
config.thumbnail_width = 384 andconfig.thumbnail_height = 216set the width and height of the save thumbnails. Note that these live inthe config namespace, not the gui namespace. These do not take effectuntil the file is saved and loaded.
- definegui.file_slot_cols=3
- definegui.file_slot_rows=2
The number of columns and rows in the grid of save slots.
There are the background images used for save slots.
- gui/button/slot_idle_background.png
The image used for the background of save slots that are not focused.
- gui/button/slot_hover_background.png
The image used for the background of save slots that are focused.
Putting those to use, we get:

An examplegui/button/slot_idle_background.png image.

An examplegui/button/slot/slot_hover_background.png image.

The save screen after applying the customizations given in thissection.
Sliders
Sliders are a type of bar that is used in the preferences screen toallow the player to adjust preference with a large number of values.By default, the GUI only uses horizontal sliders, but a gamemay also use vertical sliders.
Sliders are customized with the following images:
- gui/slider/horizontal_idle_bar.png, gui/slider/horizontal_hover_bar.png, gui/slider/vertical_idle_bar.png, gui/slider/vertical_hover_bar.png
Images used for vertical and idle bar backgrounds in idle andhover states.
- gui/slider/horizontal_idle_thumb.png, gui/slider/horizontal_hover_thumb.png, gui/slider/vertical_idle_thumb.png, gui/slider/vertical_hover_thumb.png
Images used for the thumb – the movable part of the bar.
The following variables are also used:
- definegui.slider_size=64
The height of horizontal sliders, and width of vertical sliders.
- definegui.slider_tile=True
If true, the frame containing the bar of a slider is tiled. If False,if it scaled.
- definegui.slider_borders=Borders(6,6,6,6)
- definegui.vslider_borders=Borders(6,6,6,6)
The borders that are used with the Frame containing the bar image.
Here's an example of how we customize the horizontal slider.

An examplegui/slider/horizontal_idle_bar.png image.

An examplegui/slider/horizontal_hover_bar.png image.

An examplegui/slider/horizontal_idle_thumb.png image.

An examplegui/slider/horizontal_hover_thumb.png image.

The preferences screen after applying the customizations given in thissection.
Scrollbars
Scrollbars are bars that are used to scroll viewports. In the GUI,the most obvious place a scrollbar is used is the history screen,but vertical scrollbars can be used on other screens as well.
Sliders are customized with the following images:
- gui/scrollbar/horizontal_idle_bar.png, gui/scrollbar/horizontal_hover_bar.png, gui/scrollbar/vertical_idle_bar.png, gui/scrollbar/vertical_hover_bar.png
Images used for vertical and idle bar backgrounds in idle andhover states.
- gui/scrollbar/horizontal_idle_thumb.png, gui/scrollbar/horizontal_hover_thumb.png, gui/scrollbar/vertical_idle_thumb.png, gui/scrollbar/vertical_hover_thumb.png
Images used for the thumb – the movable part of the bar.
The following variables are also used:
- definegui.scrollbar_size=24
The height of horizontal scrollbars, and width of vertical scrollbars.
- definegui.scrollbar_tile=True
If true, the frame containing the bar of a scrollbar is tiled. If False,if it scaled.
- definegui.scrollbar_borders=Borders(10,6,10,6)
- definegui.vscrollbar_borders=Borders(6,10,6,10)
The borders that are used with the Frame containing the bar image.
- definegui.unscrollable="hide"
This controls what to do if the bar is unscrollable. "hide" hidesthe bar, while None keeps it shown.
Here's an example of how we customize the vertical scrollbar.

An examplegui/scrollbar/vertical_idle_bar.png image.

An examplegui/scrollbar/vertical_hover_bar.png image.

An examplegui/scrollbar/vertical_idle_thumb.png image.

An examplegui/scrollbar/vertical_hover_thumb.png image.

The history screen after applying the customizations given in thissection.
Bars
Plain old bars are used to display a number to the player. They're notused in the GUI, but can be used in creator-defined screens.
A bar can customized by editing the following images:
- gui/bar/left.png, gui/bar/bottom.png
Images that are used for the filled section of horizontal and vertical bars.
- gui/bar/right.png, gui/bar/top.png
Images that are used for the filled section of horizontal and vertical bars.
There are also the usual variables that control bars:
- definegui.bar_size=64
The height of horizontal bars, and width of vertical bars.
- definegui.bar_tile=False
If true, the bar images are tiled. If false, the images are linearlyscaled.
- definegui.bar_borders=Borders(10,10,10,10)
- definegui.vbar_borders=Borders(10,10,10,10)
The borders that are used with the Frames containing the bar images.
Here's an example of how we customize horizontal bars.

An examplegui/bar/left.png image.

An examplegui/bar/right.png image.

A screen we defined to give an example of a bar.
Skip and Notify
The skip and notify screens both display frames with messages in them. Bothuse custom frame background images:
- gui/skip.png
The background of the skip indicator.
- gui/notify.png
The background of the notify screen.
The variables that control these are:
- definegui.skip_frame_borders=Borders(24,8,75,8)
The borders of the frame that is used by the skip screen.
- definegui.notify_frame_borders=Borders(24,8,60,8)
The borders of the frame that is used by the notify screen.
- definegui.skip_ypos=15
The vertical position of the skip indicator, in pixels from the top of thewindow.
- definegui.notify_ypos=68
The vertical position of the notify message, in pixels from the top of thewindow.
Here is an example of customizing the skip and notify screens.

An examplegui/skip.png image.

An examplegui/notify.png image.

These skip and notify screens in action.
Dialogue, Continued
In addition to the simple customizations given above, there are a numberof ways to control how dialogue is presented to the player.
Textbox
The textbox (or window) is the window the dialogue is displayed in. In additionto changing gui/textbox.png, the following variables control how the textboxis displayed.
- definegui.textbox_height=278
The height of the textbox window, which should also be the height of gui/textbox.png.
- definegui.textbox_yalign=1.0
The placement of the textbox vertically on the screen. 0.0 is the top,0.5 is center, and 1.0 is the bottom.
Name and Namebox
The character's name is placed inside a frame that uses gui/namebox.png asits background. In addition, there are a number of variables that controlthe presentation of the name. The namebox is only show if the speaking characterhas a name (an empty name, like " ", counts).
- definegui.name_xpos=360
- definegui.name_ypos=0
The horizontal and vertical positions of the name and namebox. Theseare usually a number of pixels from the left or top side of the textbox.Setting a variable to 0.5 centers the name in the textbox (see below).These numbers can also be negative – for example, setting gui.name_yposto -22 causes it to be places 22 pixels above the top of the textbox.
- definegui.name_xalign=0.0
The horizontal alignment of the character's name. This can be 0.0 for left-aligned, 0.5 for centered, and 1.0 for right-aligned. (It's almost always0.0 or 0.5.) This is used for both the position of the namebox relativeto gui.name_xpos, and to select the side of of the namebox that is alignedwith xpos.
- definegui.namebox_width=None
- definegui.namebox_height=None
- definegui.namebox_borders=Borders(5,5,5,5)
- definegui.namebox_tile=False
These variables control the display of the frame containing the namebox.
Dialogue
- definegui.dialogue_xpos=402
- definegui.dialogue_ypos=75
The horizontal and vertical positions of the actual dialogue. Theseare usually a number of pixels from the left or top side of the textbox.Setting a variable to 0.5 centers the dialogue in the textbox (see below).
- definegui.dialogue_width=1116
This variable gives the maximum width of a line of dialogue, in pixels.When dialogue reaches this width, it will be wrapped by Ren'Py.
- definegui.dialogue_text_xalign=0.0
The horizontal alignment of dialogue text. 0.0 is left aligned, 0.5 iscentered, and 1.0 is right-aligned.
Examples
To center the character's name, use:
definegui.name_xpos=0.5definegui.name_xalign=0.5
To center dialogue text, use:
definegui.dialogue_xpos=0.5definegui.dialogue_text_xalign=0.5
Our example game uses these statements to customize the centered namebox:
definegui.namebox_width=300definegui.name_ypos=-22definegui.namebox_borders=Borders(15,7,15,7)definegui.namebox_tile=True

An examplegui/namebox.png image.

The example game, customized with the settings above.
History
There are a few variables that control the way the history screenis displayed.
Theconfig.history_length variable, which defaults to 250,sets the number of blocks of dialogue Ren'Py will keep at history.
- definegui.history_height=210
The height of a history entry, in pixels. This can be None to allowthe height of a history entry to vary at the cost of performance –config.history_length may need to be lowered significantly when thisis None.
- definegui.history_spacing=0
The amount of space to leave between history entries, in pixels.
- definegui.history_name_xpos=0.5
- definegui.history_text_xpos=0.5
The horizontal positions of the name label and dialogue text. Thesecan be a number of pixels from the left side of the history entry,or 0.5 to center.
- definegui.history_name_ypos=0
- definegui.history_text_ypos=60
The vertical positions of the name label and dialogue text, relativeto the top of a history entry, in pixels.
- definegui.history_name_width=225
- definegui.history_text_width=1110
The width of the name label and dialogue text, in pixels.
- definegui.history_name_xalign=0.5
- definegui.history_text_xalign=0.5
This controls the alignment of text and the side of the text that isaligned with xpos. 0.0 is left-aligned, 0.5 is center-aligned, 1.0 isright-aligned.

The history screen customized with the settings given above.
NVL
The nvl screen displays NVL-mode dialogue. There are a number of ways itcan be customized. The first is to customize the NVL-mode background image:
- gui/nvl.png
The background image used in NVL-mode. This should be the same size asthe game window.
There are also a number of variables that are used to customize the wayNVL-mode text is displayed.
- definegui.nvl_borders=Borders(0,15,0,30)
The borders around the background of the NVL-mode. Since thebackground is not a frame, this is only used to pad out the NVL-modeto prevent it from pressing up against the sides of the screen.
- definegui.nvl_height=173
The height of a single NVL-mode entry. Setting this to a fixed heightmakes it possible to have NVL-mode without paging, showing a fixed numberof entries at once. Setting this to None allows entries to be of avariable size.
- definegui.nvl_spacing=15
The spacing between entries when gui.nvl_height is None, and the spacingbetween NVL-mode menu buttons.
- definegui.nvl_name_xpos=0.5
- definegui.nvl_text_xpos=0.5
- definegui.nvl_thought_xpos=0.5
The positioning of character names, dialogue text, and thought/narrationtext, relative to the left side of the entry. This can be a number ofpixels, or 0.5 to represent the center of the entry.
- definegui.nvl_name_xalign=0.5
- definegui.nvl_text_xalign=0.5
- definegui.nvl_thought_xalign=0.5
The alignment of the text. This controls both the alignment of the text,and the side of the text that is placed at xpos. This can be 0.0 for left,0.5 for center, and 1.0 for right.
- definegui.nvl_name_ypos=0
- definegui.nvl_text_ypos=60
- definegui.nvl_thought_ypos=0
The position of character names, dialogue text, and thought/narration text,relative to the top of the entry. This should be a number of pixels fromthe top.
- definegui.nvl_name_width=740
- definegui.nvl_text_width=740
- definegui.nvl_thought_width=740
The width of each kind of text, in pixels.
- definegui.nvl_button_xpos=0.5
- definegui.nvl_button_xalign=0.5
The position and alignment of NVL-mode menu buttons.
Ren'Py does not use NVL-mode by default. It must be invoked using NVL-modecharacters, and by defining a few variables inscript.rpy.
definee=Character("Eileen",kind=nvl)definenarrator=nvl_narratordefinemenu=nvl_menu
Here's an example of the NVL screen as customized with the settings above.

An examplegui/nvl.png image.

The example game, customized with the settings above.
Text
Most text can be customized using GUI variables. The variables usedare of the form:
- definegui.kind_text_font
If present, the font used for the text.
- definegui.kind_text_size
If present, the size of the text.
- definegui.kind_text_color
If present, the color of the text.
Othertext style properties cam also beset in the same way. For example, gui.kind_text_outlines sets theoutlines property.
The kind prefix can be omitted, in which case it customizes the default lookof text. Otherwise, it may be one of the button kinds above, or one of:
- interface
For default text in the out-of-game interface.
- input
For text in a text input widget.
- input_prompt
For the prompt portion of a text input.
- label
For decorative labels.
- prompt
For confirmation prompts asking the player a question.
- name
For character names.
- dialogue
For dialogue.
- notify
For notification text.
For example:
definegui.dialogue_text_outlines=[(0,"#00000080",2,2)]
puts a drop shadow to the right of and below dialogue text.
Translation and GUI Variables
The gui namespace is special, in that it is saved after the init phase,but before anytranslatepython blocks are run. This makes it possible tochange any GUI variable in atranslatepython block to accommodate a secondlanguage. For example, the following code changes the default text fontand size.
translatejapanesepython:gui.text_font="MTLc3m.ttf"gui.text_size=24
There is one issue that translators need to be aware of, and that is thatin some places ingui.rpy, one variable is assigned the value of another.For example, the defaultgui.rpy has:
definegui.interface_text_font="DejaVuSans.ttf"
and later on:
definegui.button_text_font=gui.interface_text_font
Since both of these statements run before anytranslate block runs, bothvariables need to be changed.
translatejapanesepython::definegui.interface_text_font="MTLc3m.ttf"definegui.button_text_font="MTLc3m.ttf"
If the second statement was missing, DejaVuSans would still be used.
Advanced Customization
More advanced customization is possible by customizingscreens.rpy,up to and including deleting the entire contents of the file and replacingit with something of your own. Here are a few places to get started.
Styles
Styles andstyle properties control how displayablesare displayed. To find out what style a displayable is using, put the mouseover it and type Shift+I. This invokes the style inspector, which showsstyle names. Once the style name is known, a style statement can be usedto customize it.
For example, say we've lost our minds writing GUI documentation, and want toadd a bright red outline to the dialogue text. We can hover the text and pressShift+I to find out the style used is named say_dialogue. We can thenadd (to the end ofscreens.rpy, or somewhere inoptions.rpy) the style statement:
stylesay_dialogue:outlines[(1,"#f00",0,0)]
A huge number of customizations are possible using style statements.
Screens - Navigation
The next level of customization is to modify the screens. The mostimportant documentation about screens is located in theScreens and Screen LanguageandScreen Actions, Values, and Functions sections.
One of the most important screens is the navigation screen, which servesboth as the main menu, and to provide navigation for the game menu. Thisscreen can be edited to add more buttons to one or both of those. Forexample, by changing the navigation screen to:
screennavigation():vbox:style_prefix"navigation"xposgui.navigation_xposyalign0.5spacinggui.navigation_spacingifmain_menu:textbutton_("Start")actionStart()textbutton_("Prologue")actionStart("prologue")else:textbutton_("Codex")actionShowMenu("codex")textbutton_("History")actionShowMenu("history")textbutton_("Save")actionShowMenu("save")textbutton_("Load")actionShowMenu("load")textbutton_("Preferences")actionShowMenu("preferences")if_in_replay:textbutton_("End Replay")actionEndReplay(confirm=True)elifnotmain_menu:textbutton_("Main Menu")actionMainMenu()textbutton_("About")actionShowMenu("about")textbutton_("Extras")actionShowMenu("extras")ifrenpy.variant("pc"):textbutton_("Help")actionShowMenu("help")textbutton_("Quit")actionQuit(confirm=notmain_menu)
We add access to a prologue screen from the main menu, a codex screen fromthe game menu, and an extras screen from both menus.
Screens - Game Menu
Custom game menu screens can also be created. These screens can use thegame_menu screen to provide a title and scrollable viewport. An minimalcustom game menu screen is:
screencodex():tagmenuusegame_menu(_("Codex"),scroll="viewport"):style_prefix"codex"hasvbox:spacing20text_("{b}Mechanical Engineering:{/b} Where we learn to build things like missiles and bombs.")text_("{b}Civil Engineering:{/b} Where we learn to build targets.")
Clearly, a functional codex would need to be more elaborate than this.
Note the "tag menu" line. This line is important, as it hides other menu screenswhen the codex is shown. Without it, it would be hard to switch to andfrom the other menu screens.
Screens - Click to Continue
A screen we expect to be commonly added is the click to continue screen. Thisis a screen that is shown when text finishes displaying. Here's a simpleexample:
screenctc(arg=None):frame:atctc_appearxalign.99yalign.99text_("(click to continue)"):size18transformctc_appear:alpha0.0pause5.0linear0.5alpha1.0
This particular ctc screen uses a transform to show the frame after 5 seconds.It's a good idea to delay CTC animations for several seconds, to give Ren'Pytime to predict and load images.
Total GUI Replacement
Advanced creators can replace some or all ofscreens.rpy in its entirely.When doing so, some or all of the contents ofgui.rpy may become redundant.It's probably a good idea to callgui.init() to reset styles – but afterthat, a creator can do whatever they want. It usually makes sense to includesome or all of thespecial screens, to make sureplayers can have access to all the functionality Ren'Py provides.
See Also
For more information about the GUI, see theAdvanced GUIsection.
Incompatible GUI Changes
As the GUI is changed, occasionally some of the variables change name. Thesechanges only take effect when the GUI is regenerated – until then, the gamewill continue to use the old variable names in the new Ren'Py.
6.99.12.3
gui.default_font -> gui.text_font
gui.name_font -> gui.name_text_font
gui.interface_font -> gui.interface_text_font
gui.text_xpos -> gui.dialogue_xpos
gui.text_ypos -> gui.dialogue_ypos
gui.text_width -> gui.dialogue_width
gui.text_xalign -> gui.dialogue_text_xalign