找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 488|回复: 0

[经验] 在对话中高亮角色,在旁白中高亮或暗所有角色

[复制链接]
发表于 2023-9-17 23:01:06 | 显示全部楼层 |阅读模式

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

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

×
本帖最后由 被诅咒的章鱼 于 2023-9-18 08:39 编辑

在黑凤梨大大分享的代码基础上改进。
思路是增加判定,当前说话角色为None时,显示原图片,另外增加定义特殊角色a,赋值当前角色为a,实现全员暗。

[RenPy] 纯文本查看 复制代码
init python:
    def active(event, name, interact=True, **kwargs):
        global current_speaker
        if  not interact:
            return

        if event == "begin":
            current_speaker = name

default current_speaker = None

define 德 = Character('德', image='德', callback=active, cb_name='德')
define a = Character('全员暗', image='', callback=active, cb_name='a')

image 德 夏常服 无 = ConditionSwitch(
    "current_speaker == '德'", "images/德 夏常服 无.png",
    "current_speaker != '德'",ConditionSwitch(
    "current_speaker is None","images/德 夏常服 无.png",
    "current_speaker is not None",im.MatrixColor("images/德 夏常服 无.png", im.matrix.saturation(0.4) * im.matrix.brightness(-0.2))))

label start:
    scene 背景 玻璃窗边
    show 德 夏常服 无
    德 "测试一下。"
    $ current_speaker = None
    "这是没人讲话的情况下。"
    "人物依然高亮。"
    德 "测试一下。"
    $ current_speaker = a
    "人物变暗"

评分

参与人数 1干货 +3 收起 理由
blackpineapple + 3 感谢分享!

查看全部评分

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

本版积分规则

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

GMT+8, 2024-9-17 04:19 , Processed in 0.114382 second(s), 29 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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