How to make LazyLayer work?

How to make LazyLayer work?
0.0 0


I started to use LazyLayer ( recently but can’t make it to work.
I create a new LazyLayer, and add a background sprite to it similar to the link I provided above.
Unfortunately, nothing shown on my screen but without any errors.

How to make it work?

Thanks ahead !


I have a code that uses lazyLayer:

I also have seen it not showing up in Chrome at least, and I fixed this by preloading the image (spritesheet in my case):

            {type: "plist", src: "Resources/sprites.plist"},
            {type: "image", src: "Resources/sprites.png"}

hope it helps


Thanks for your input Konstantin S, your code and mine is really similar.
I do use alpha version 2 with the following code.

`// lazylayer
var backgroundLayer = new cc.LazyLayer();

        // --- Intro State ---
        this._bg = cc.Sprite.create(res_game_bluesky);

        this._cloud = cc.Sprite.create(res_game_cloud);
        this._cloud.setPosition(cc.ccp(winSize.width, centerPos.y + 70));
        this._cloud.runAction(cc.MoveTo.create(0.6, cc.ccp(centerPos.x, centerPos.y + 70)));

It’s in the parent layer, I can only see the black color at the background. I tried to set anchorPoint and position to _bg as well (to the same as yours), the result is the same.