找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1491|回复: 6

[已解决] 萌新求问,如何给使用call调用的screen添加转场效果?

[复制链接]
发表于 2022-3-25 18:58:44 | 显示全部楼层 |阅读模式

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

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

×
[RenPy] 纯文本查看 复制代码
define persistent.x0 = False

screen agreement:
    text "hello world" xcenter 0.5 ycenter 0.5 color "#000"
    textbutton "同意":
        text_color "#000"
        xcenter 0.2
        ycenter 0.7
        action SetVariable("persistent.x0",True), Return("agreement")
    textbutton "拒绝":
        text_color "#000"
        xcenter 0.8
        ycenter 0.7
        action SetVariable("persistent.x0",False), Quit(confirm=False)



[RenPy] 纯文本查看 复制代码
label splashscreen:
    if persistent.x0 == False:
        scene white
        call screen agreement
    elif persistent.x0 == True:
        return


如题,想给call出来的screen添加个转场效果,有没有大佬知道怎么实现啊,萌新查了一下午文档,大脑都快冒烟了
发表于 2022-3-26 00:15:34 | 显示全部楼层
唔,其实好像只是看不太出来而已
你可以看一下下面几个转场,能看出来有用的
[RenPy] 纯文本查看 复制代码
define dissolve_extra = Dissolve(5)
define fade_extra = Fade(0.5, 2.0, 0.5)
label splashscreen:
    if persistent.x0 == False or 1 == 1:
        scene green
        call screen agreement with dissolve
        # with dissolve_extra
        # with dissolve
        with fade_extra
        # with fade
回复 支持 1 抱歉 0

使用道具 举报

发表于 2022-3-25 20:10:13 | 显示全部楼层
啊?你要的是不是`call screen agreement with dissolve`

https://doc.renpy.cn/zh-CN/screens.html#call-screen

评分

参与人数 1干货 +1 收起 理由
BuErShen + 1 感谢解答!

查看全部评分

回复 支持 1 抱歉 0

使用道具 举报

 楼主| 发表于 2022-3-25 21:09:33 | 显示全部楼层
Lost 发表于 2022-3-25 20:10
啊?你要的是不是`call screen agreement with dissolve`

https://doc.renpy.cn/zh-CN/screens.html#call-sc ...

嘶~对,就是这个(心情复杂)
完全被界面行为里面那个With(transition)带跑偏了

话说大佬可以再指点一下退出screen时如何加转场吗?
用Hide("agreement",transition=dissolve)的话,在点同意的情况下,转场结束后会卡在splashscreen里
但是Return()又冒烟像Hide()的那种用法……
回复 支持 抱歉

使用道具 举报

发表于 2022-3-25 21:13:19 | 显示全部楼层
你再仔细看看文档
call screen语句使用一个可选的 with 关键词,后面跟一个转场(transition)。界面首次显示的时候会使用转场(transition)效果。当界面显示转场效果之后,再跟一个with语句和转场效果,就是界面隐藏使用的转场。
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2022-3-25 22:08:50 | 显示全部楼层
Lost 发表于 2022-3-25 21:13
你再仔细看看文档

[RenPy] 纯文本查看 复制代码
label splashscreen:
    if persistent.x000 == False:
        scene white
        call screen agreement with dissolve
        with dissolve
        pause
        return

是这样改对吧?
但是我这边退出screen的时候依旧是一闪而过,不显示转场、
不过进入时的转场是正常的……就很奇怪
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2022-3-26 08:37:04 | 显示全部楼层
Lost 发表于 2022-3-26 00:15
唔,其实好像只是看不太出来而已
你可以看一下下面几个转场,能看出来有用的
[mw_shl_code=renpy,true]defi ...

多谢大佬啦
回复 支持 抱歉

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-26 17:00 , Processed in 0.060536 second(s), 14 queries , File On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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