1 decade ago
by msn
I have layers and entities in my game. I want that my one entity set first and then the last layer. So that last layer is on the top of everything. I have increased and decreased zIndex of entity but its not working for me. Any help will be highly appreciated.
I'm guessing you read through the documentation for
zIndex. For layer's simply draw them in the order you want in your game's draw method:
draw: function(){
this.parent(); //draw entities
this.layer1.draw(); //draw first layer on top of entities
this.layer2.draw(); //draw second layer on top of first and entities
this.layer3.draw(); //draw final layer
}
If you want things drawn differently, simply change the order.
Page 1 of 1
« first
« previous
next ›
last »