引用
https://www.reddit.com/r/RenPy/comments/1gthq3l/enablingdisabling_text_tags/
https://ja.renpy.org/doc/html/text.html#ruby-text
https://ja.renpy.org/doc/html/custom_text_tags.html
ルビの設定
screens.rpy
style ruby_style is default: size 30 yoffset -50 color None style say_dialogue: ruby_style style.ruby_style
永続変数の設定
options.rpy
default persistent.ruby_pref = False
設定画面を作る
screens.rpy
if preferences.language == None: vbox: style_prefix "radio" label _("ふりがなの有無") null height 30 hbox: textbutton _("あり") action SetVariable("persistent.ruby_pref", True), Function(gui.rebuild) null width 10 textbutton _("なし") action SetVariable("persistent.ruby_pref", False), Function(gui.rebuild)
ルビの設定
options.rpy
def ruby_tag(tag, argument, contents): if persistent.ruby_pref: return [ (renpy.TEXT_TAG, u"rt"), ] + contents + [ (renpy.TEXT_TAG, u"/rt"), ] else: return "" config.custom_text_tags["ra"] = ruby_tag
バックログでスルーされないよう設定
screens.rpy
define gui.history_allow_tags = ("rb","rt","ra","alt","noalt","i", "k")
テスト
script.rpy
”傘{ra}かさ{/ra}”