I've been trying to adjust my preferences screen depending on which language is active. I thought I'd cracked it, albeit messily, but after you've finished the game and switch the language (from French to English, for example), the font sizes are incorrect. In French, they are smaller than English, so when I go back to the English pref screen after a French play-through, the font is small like in French. I don't understand why it'd be doing this, but here's my code:
Preferences code in screens.rpy:
Code: Select all
screen preferences():
tag menu
use navigation_small
add "images/prefs.png" xalign 0.5 yanchor 0 ypos 14
vbox:
xanchor 0.5
spacing 30
if _preferences.language == "french":
xpos 0.5
ypos 20
elif _preferences.language == "brazilian":
xpos 0.475
ypos 28
else:
xpos 0.5
ypos 40
text _("General Settings"):
style "titles"
if _preferences.language == "french":
xpos 480
elif _preferences.language == "brazilian":
xpos 415
else:
xpos 470
hbox:
style_group "pref"
if _preferences.language == "brazilian":
spacing 45
else:
spacing 55
text _("Display") ypos 40 xpos 8
button:
action Preference("display", "window")
style "mainmenu_choice_button"
text _("Window") style "mainmenu_choice"
button:
action Preference("display", "fullscreen")
style "mainmenu_choice_button"
text _("Fullscreen") style "mainmenu_choice"
text _("Text") xpos 80 ypos 40
button:
xpos 75
action Preference("auto-forward", "toggle")
style "mainmenu_choice_button"
text _("Auto-play") style "mainmenu_choice"
hbox:
style_group "pref"
spacing 50
xalign 0.5
text _("Music Volume") ypos 10
bar value Preference("music volume") ypos 12
hbox:
style_group "pref"
spacing 50
xalign 0.5
text _("Sound Volume") ypos 35
bar value Preference("sound volume") ypos 35
hbox:
style_group "pref"
spacing 53
xalign 0.5
ypos 52
vbox:
text _("Fast-Forward Settings"):
style "titles"
if _preferences.language == "brazilian":
xpos 20
else:
xpos 200
hbox:
style_group "pref"
xalign 0.5
ypos 20
if _preferences.language == "brazilian":
spacing 45
else:
spacing 55
text _("Fast-Forward") ypos 40 xpos 8
button:
action Preference("skip", "seen")
style "mainmenu_choice_button"
text _("Seen Text") style "mainmenu_choice"
button:
action Preference("skip", "all")
style "mainmenu_choice_button"
text _("All Text") style "mainmenu_choice"
hbox:
style_group "pref"
xalign 0.5
ypos 48
if _preferences.language == "brazilian":
spacing 35
else:
spacing 55
text _("After Choices") yalign 0.5 xpos 8
button:
action Preference("after choices", "stop")
style "mainmenu_choice_button"
text _("Stop FF") style "mainmenu_choice"
button:
action Preference("after choices", "skip")
style "mainmenu_choice_button"
text _("Continue FF") style "mainmenu_choice"
vbox:
text _("Progress Settings"):
style "titles"
if _preferences.language == "brazilian":
xpos 130
button:
xalign 0.5
ypos 85
if _preferences.language == "brazilian":
xpos 250
action Show("reset_popup")
style "mainmenu_choice_button"
text _("Reset Game") style "mainmenu_choice"
init -2:
style titles:
size 60
line_leading 0
Code: Select all
translate None python:
style.default.font = "IHATCS__.TTF"
translate russian python:
style.default.font = "neucha.otf"
translate french python:
style.default.size = 38
style.menu_choice.size = 34
style.mainmenu_choice.size = 34
style.mainmenu_choice.line_leading = -8
style.grey_choice.size = 34
style.file_picker.size = 24
style.gallery_ui.size = 24
style.yesno_label_text.size = 38
style.titles.size = 46
style.titles.line_leading = 35
style.default.font = "Bromine.ttf"
translate brazilian python:
style.default.size = 38
style.menu_choice.size = 34
style.mainmenu_choice.size = 34
style.mainmenu_choice.line_leading = -8
style.grey_choice.size = 34
style.file_picker.size = 24
style.gallery_ui.size = 24
style.yesno_label_text.size = 38
style.titles.size = 54
style.titles.line_leading = 25
style.default.font = "Bromine.ttf"
My default font settings are in options.rpy and pretty standard:
Code: Select all
# Fonts
style.default.size = 44
style.default.color = "#6c544b"
style.default.font = "IHATCS__.TTF"
# etc