Sign in to follow this  

load layer

Recommended Posts

hello how to retrieve the layer object"background");

throwing error : Uncaught TypeError: Cannot read property 'getLayerByName' of undefined
    at <anonymous>:1:21

So can anyone help me  to get the layer"mainPlayer")[0];

also throwing error : Uncaught TypeError: is not a function
    at <anonymous>:1:9

for melonJS Game Engine v4.1.0

Share this post

Link to post
Share on other sites"background")[0] is working but how to get the 

but how to get

tile.row and tile.col

of the above layer


i want particular layer tile row and col but not full game layer???? please can anyone help





Share this post

Link to post
Share on other sites

once you get a reference to the layer you want, you can get the tile information by using the getTile function :

here is an example here, where we use this to highlight the tile under the mouse pointer :

Share this post

Link to post
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.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.