Sunday, August 7, 2022
HomeGame DevelopmentWhy on making scrollview shade clear, it does cover the objects? -...

Why on making scrollview shade clear, it does cover the objects? – Cocos Creator


right here is code so as to add objects, Gadgets are being proven whereas scrollview sprite part shade is white. however while you make shade clear , it doesn’t present objects.

begin() {
        
        var content material = this.node.getChildByName("view").getChildByName("content material");
        var peak  = 0;
        var scrollheight = 0;
        for(let i=1;i<=6;i++){
            let newNode = new Node();
            assets.load("./belongings/item_img"+i.toString()+"/spriteFrame",SpriteFrame,operate(err,SpriteFrame){
                console.log(err)
                newNode.addComponent(Sprite).spriteFrame = SpriteFrame;
            });
            newNode.layer = Layers.Enum.UI_2D;
            peak = peak - 170;
            newNode.setPosition(new Vec3(null,peak));
            content material.addChild(newNode);
            scrollheight = scrollheight + 185;
            content material.getComponent(UITransform).peak=scrollheight;
        }
        
    }

Screenshot whereas scrollview shade clear.

Screenshot whereas scrollview shade is white

Thanks


RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments