I'm writing a VN and have been working with a publisher who needs Chinese translation in the game. However, the various fonts I use for displaying in the game do not support Chinese characters and so have implemented a way to register the new font for the say screen. This is fine, but I also have some ParameterizedText set up to show as Chapter screens. Currently, the three different types of ParameterizedText are set up as follows:
Code: Select all
## TEXT AND HEADINGS
image screen_text = ParameterizedText(xalign=0.5, yalign=0.5, size=40, font=gui.name_text_font)
image chapter_text = ParameterizedText(xalign=0.5, yalign=0.46, size=60, font=gui.name_text_font)
image chapter_name_text = ParameterizedText(xalign=0.5, yalign=0.53, size=50, font=gui.name_text_font)
Code: Select all
show chapter_text "Chapter 1"
show chapter_name_text "Chapter Name Here"Code: Select all
## TEXT AND HEADINGS
image screen_text = ParameterizedText(xalign=0.5, yalign=0.5, size=40, font=gui.name_text_font)
image chapter_text = ParameterizedText(xalign=0.5, yalign=0.46, size=60, font=gui.name_text_font)
image chapter_name_text = ParameterizedText(xalign=0.5, yalign=0.53, size=50, font=gui.name_text_font)
## For Simplified Chinese
image screen_text_sc = ParameterizedText(xalign=0.5, yalign=0.5, size=40, font="gui/fonts/NotoSansSC-Regular.otf")
image chapter_text_sc = ParameterizedText(xalign=0.5, yalign=0.46, size=60, font="gui/fonts/NotoSansSC-Regular.otf")
image chapter_name_text_sc = ParameterizedText(xalign=0.5, yalign=0.53, size=50, font="gui/fonts/NotoSansSC-Regular.otf")
## For Traditional Chinese
image screen_text_tc = ParameterizedText(xalign=0.5, yalign=0.5, size=40, font="gui/fonts/NotoSansTC-Regular.otf")
image chapter_text_tc = ParameterizedText(xalign=0.5, yalign=0.46, size=60, font="gui/fonts/NotoSansTC-Regular.otf")
image chapter_name_text_tc = ParameterizedText(xalign=0.5, yalign=0.53, size=50, font="gui/fonts/NotoSansTC-Regular.otf")Code: Select all
if _preferences.language == "simplified_chinese":
show chapter_text_sc "Chapter 1"
show chapter_name_text_sc "Chapter Name Here"
else:
show chapter_text "Chapter 1"
show chapter_name_text "Chapter Name Here"All this seems rather complex and unnecessary as I am sure there is a much easier, more succinct way to get this to work. Is there a way to somehow make it so I only need to declare one style and then it be switched when the user changes languages?