cocos-engine icon indicating copy to clipboard operation
cocos-engine copied to clipboard

希望能提供 运行时动态修改 spine某个 slot 颜色的 api

Open finscn opened this issue 4 months ago • 2 comments

Use Case

目前只有 slot 只有 getColor , 没有setColor .

我试了下 通过下面的代码能改变颜色

        const slot = spine.findSlot('xxxxx');
        const attachment = slot.getAttachment();
        attachment.color.set(1, 0, 0, 1);

但是attachment.color 没有导出到 d.ts 文件里, 所以编辑器报错, 运行时可以实现预期. 我不太知道如何 让spine 的属性 生成到 d.ts 里, 没法提 PR, 还麻烦官方支持下.

另外 很奇怪, 不知道为什么 , 通过 slot.color.set(1, 0, 0, 1) 或者 slot.data.color.set(1, 0, 0, 1) 都不行, 但是他们又确实有 color属性, 而且也都导出了.

Problem Description

.

Proposed Solution

No response

How it works

No response

Alternatives Considered

.

Additional Information

No response

finscn avatar Sep 03 '25 10:09 finscn

@dumganhar @bofeng-song spine 的事情好像一直二位负责. 这个麻烦看一下. 不需要改动逻辑 只要导出更多的 api 就可以.

finscn avatar Sep 03 '25 17:09 finscn

dumganhar 已经离开了

zhitaocai avatar Sep 04 '25 06:09 zhitaocai