Quantcast
Channel: Cocos Forums - Latest topics
Viewing all articles
Browse latest Browse all 17070

Give me more information about layers - please

$
0
0

@agriz wrote:

I am confused about layers. so i don't know whether i am using them correctly or not.

var game = cc.scene.extend({
    onEnter: function() {
        //here we create a layer for the game.
        var layer = gameLayer();
    }
});

var gameLayer = cc.Layer.extend({ 

});

There are the default coding we get during the game creation.
I want to have

Background Layer
Menu Layer
Game Layer

Can i have these layers? Or all should be in one single layer?
Now i can have more layers,

var game = cc.scene.extend({
    onEnter: function() {
        //here we create a layer for the game.
        var layer = gameLayer();
       //Background Layer = new BackgroundLayer();
      //Do i need to create the additional layers inside the scene? or inside the main gameLayer?
    }
});

Please give me simple example to understand the process clearly.
Thanks a lot.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 17070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>