How to draw on particular [TMX] layer?

Recommended Posts


in Isometric RPG example (

is there a way to draw tile selector on particular layer?

For example, i may add some tilesSelector layer to the TMX map.

In the Isometric RPG example the tile selector is drawn on the top of all layers. I would like to draw it on the basement, under player feet.



Share this post

Link to post
Share on other sites

it could as simple as setting the correct z order to your "tile selector object" 

and to make it fully dynamic, you can get the required tile z value using the following code (after your map has been loaded) :

// get the TMX Map Layer called "basement"
var layer ="basement")[0];

// get the layer z value
var zOrder = layer.pos.z;

then you can just reuse zOrder when instantiating your tile selector, and it should do the trick :)

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

  • Recently Browsing   0 members

    No registered users viewing this page.