找回密码
 立即注册

QQ登录

只需一步,快速开始

楼主: 怀念丶落樱

[已解决] 求教,关于角色选择的问题。

[复制链接]
 楼主| 发表于 2021-6-4 13:14:03 | 显示全部楼层
stevenhert 发表于 2021-6-4 12:45
02行,"" 里边加上你的图片路径

好的,今天下班回家试试。谢谢。
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2021-6-4 18:26:09 | 显示全部楼层
本帖最后由 怀念丶落樱 于 2021-6-4 22:45 编辑

[RenPy] 纯文本查看 复制代码
#script.rpy文件内。
define images = "images/heart.png"
label start:
    image iraImg:
        atl_pass scene "[images]"
        atl_pass  call screen a
    return
#myscript.rpy文件内。

screen a:
    fixed:
        xcenter 0.35
        ycenter 0.35
        xsize 640
        ysize 360
        textbutton "男":
            text_size 20 text_outlines [(absolute(2),"#000",absolute(0),absolute(0))]
            text_color "ffcce0"
            text_hover_color "#ffffff"
            action SetVariable ("images",images/heart.png)
    fixed:
        xcenter 0.5
        ycenter 0.35
        xsize 640
        ysize 360
        textbutton "女":
            text_size 20 text_outlines [(absolute(2),"#000",absolute(0),absolute(0))]
            text_color "ffcce0"
            text_hover_color "#ffffff"
            action SetVariable ("images",images/heart1.png)
报错了。。。
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2021-6-4 18:39:38 | 显示全部楼层
加上atl_pass 显示 File "game/script.rpy", line 5: expected 'comma or end of line' not found.
    atl_pass scene "[images]"
去掉atl_pass 显示 File "game/script.rpy", line 5: expected 'comma or end of line' not found.
    scene "[images]"

大佬们给出出注意吧。
回复 支持 抱歉

使用道具 举报

发表于 2021-6-4 20:06:23 | 显示全部楼层
[RenPy] 纯文本查看 复制代码
image man = "男的路径"
image woman = "女的路径"
define playername = Character("[name]")
label start:
    $ name = renpy.input("输入你的名字",length=20,default="默认名字9527")
    playername "我叫[name]"
    show man at topright
    show woman at topleft
menu xuanxiang:
    "选择人物性别"
    "男":
        "你选择了男"
    "女":
        "你选择了女"
可以先看看B站教学或文档,你这基础差太多了
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2021-6-4 20:09:11 | 显示全部楼层
本帖最后由 怀念丶落樱 于 2021-6-4 22:30 编辑
stevenhert 发表于 2021-6-4 20:06
[mw_shl_code=renpy,true]image man = "男的路径"
image woman = "女的路径"
define playername = Characte ...

我不是这意思,朋友。 我的意思是选择主角,做出选择后,后面的主角便是你选择的人物。就像输入名字一样,输入后可以被后面剧情带入、
我要将主角带入后面的剧情。
回复 支持 抱歉

使用道具 举报

发表于 2021-6-4 22:38:00 | 显示全部楼层
走路还在晃荡就想跑,语法都没明白就惦记整活……楼主要不还是考虑一下不是万能但却有效的解决方案——花钱找人写……
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2021-6-4 22:46:20 | 显示全部楼层
被诅咒的章鱼 发表于 2021-6-4 22:38
走路还在晃荡就想跑,语法都没明白就惦记整活……楼主要不还是考虑一下不是万能但却有效的解决方案——花钱 ...

好的,淘宝找人去了。
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2021-6-5 21:47:53 | 显示全部楼层
本帖最后由 怀念丶落樱 于 2021-6-6 20:22 编辑

不用找人了。我弄出来了
[RenPy] 纯文本查看 复制代码
#script.rpy文件内
define imgPath = "1" 
label start:
        scene a
        call screen a
#z.rpy文件内
screen z:
    fixed:
        xcenter 0.35
        ycenter 0.35
        xsize 640
        ysize 360
        textbutton "回":
            text_size 20 text_outlines [(absolute(2),"#000",absolute(0),absolute(0))]
            text_color "ffcce0"
            text_hover_color "#ffffff"
            action Jump ("start")
#x.rpy文件内
label cc:

    image iraImg:
        "[imgPath]"
    scene iraImg
    call screen z
#a.rpy文件内

screen a:
    fixed:
        xcenter 0.35
        ycenter 0.35
        xsize 640
        ysize 360
        textbutton "男":
            text_size 20 text_outlines [(absolute(2),"#000",absolute(0),absolute(0))]
            text_color "ffcce0"
            text_hover_color "#ffffff"
            action SetVariable ("imgPath",1)
    fixed:
        xcenter 0.5
        ycenter 0.35
        xsize 640
        ysize 360
        textbutton "女":
            text_size 20 text_outlines [(absolute(2),"#000",absolute(0),absolute(0))]
            text_color "ffcce0"
            text_hover_color "#ffffff"
            action SetVariable ("imgPath",2)
        text "[imgPath]"
    fixed:
        xcenter 0.6
        ycenter 0.35
        xsize 640
        ysize 360
        textbutton "确定":
            text_size 20 text_outlines [(absolute(2),"#000",absolute(0),absolute(0))]
            text_color "ffcce0"
            text_hover_color "#ffffff"
            action Jump ("cc")
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2021-6-5 21:49:08 | 显示全部楼层
感谢 ouyume 的代码,调试了好久才调出来,谢谢!
我懂了但没完全懂.jpg
回复 支持 抱歉

使用道具 举报

发表于 2021-6-6 18:34:23 | 显示全部楼层
可喜可贺~
回复 支持 抱歉

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-24 18:53 , Processed in 0.051028 second(s), 10 queries , File On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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