gamify Posted April 17, 2017 Share Posted April 17, 2017 how to set an zindex to Renderable class Quote Link to comment Share on other sites More sharing options...
Parasyte Posted April 18, 2017 Share Posted April 18, 2017 z-index is usually set when adding a child to a container: http://melonjs.github.io/melonJS/docs/me.Container.html#addChild The z argument is optional, and will be automatically set by the container when not included. The behavior of the auto-z-index can be disabled with the autoDepth property. Hashasm 1 Quote Link to comment Share on other sites More sharing options...
gamify Posted April 18, 2017 Author Share Posted April 18, 2017 okay thank you Quote Link to comment Share on other sites More sharing options...
Hashasm Posted May 7, 2017 Share Posted May 7, 2017 i am setting this.autoDepth=false; but still z index taking automatically only ... Quote Link to comment Share on other sites More sharing options...
Hashasm Posted May 7, 2017 Share Posted May 7, 2017 i got it now thank you Quote Link to comment Share on other sites More sharing options...
Hashasm Posted May 7, 2017 Share Posted May 7, 2017 hi guys, can i change the z-index of draggable entity while dragging it .. i am placing few draggable entites and all of them having z-index 10,now when i drag the entity it should come on top of all other draggable entites so i am trying to change the z-index=11 on dragstart but its not affecting what should i do. Quote Link to comment Share on other sites More sharing options...
Hashasm Posted May 7, 2017 Share Posted May 7, 2017 hey guys good news i found it just make change the pos of z while dragmove then it will not select other object(mutiple objects or entities). thank you having fun with melonjs. Quote Link to comment Share on other sites More sharing options...
Parasyte Posted May 9, 2017 Share Posted May 9, 2017 Yeah, you can just change the `z` property on the entity at runtime. You might have to sort the container after changing the depth, but that's really easy. Just call the container's sort method. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.