Is it possible to add an option to switch fonts?

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
crimsonnight
Veteran
Posts: 298
Joined: Fri Apr 20, 2012 4:44 am
Contact:

Is it possible to add an option to switch fonts?

#1 Post by crimsonnight » Tue Nov 22, 2016 2:11 pm

Is it possible to add an option to the preferences menu that gives players the ability to switch between 2 fonts (eg default / simple)?

I had something similar set up in my previous novel that changed the style of the textbox:

Code: Select all

frame:
                style_group "pref"
                has vbox
                label _("Textbox Style")
                textbutton "Standard" action [SetField(persistent, "style", ""), Jump('pick_style1')]
                textbutton "Plain" action [SetField(persistent, "style", "A"), Jump('pick_style2')]

Code: Select all

label pick_style1:
    $style.window.background = Frame("textbox1.png", 12, 12)
    $style.rebuild()
    return
label pick_style2:
    $style.window.background = Frame("textbox2.png", 12, 12)
    $style.rebuild()
    return

Code: Select all

define k2 = Character(None, what_outlines=my_k)
define r = DynamicCharacter("player_name", color="#ffffff", show_two_window=True, what_outlines=my_r, who_outlines = [(3, "#79003f", 0, 0)],
    # styling the namebox
    # default is namebox1, change if otherwise
    show_custom_who_background=ConditionSwitch(
          "persistent.style == 'A'", "Namebox2A.png",
          "True", "Namebox2.png",
        )
    )
I've tried playing around with this code, but haven't gotten anyway - I'm not sure it's viable with the new GUI...
alwaysthesamebluesky.com

Post Reply

Who is online

Users browsing this forum: No registered users