找回密码
 立即注册

QQ登录

只需一步,快速开始

楼主: blackpineapple

[课堂] 【2023暑假界面】第二周 (对话框)

[复制链接]
发表于 2023-7-30 10:21:04 | 显示全部楼层
[RenPy] 纯文本查看 复制代码
script.rpy
image ctc_blink:
    "images/ll.png"
    xoffset 1790
    yoffset 670


define a = Character('ROSALINE',
    ctc="ctc_blink", ctc_position="fixed")




label start:
    scene ai
    show ren at right
    a "HEY! I DIDN T KNOW YOU WERE GOING TO BE HERE TODAY!"

    menu:
        a "HEY! I DIDN T KNOW YOU WERE GOING TO BE HERE TODAY!"

        "ME EITHER!":
            jump b
        "I WASN'T SUPPOSED TO BE":
            jump d
    return
screens.rpy
################################################################################
## 游戏内屏幕
################################################################################


## 对话屏幕 ########################################################################
##
## 对话屏幕用于向用户显示对话。它需要两个参数,who 和 what,分别是叙述角色的名字
## 和所叙述的文本。(如果没有名字,参数 who 可以是 None。)
##
## 此屏幕必须创建一个 id 为 what 的文本可视控件,因为 Ren'Py 使用它来管理文本显
## 示。它还可以创建 id 为 who 和 id 为 window 的可视控件来应用样式属性。
##
## [url]https://doc.renpy.cn/zh-CN/screen_special.html#say[/url]

screen say(who, what):
    style_prefix "say"

    window:
        id "window"

        if who is not None:

            window:
                id "namebox"
                style "namebox"
                text who id "who":
                    color "#fff"

                    outlines [(2, "#000")]
        frame:
            background Solid("#0ff0")
            xysize (1800, 230)
            pos (200,-250)

            text what id "what":
                outlines [(2, "#000")]
## 通过 Character 对象使名称框可用于样式化。
init python:
 config.character_id_prefixes.append("00")
style window:
    xalign 0.5
    xfill True
    yalign gui.textbox_yalign
    ysize gui.textbox_height

                     #在gui里放入对话框,将00改成对话框的名字
    background Image("gui/00.png", xalign=0.9, yalign=7.2)#对话框的位置和对话框

style namebox:
    xpos 108
    ypos -360

style say_label:
    properties gui.text_properties("name", accent=True)
    xalign gui.name_xalign
    yalign 0.5
## 选择屏幕 ########################################################################
##
## 此屏幕用于显示由 menu 语句生成的游戏内选项。参数 items 是一个对象列表,每个对
## 象都有字幕和动作字段。
##
## [url]https://doc.renpy.cn/zh-CN/screen_special.html#choice[/url]

screen choice(items):
    style_prefix "choice"

    vbox:
        for i in items:
            textbutton i.caption action i.action


style choice_vbox is vbox
style choice_button is button
style choice_button_text is button_text

style choice_vbox:
    xalign 0.5
    ypos 405
    yanchor 0.5

    spacing gui.choice_spacing

style choice_button is default:#选项框的大小,位置,什么框
    background Frame("button", xsize=600, ysize=180)
    hover_background "button"
    xysize (1900,100)
    xalign 0.53
    yalign 500
    anchor (0.5, 0.5)


style choice_button_text is default:#选项的颜色,大小,字体
    properties gui.button_text_properties("choice_button")
    xalign 0.03#横
    yalign 1.2#竖
    ## 确保该菜单出现在其他屏幕之上,
    zorder 100

    if quick_menu:


        hbox:
            style_prefix "quick"

        button:
            align(0.001,0.01)
            xysize(286,161)
            add "10" xalign 0.48 yalign 0.5 zoom 0.5
            idle_background "3"
            hover_background "3"
            action Rollback()
            #textbutton _("历史") action ShowMenu('history')
            #textbutton _("快进") action Skip() alternate Skip(fast=True, confirm=True)
            #textbutton _("自动") action Preference("auto-forward", "toggle")
            #textbutton _("保存") action ShowMenu('save')
            #textbutton _("快存") action QuickSave()
            #textbutton _("快读") action QuickLoad()
        button:
            align(1.0,1.0)
            xysize(286,161)
            add "2" xalign 0.5 yalign 0.5 zoom 0.5
            idle_background "0"
            hover_background "0"
            action Show("preference")
            #textbutton _("设置") actionShowMenu('preferences')
回复 支持 抱歉

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|RenPy中文空间 ( 苏ICP备17067825号|苏公网安备 32092302000068号 )

GMT+8, 2024-5-13 04:33 , Processed in 0.064035 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表