首页 > 其他分享 >renpyGUI定制确认界面

renpyGUI定制确认界面

时间:2023-04-21 13:11:06浏览次数:31  
标签:style 界面 confirm text button frame 定制 gui renpyGUI

项目创建后默认的confirm界面代码,在screen.rpy文件中:

screen confirm(message, yes_action, no_action):

    ## 显示此界面时,确保其他界面无法输入。
    modal True

    zorder 200

    style_prefix "confirm"

    add "gui/overlay/confirm.png"

    frame:

        vbox:
            xalign .5
            yalign .5
            spacing 30

            label _(message):
                style "confirm_prompt"
                xalign 0.5

            hbox:
                xalign 0.5
                spacing 100

                textbutton _("确定") action yes_action
                textbutton _("取消") action no_action

    ## 右键点击退出并答复“no”(取消)。
    key "game_menu" action no_action

style confirm_frame is gui_frame
style confirm_prompt is gui_prompt
style confirm_prompt_text is gui_prompt_text
style confirm_button is gui_medium_button
style confirm_button_text is gui_medium_button_text

style confirm_frame:
    background Frame([ "gui/confirm_frame.png", "gui/frame.png"], gui.confirm_frame_borders, tile=gui.frame_tile)
    padding gui.confirm_frame_borders.padding
    xalign .5
    yalign .5

style confirm_prompt_text:
    text_align 0.5
    layout "subtitle"

style confirm_button:
    properties gui.button_properties("confirm_button")

style confirm_button_text:
    properties gui.button_text_properties("confirm_button")

将confirm.png用ps调整为完全透明,替换frame.png文件,并修改screen.rpy的confirm内的frame,将图片xy坐标调整为0.5 0.4,xy大小为723,374,调整后的代码

screen confirm(message, yes_action, no_action):

    ## 显示此界面时,确保其他界面无法输入。
    modal True

    zorder 200

    style_prefix "confirm"

    add "gui/overlay/confirm.png"

    frame:
        xalign 0.5 yalign 0.4 xysize(723,374)

        vbox:
            xalign .5
            yalign .5
            spacing 45

            label _(message):
                style "confirm_prompt"
                xalign 0.5

            hbox:
                xalign 0.5
                spacing 150

                imagebutton:
                    idle "gui/button/yes_idle.png"
                    hover "gui/button/yes_hover.png"
                    action yes_action

                imagebutton:
                    idle "gui/button/no_idle.png"
                    hover "gui/button/no_hover.png" 
                    action no_action

    ## 右键点击退出并答复 no(取消)。
    key "game_menu" action no_action


style confirm_frame is gui_frame
style confirm_prompt is gui_prompt
style confirm_prompt_text is gui_prompt_text
style confirm_button is gui_medium_button
style confirm_button_text is gui_medium_button_text

style confirm_frame:
    background Frame([ "gui/confirm_frame.png", "gui/frame.png"], gui.confirm_frame_borders, tile=gui.frame_tile)
    padding gui.confirm_frame_borders.padding
    xalign .5
    yalign .5

style confirm_prompt_text:
    text_align 0.5
    layout "subtitle"

style confirm_button:
    properties gui.button_properties("confirm_button")

style confirm_button_text:
    properties gui.button_text_properties("confirm_button")

  修改后的效果

 

标签:style,界面,confirm,text,button,frame,定制,gui,renpyGUI
From: https://www.cnblogs.com/yuan-E/p/17339988.html

相关文章

  • 定制的视频监控球机接入EasyCVR后通道不显示的原因排查
    EasyCVR基于云边端智能协同,具有强大的数据接入、处理及分发能力,平台可支持多协议接入,包括市场主流标准协议与厂家私有协议及SDK,如:国标GB28181、RTMP、RTSP/Onvif、海康Ehome、海康SDK、宇视SDK等(具体见下图)。有用户反馈,将某品牌的定制款监控摄像头球机接入EasyCVR平台后,通道不显示......
  • WPF中弹出界面在不影响状态栏的情况下占满界面
    举例子:比如在MainView.xaml.cs可以写在Window_Loaded事件中privatevoidWindow_Loaded(objectsender,RoutedEventArgse){this.Left=0.0;this.Top=0.0;this.Height=SystemParameters.WorkArea.Height;this.Width=SystemParameters.Work......
  • 无图形界面的Linux操作系统如何安装在飞机导航系统上?
    支持Linux操作系统的飞机型号是比较有限的像V型飞机只能支持嵌入式操作系统,Linux相对来说太大了更老的2型飞机则更加不可能,它们还在使用批处理系统呢射线型飞机的计算机硬件已经支持了特权级切换,能够运行像xv6这样的操作系统最新的A型飞机为了计算导弹轨迹,能够支持Linux......
  • 界面控件DevExpress WinForm的垂直网格组件,让数据展示更灵活!
    DevExpressWinForm VerticalGrid(垂直网格)组件设计用于提供UI灵活性,它允许显示数据集中的单个行,或在其90度反向网格容器中显示多个数据集行。此外,开发者还可以将其用作属性网格,就像在VisualStudioIDE中找到的那样。PS:DevExpressWinForm拥有180+组件和UI库,能为WindowsForms......
  • 知识付费小程序源码资源共享会员积分广告小程序定制开发源码二开
    资源分享可以在后台添加各种资源,如风景,写真,cos,壁纸,各种链接。后台可以设置这些资源如何观看,免费,看广告,VIP广告设置可以添加各种广告,可以在广告设置里设置好广告id还有广告应用场景。VIP设置管理员可以在后台更改用户的VIP设置,也可以设置卡密,让用户自行解锁vip,也可以设置积分,让用户......
  • Halcon界面简介
    界面分为四大块1.   Halcon的五个助手1)   图像采集助手:与相机连接,设定相机参数,采集图像2)   标定助手:九点标定或是其它的标定,生成标定文件及内参外参,可以将像素单位转换为长度单位3)   模板匹配助手:画取你想寻找的图像,设定参数,可以寻找到与你画取相似的图所有图像......
  • 简约的通用错误界面(400,500)
    案例https://jz-common-cdn.daojia.com/fe-common-page/error-page/index.html代码<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"/><metahttp-equiv="X-UA-Compatible"content=&quo......
  • MAUI Blazor 实战:开发界面跟随系统主题切换的App
    ​1、安装MasaBlazor参考:MASABlazorhttps://blazor.masastack.com/getting-started/installation2、编写代码新建Service目录,并添加ThemeService.cs该 RequestedTheme 属性返回 AppTheme 枚举成员。 AppTheme 枚举定义下列成员:Unspecified,指示设备使用的是未指......
  • 开机界面显示:BOOTMGR is compressed (启动盘被压缩)
     BOOTMGRiscompressed (启动盘被压缩) https://v.douyin.com/DNAFwj4/PE--》C盘--》右键属性---》去掉压缩此驱动以节约磁盘空间---》确定   ......
  • 客服系统vue源码聊天界面,ajax上传图片功能实现
    在线客服系统的聊天界面上,有上传图片按钮功能,使用js实现ajax上传图片功能html部分,有一个点击事件<divclass="iconExtendBtn"@click="uploadImg"><divclass="elIconel-icon-picture"></div>......