找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 7211|回复: 2

[已解决] 如何选中按钮,给选中的按钮添加样式?

[复制链接]
发表于 2021-8-9 13:00:31 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
本帖最后由 莫小奇 于 2021-8-10 12:36 编辑

[RenPy] 纯文本查看 复制代码
vpgrid cols 1 scrollbars "vertical" ymaximum 440 ypos 20 mousewheel True:
                    textbutton "主线":
                        margin(14, 10)
                        xminimum 180
                        text_size 30
                        text_color "#CFB53B"
                        text_outlines [(1, "#00000080", 1, 1)]
                        action [Function(showSkillTree, num = 1)]
                    textbutton "支线1":
                        margin(14, 10)
                        text_size 30
                        text_color "#CFB53B"
                        text_outlines [(1, "#00000080", 1, 1)]
                        action [Function(showSkillTree, num = 2)]
                    textbutton "支线2":
                        margin(14, 10)
                        text_size 30
                        text_color "#CFB53B"
                        text_outlines [(1, "#00000080", 1, 1)]
                        action [Function(showSkillTree, num = 2)]

显而易见,我是在vpgrid中添加了3个textbutton按钮
我想要点击每个按钮的时候改变他的样式,该怎么做呢?
求dalao解答
que.png
发表于 2021-8-10 08:59:44 | 显示全部楼层
https://doc.renpy.cn/zh-CN/gui.h ... text_selected_color

推荐通过配置项修改textbutton样式。
如果需要轮廓线或投影效果,新建样式并继承默认样式后应用到目标文本上。
回复 支持 1 抱歉 0

使用道具 举报

 楼主| 发表于 2021-8-10 12:35:35 | 显示全部楼层
被诅咒的章鱼 发表于 2021-8-10 08:59
https://doc.renpy.cn/zh-CN/gui.html#var-gui.button_text_selected_color

推荐通过配置项修改textbutton样 ...

十分感谢!
回复 支持 抱歉

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-7-27 12:50 , Processed in 0.174049 second(s), 32 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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