Trouble with updating the value of gui.interface_text_font
Posted: Sat Mar 18, 2017 8:42 am
Greetings! A newbish question about variables here. I want to swap interface font and language at the same time from the options menu. Looks like it has to be done via action command, so I tried to do it by tinkering with language button snippet in screens.rpy. Like this:
It results in a crash after clicking on the options button from game menu:
Being newbie in coding really sucks :< I guess it's not really a variable, but I''m aiming for this parameter from gui.rpy:
Changing it directly gets the job done, but I want to be able to switch between two sets of languages and interface fonts on the fly. Is there a way to do this?
Code: Select all
label _("Language")
textbutton "English" action [SetVariable("gui.interface_text_font", "1.ttf"), Language(None)]
textbutton "Русский" action [SetVariable("gui.interface_text_font", "Double.ttf"), Language("russian")]
Code: Select all
I'm sorry, but an uncaught exception occurred.
While running game code:
File "renpy/common/00action_data.rpy", line 50, in get_selected
return getattr(self.object, self.field) == self.value
AttributeError: 'StoreModule' object has no attribute 'gui.interface_text_font'
Code: Select all
## The font used for out-of-game text.
define gui.interface_text_font = "DejaVuSans.ttf"