找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1877|回复: 4

[已解决] 简单立绘动画效果(不知为啥失败了)

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

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

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

×
本帖最后由 怀念丶落樱 于 2022-3-28 20:23 编辑

[RenPy] 纯文本查看 复制代码


define congli = Character("从离")
define pcok = Character("ok")
define bshu = Character("B叔")

init:
    image KP_tomato_eye_a_frame_1:
        "images/yan/maid1.png"  #眼图片
    image KP_tomato_eye_a_frame_2:
        "images/yan/maid2.png"  #眼图片
    image KP_tomato_eye_a_frame_3:
        "images/yan/maid8.png"  #眼图片
    image KP_tomato_eye_close:
        "images/yan/maid6.png"  #眼图片


    image KP_tomato_eye:
        "KP_tomato_eye_a_frame_1"
        choice 5:
            5.0
        choice 4:
            3.0
        choice 1:
            1.0
        "KP_tomato_eye_a_frame_2"
        0.1
        "KP_tomato_eye_a_frame_3"
        0.1
        "KP_tomato_eye_close"
        0.1
        "KP_tomato_eye_a_frame_3"
        0.1
        "KP_tomato_eye_a_frame_2"
        0.1
        repeat

    layeredimage KP_立绘:
        always:
            "images/maid1.png"  #人物图片
        group pose:
            attribute pose1 default:
                "KP_tomato_facel"  #不懂
        group face:
            pos (1302,644)
            attribute face1 default:
                "KP_tomato_facel" #不懂
            attribute 尴:
                "KP_tomato_尴" #不懂
            attribute 滑稽:
                "KP_tomato_滑稽" #不懂
            attribute 惊:
                "KP_tomato_惊" #不懂
            attribute 思考:
                "KP_tomato_思考" #不懂

init python:
    def KP_talk(st,at):
        if renpy.music.is_playing(channel="voice") and get_voice_info().tag == "KP":
            return ("maid1.png", 0.1)  #嘴图片
        else:
            return ("maid2.png", 0.1)  #嘴图片
    def KP_talk2(st,at):
        if renpy.music.is_playing(channel="voice") and get_voice_info().tag == "KP":
            return ("maid1.png", 0.1)  #嘴图片
        else:
            return ("maid2.png", 0.1)  #嘴图片

image KP_tomato_speak = DynamicDisplayable(KP_talk)
image KP_tomato_speak2 = DynamicDisplayable(KP_talk2)

define KP = Character("KP",voice_tag = "KP")

label start:
    show KP_tomato_eye:
        pos (600,344)
    KP "测试测试"
    voice "music/voice.ogg"
    KP "测试测试"
    KP "测试测试"

    return

图片与音乐 链接: https://pan.baidu.com/s/1SA9Wsi1BCejjuJxWOgFmJQ 提取码: w6e1

只有眼在哪里眨啊眨......我嘴呢?

这是B站大佬制作的,我抄了两次都是这样,我哪里错了? 求指正!




捕获.PNG
发表于 2022-3-28 19:20:23 | 显示全部楼层
本帖最后由 Lyceenee 于 2022-3-28 19:34 编辑

_(:з」∠)_……啊,看了下。
其实,你没定义嘴的组件!
38行到55行就是定义“层叠式图层”,layeredimage也就是把立绘组件素材拼成一个立绘。
group里面都是不同表情。(和眼睛的定义一样)
直接在层叠式图层下面加上一个眼睛和嘴的group
[RenPy] 纯文本查看 复制代码
    layeredimage KP_立绘:
        always:
            "images/fg/KP_tomato/empty.png"
        group pose:
            attribute pose1 default:
                "KP_tomato_pose1"
        group face:#此处为不同表情,图片已定义
            pos (1302,644)
            attribute face1 default:
                "KP_tomato_face1"
            attribute 尬:
                "KP_tomato_尬"
            attribute 滑稽:
                "KP_tomato_滑稽"
            attribute 惊:
               "KP_tomato_惊"
            attribute 思考:
               "KP_tomato_思考"
        group eye:#此处为眼睛
            pos (1314 , 726)
            attribute eye1 default:
                "KP_tomato_eye"
            attribute 错开视线:
                "KP_tomato_eye2"
        group mouse:#此处都为口型,图片为可以改变自身子组件的可视组件
            pos (1374 , 841)
            attribute mouse1 default:
                "KP_tomato_speak"
            attribute mouse2:
                "KP_tomato_speak2"



show里面show的应该是“层叠式图像”的名字。
[RenPy] 纯文本查看 复制代码
show KP_立绘


补充一下具体用法……
每个group都是不同类别的组件,每个类别的组件只能一次显示一个。

attribute后面定义的是组件的名字,default是默认显示。
[RenPy] 纯文本查看 复制代码
show KP_立绘 尬 错开视线

就会显示尴尬表情,眼睛是错开视线。口型没有写,会显示默认mouse1。

评分

参与人数 1活力 +120 干货 +3 收起 理由
被诅咒的章鱼 + 120 + 3 捕获到一只野生的up主

查看全部评分

回复 支持 1 抱歉 0

使用道具 举报

 楼主| 发表于 2022-3-28 18:30:04 | 显示全部楼层
本帖最后由 怀念丶落樱 于 2022-3-28 20:19 编辑

38行到55行是干啥用的,没搞懂。是需要那些表情吗?


if renpy.music.is_playing(channel="voice") and get_voice_info(). tag == "KP":
NameError: global name 'get_voice_info' is not defined


回复 支持 抱歉

使用道具 举报

发表于 2022-3-28 20:16:03 | 显示全部楼层
怀念丶落樱 发表于 2022-3-28 20:10
[mw_shl_code=renpy,true]

define congli = Character("从离")

是_get_voice_info()……
最前面有个下划线
回复 支持 抱歉

使用道具 举报

 楼主| 发表于 2022-3-28 20:17:17 | 显示全部楼层
本帖最后由 怀念丶落樱 于 2022-3-28 20:20 编辑
Lyceenee 发表于 2022-3-28 20:16
是_get_voice_info()……
最前面有个下划线

哦哦明白了,我图片也没弄好,不好意思哈..感谢!
回复 支持 抱歉

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-26 18:46 , Processed in 0.129729 second(s), 18 queries , File On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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