gui.rpy,首先设置环境设定默认字体:
[RenPy] 纯文本查看 复制代码 define gui.text_font = gui.preference("font", "fonts/font1.ttf")
define gui.name_text_font = gui.preference("font", "fonts/font1.ttf")
define gui.interface_text_font = gui.preference("font", "fonts/font1.ttf")
screens.rpy,在screen语句preferences中按如下方式配置,样式啥的可以自己定义,关键在gui.SetPreference("font", "fonts/font1.ttf")这个函数上:
[RenPy] 纯文本查看 复制代码 screen preferences():
tag menu
use game_menu(_("Preferences"), scroll="viewport"):
vbox:
hbox:
box_wrap True
if renpy.variant("pc") or renpy.variant("web"):
vbox:
style_prefix "radio"
label _("Display")
textbutton _("Window") action Preference("display", "window")
textbutton _("Fullscreen") action Preference("display", "fullscreen")
vbox:
style_prefix "radio"
label _("Rollback Side")
textbutton _("Disable") action Preference("rollback side", "disable")
textbutton _("Left") action Preference("rollback side", "left")
textbutton _("Right") action Preference("rollback side", "right")
vbox:
style_prefix "check"
label _("Skip")
textbutton _("Unseen Text") action Preference("skip", "toggle")
textbutton _("After Choices") action Preference("after choices", "toggle")
textbutton _("Transitions") action InvertSelected(Preference("transitions", "toggle"))
# 字体设置
vbox:
style_prefix "radio"
label _("Font Style")
textbutton _("font1") action gui.SetPreference("font", "fonts/font1.ttf")
textbutton _("font2") action gui.SetPreference("font", "fonts/font2.otf")
textbutton _("font3") action gui.SetPreference("font", "fonts/font3.ttf")
textbutton _("font4") action gui.SetPreference("font", "fonts/font4.otf") |