How to change the font of the default title text in the main menu.

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
NadOtavlas
Regular
Posts: 38
Joined: Sat Apr 21, 2018 3:46 am
Contact:

How to change the font of the default title text in the main menu.

#1 Post by NadOtavlas »

So whenever you create a new Ren'py game, by default the title screen will have the name of the game written in the bottom right corner. Is there any way to change the font used for the main title?

jeffster
Veteran
Posts: 361
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: How to change the font of the default title text in the main menu.

#2 Post by jeffster »

Yes. In screens.rpy you can see:

Code: Select all

    if gui.show_name:

        vbox:
            style "main_menu_vbox"

            text "[config.name!t]":
                style "main_menu_title"

            text "[config.version]":
                style "main_menu_version"
So you can find a string style main_menu_title: in that file, and add to the block something like font "mononoki-Regular.ttf". So it would look like:

Code: Select all

style main_menu_title:
    properties gui.text_properties("title")
    font "mononoki-Regular.ttf"
You can also change the placement of the title etc. Just edit the screen "main_menu".

PS. Put the font file in "game" folder. (Or in some subfolder. Then it's better to mention the path, like: font "gui/fonts/mononoki-Regular.ttf".)

NadOtavlas
Regular
Posts: 38
Joined: Sat Apr 21, 2018 3:46 am
Contact:

Re: How to change the font of the default title text in the main menu.

#3 Post by NadOtavlas »

How do I change the color of the title screen text?

jeffster
Veteran
Posts: 361
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: How to change the font of the default title text in the main menu.

#4 Post by jeffster »

Likewise, add to the style block:

Code: Select all

style main_menu_title:
    # ...blah blah blah...
    color "#FDA"
You can find all the info about styles here:

https://www.renpy.org/doc/html/style.html
https://www.renpy.org/doc/html/style_properties.html

Also check the properties of screen elements:

https://www.renpy.org/doc/html/screens.html

jeffster
Veteran
Posts: 361
Joined: Wed Feb 03, 2021 9:55 pm
Contact:

Re: How to change the font of the default title text in the main menu.

#5 Post by jeffster »

PS. Or you can add those properties directly to the text:

Code: Select all

            text "[config.name!t]":
                color "#6A3"
and so on.

Post Reply

Who is online

Users browsing this forum: Bing [Bot]