找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 14788|回复: 4

[已解决] 程序无法转跳

[复制链接]
发表于 2021-5-7 22:26:45 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 怀念丶落樱 于 2021-5-7 22:45 编辑

define x = 0
screen a:
    fixed:
        xcenter 0.5
        ycenter 0.5
        xsize 640
        ysize 360
        vbox:
            add "images/Untitled.png" xcenter 0.5
            textbutton "加1":
                text_size 40 text_outlines [(absolute(2),"#000",absolute(0),absolute(0))]
                text_color "ffcce0"
                text_hover_color "#ffffff"
                action SetVariable("x",x+1)
                action Jump ('sheet1')

            textbutton "加2":
                text_size 40 text_outlines [(absolute(2),"#000",absolute(0),absolute(0))]
                text_color "ffcce0"
                text_hover_color "#ffffff"
                action SetVariable("x",x+2)
            text"[x]"size 40 outlines [(absolute(2),"#000",absolute(0),absolute(0))] color "ffcce0" hover_color "#ffffff"
            action Jump ('sheet2')
 楼主| 发表于 2021-5-7 22:29:52 | 显示全部楼层
本帖最后由 怀念丶落樱 于 2021-5-7 22:37 编辑

去掉转跳按钮就正常无报错,
添加转跳就会报错,
点一下按钮,x就会+1,
我想带着x+1,转跳到另一个文本程序。
错误报告,好像是说出现多次..可是不用这个 怎样用按钮转跳呢?
或者,怎样转跳时,给X+1



错误报告:
I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/myscreen.rpy", line 15: keyword argument u'action' appears more than once in a textbutton statement.
    action Jump ('sheet1')


捕获.PNG
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2021-5-7 22:45:11 | 显示全部楼层
找到以前的帖子了,这个问题解决了!我会将修改后的代码放在下面!

以下是修改后的代码!

define x = 0
screen a:
    fixed:
        xcenter 0.5
        ycenter 0.5
        xsize 640
        ysize 360
        vbox:
            add "images/Untitled.png" xcenter 0.5
            textbutton "加1":
                text_size 40 text_outlines [(absolute(2),"#000",absolute(0),absolute(0))]
                text_color "ffcce0"
                text_hover_color "#ffffff"
                action [SetVariable("x",x+1),Jump ('sheet1')]

            textbutton "加2":
                text_size 40 text_outlines [(absolute(2),"#000",absolute(0),absolute(0))]
                text_color "ffcce0"
                text_hover_color "#ffffff"
                action [SetVariable("x",x+2),Jump ('sheet2')]
            text"[x]"size 40 outlines [(absolute(2),"#000",absolute(0),absolute(0))] color "ffcce0" hover_color "#ffffff"
回复 支持 抱歉

使用道具 举报

发表于 2021-5-8 15:52:25 | 显示全部楼层
怀念丶落樱 发表于 2021-5-7 22:45
找到以前的帖子了,这个问题解决了!我会将修改后的代码放在下面!

以下是修改后的代码!

习惯renpy语法高亮,有点不适应了,
https://www.renpy.cn/forum.php?mod=viewthread&tid=44
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2021-5-9 11:54:14 | 显示全部楼层
龙氏 发表于 2021-5-8 15:52
习惯renpy语法高亮,有点不适应了,
https://www.renpy.cn/forum.php?mod=viewthread&tid=44 ...

明白了..谢谢!
回复 支持 抱歉

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-3-28 16:09 , Processed in 0.222653 second(s), 14 queries , File On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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