Page 1 of 1

Different fonts for each menu screen.

Posted: Fri Jan 19, 2018 4:16 pm
by XenoStaR
Hello,

I am new to the screen side of renpy and in my current project I need to have different fonts on each of the menu's e.g. preferences/about/help ect.. Basically I would like one font for the main menu and then different fonts for the in game menu and any frame pop ups I need.

Ideally I would like a way to do this without going to image maps.

I have looked at the documentation several times but cannot get my head around how to do what I'm trying to. I'm not the most amazing person at understanding coding so please try to keep answers simple.

Thanks!

Re: Different fonts for each menu screen.

Posted: Fri Jan 19, 2018 4:31 pm
by Empish
You can change a text's font like so:

Code: Select all

text "sometext"
    font "somefont.ttf"
You can also use styles and style prefixes to reduce the amount of typing you need to do.

Re: Different fonts for each menu screen.

Posted: Fri Jan 19, 2018 5:43 pm
by XenoStaR
The problem is I don't understand the style and style prefix and how to set these up, I have looked at the documentation and looked at people who want similar things but nothing helps.

Below is an example of what I want, at the moment the font for these is the interface font and I want it to be another one, please could you be abit more specific or in depth.

Thanks!

Code: Select all

screen mailbox_commands:
    hbox:
        if available_drafts:
            textbutton "Draft New" action Show("contacts")
        else:
            textbutton "Draft New" action None
        if current_message and current_message.reply_label:
            textbutton "Reply" action current_message.reply
        else:
            textbutton "Reply" action None
        if current_message:
            textbutton "Delete" action [current_message.delete, SetScreenVariable("current_message", None)]
        else:
            textbutton "Delete" action None
        if new_message_count() > 0:
            textbutton "Mark All Read" action mark_all_read
        else:
            textbutton "Mark All Read" action None
        textbutton "Restore All" action restore_all
        textbutton "Exit" action Hide("mailbox")

Re: Different fonts for each menu screen.

Posted: Fri Jan 19, 2018 5:56 pm
by Empish

Code: Select all

style mailbox_button:
	font "somefont.ttf"
And then on your screen:

Code: Select all

screen mailbox_commands:
	style_prefix "mailbox"
	#rest of the screen goes here
That should work, although buttons are a little bit tricky.