Jump to content

Controlling Layers CreateJS


Recommended Posts

Hey guys. I'm using CreateJS to make my javascript game.

According to the documentation, objects are layered one on top of the other, in order of their addition to the stage. To control layering, I push to multiple "layer" arrays, and add the objects from those layers. However, it isn't working! Objects that are created first are the ones on the bottom, not objects that are added first.

Here's my adding code, as you can see it adds in order of the arrays. 

  for(let a = 0; a < blockLayer.length; a++) {
  for(let b = 0; b < floorLayer.length; b++) {
  for(let c = 0; c < entityLayer.length; c++) {
  for(let d = 0; d < lightLayer.length; d++) {
  for(let e = 0; e < uiLayer.length; e++) {

  blockLayer = floorLayer = entityLayer = lightLayer = uiLayer = [];

Anyone with experience in CreateJS? Help would be really appreciated! :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...