-
Creator 版本:2.4.4
-
目标平台: Chrome浏览器
-
重现方式:
创建Helloworld工程,添加一个文本节点,设置cache mode为char,给文本添加一个描边组件,在代码里面执行一个淡入淡出的action,随机出现描边的文本的透明度不对。
项目截图:
主要代码:
const { ccclass, property } = cc._decorator;
@ccclass
export default class Helloworld extends cc.Component {
@property(cc.Label)
label: cc.Label = null;
start() {
cc.director.getScheduler().schedule(() => {
this.label.string = Math.floor(Math.random() * 100).toString();
this.playAction(this.label.node);
}, this, 5, cc.macro.REPEAT_FOREVER, 1, false);
}
public playAction(target: cc.Node): void {
let pos = target.position;
cc.tween(target)
.parallel(
cc.tween().to(0.5, { opacity: 255 }),
cc.tween().to(0.5, { position: cc.v2(pos.x, pos.y + 50) }),
)
.delay(1.0)
.to(0.5, { opacity: 0 })
.call(() => {
target.setPosition(pos);
})
.start();
}
}
效果图:

