Ren'Py memo

Ren'Pyの個人的なメモ

起動時に言語選択画面を表示する

起動時に言語選択の画面を表示するスクリーンとlabelのコード




この例の場合一度通ったら二度と現れないスクリーンにしているので
毎回表示したい場合はpersistent.captionを消す

    default persistent.caption = False

    image color1 = Solid("#404057")
    image color2 = Solid("#A472A9")
    image color3 = Solid("#B7B5C6")
    image color4 = Solid("#F0F0EC")
    image color5 = Solid("#FBFBFB")

define gsound1 = "audio/se/switchblade2.mp3"

define gcolor1 = "#404057"
define gcolor2 = "#A472A9"


label splashscreen:

    if persistent.caption == False:
        call screen splash()
        $ persistent.caption = True


screen splash():

        add "game_menu"
        style_prefix "splash"
        text _("{alt}言語の選択、矢印キーで移動、エンターで決定{/alt}")

        fixed:
            style_prefix "splash"
            textbutton _("日本語"):
                action Language(None)
                xalign 0.2
                yalign 0.35
                xsize 300
                ysize 300
            textbutton "English":
                action Language("eng")
                xalign 0.7
                yalign 0.35
                xsize 300
                ysize 300

        vbox:
            yalign 1.0
            xalign 0.5
            textbutton _("次へ"):
                action Return()
                text_size 40
                xsize 1060
                ysize 100


style splash_button is default:
    idle_background "color1"
    hover_background "color2"
    selected_background "color4"
    activate_sound gsound1

style splash_button_text is default:
    color gcolor2
    hover_color gcolor1
    size 50
    xalign 0.5
    yalign 0.5