How to change the font only in the name box?

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
Bnig98JR
Newbie
Posts: 3
Joined: Tue Aug 31, 2021 5:38 am
Contact:

How to change the font only in the name box?

#1 Post by Bnig98JR »

I'm looking to make the font in the name box different than the regular dialogue, how would I go about this?

User avatar
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Re: How to change the font only in the name box?

#2 Post by qirien »

You're going to look in screens.rpy. The screen that controls how the text box looks is the "say" screen, so scroll down until you find that.

You can see that it says "style "namebox"" which means it will use a style called namebox to decide how to show the name. Scrolling down a bit you can see it says "style namebox is default". That means it will use the regular style from the interface, but we can change that here. You can have something like:

Code: Select all

style namebox is default:
     text_color "#ff0000"  # red text color
     text_size 60             # really huge size
     text_font "fonts/WeirdFont.otf"  # make sure this font exists!
     
Then it will display the name however you say it should.

There's lots more about this in the GUI Customization guide:
https://www.renpy.org/doc/html/gui.html
Finished games:
Image
Image
Image

Post Reply

Who is online

Users browsing this forum: Google [Bot]