Sign in to follow this  
Followers 0
gamify

viewport

8 posts in this topic

hello actually i am using container renderer for background and above background placed images and images are dragging on mouse click  but dragging is happening behind the game map

i tried floating not working

 

can anyone help please for drag movement

 

Share this post


Link to post
Share on other sites

Drawing order and event processing order are both defined by Container children's z-index. Make sure the z-index is specified appropriately when each child is added to the Container.

Share this post


Link to post
Share on other sites

even after adding addChild(child, z)

the images are not draggaged above map is there any other solution

Share this post


Link to post
Share on other sites

Be sure you the z-index isn't getting overwritten. `me` is in global scope, so you can access the game world in realtime via developer tools. Traverse the scene graph, and see what the z-indexes are. Figure out why the images arent appearing above.

Share this post


Link to post
Share on other sites

worth noting that by default a container will use the auto-depth feature :

http://melonjs.github.io/melonJS/docs/me.Container.html#autoDepth

so unless an additional z argument is specified, it will ignore the z property of the child position vector :

https://github.com/melonjs/melonJS/blob/master/src/renderable/container.js#L145-L150

 

but then once an child  added, you can just modify the object pos.z value as you wish, it will automatically be taken in account

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.