/RESOLVED Different font for single scene

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
User avatar
Ada0Chan
Newbie
Posts: 2
Joined: Fri Feb 16, 2018 3:38 pm
Contact:

/RESOLVED Different font for single scene

#1 Post by Ada0Chan »

I've been searching for hours trying to find some code to use to change my font for only ONE scene. I've found multiple posts on how to change the entire default game font, make certain characters have their own font, etc. etc. but I seem to be at a stand still.
What I'm looking for is a single scene to use a different font from the rest of the game as a whole for visual effect and it needs to affect multiple characters in said scene.
Does this question make sense?? And if someone has already posted this, and I just happened to miss it, please let me know and I'll read their's instead. Thank you!
Last edited by Ada0Chan on Sun Feb 18, 2018 9:16 pm, edited 1 time in total.
"I think your frequency correlates quintessentially to your wavelength, my dear."

User avatar
Andredron
Miko-Class Veteran
Posts: 700
Joined: Thu Dec 28, 2017 2:37 pm
Location: Russia
Contact:

Re: Different font for single scene

#2 Post by Andredron »

Ada0Chan wrote: Fri Feb 16, 2018 3:54 pm I've been searching for hours trying to find some code to use to change my font for only ONE scene. I've found multiple posts on how to change the entire default game font, make certain characters have their own font, etc. etc. but I seem to be at a stand still.
What I'm looking for is a single scene to use a different font from the rest of the game as a whole for visual effect and it needs to affect multiple characters in said scene.
Does this question make sense?? And if someone has already posted this, and I just happened to miss it, please let me know and I'll read their's instead. Thank you!

Code: Select all


label start:
    pers "{font=DejaVuSans-Bold.ttf}Text{/font} text2"
    
Check out the Tutorial app in renpy launcher/ there's a lot of useful information

User avatar
Ada0Chan
Newbie
Posts: 2
Joined: Fri Feb 16, 2018 3:38 pm
Contact:

Re: Different font for single scene

#3 Post by Ada0Chan »

Thank you for that. I had already simply opted to making new defined characters with what_font= before I was notified of your reply (and also realized that I needed to put the font into my game folder :lol: ), but I will store that for future uses as I will most likely need it again in either this game or another. Again, thank you for taking your time to answer me and I will further check the Tutorial next time as I have recently updated Ren'Py.
"I think your frequency correlates quintessentially to your wavelength, my dear."

User avatar
Ocelot
Lemma-Class Veteran
Posts: 2384
Joined: Tue Aug 23, 2016 10:35 am
Github: MiiNiPaa
Discord: MiiNiPaa#4384
Contact:

Re: /RESOLVED Different font for single scene

#4 Post by Ocelot »

You can also make a function taking character and returning same character with changed font. Something like that:

Code: Select all

init python:
    def alt_font(c):
        return Character(kind=c, what_font='myfont.ttf')

# . . .
alt_font(char1) "I am speaking in alternative font"
char2 "I am not"
alt_font(char2) "And now I am too" 
< < insert Rick Cook quote here > >

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]