fadein的BUG

2.4.15 还是不行 会闪一下 需要设置 Blend Src Blend Factor 为 ONE

const { ccclass, property } = cc._decorator;

@ccclass
export default class Helloworld extends cc.Component {


    private logo: cc.Node = null;

    @property
    text: string = 'hello';

    enterRoom() {
        cc.resources.load("cocos", cc.Prefab, (err, prefab: cc.Prefab) => {
            let node = cc.instantiate(prefab);
            node.opacity = 1;
            this.node.addChild(node)
            this.logo = node;
            cc.tween(node).delay(0).to(0.5, { opacity: 255 }).call(() => {

            }).start();
        })
    }

    exitRoom() {
        if (this.logo != null) {
            this.logo.opacity = 255;
            cc.tween(this.logo).to(0.5, { opacity: 0 }).call(() => {
                this.logo.removeFromParent();
                this.logo.destroy();
                this.logo = null
            }).start();
        }
    }
}

TestLabel2.4.15.zip (288.9 KB)


不知道是不是这个原因。Demo测试是好了没有异常。还得官方查看

一个是手动设置 透明度 但是颜色值中的a没有改, 在一个就是prefab中的透明度设置了颜色值中的a 也没有改

base-node.js


CCNode.js

大家一起来找茬。