Sign in to follow this  
Zenext

Tilemap get object position

Recommended Posts

you need add custom param for your object. And after by means methods .hasOwnProperty(your param) and method forEach get your object from object layer. 

this.map = this.add.tilemap('tilemap');

var objects = this.map.objects;

var myObj;

objects.forEach(function(el){

    if(el.hasOwnProperty(customParam) && el.customParam==customParamValue){

        myObj=el;

    }

})

Share this post


Link to post
Share on other sites

@jmp909 - no, not yet. No layers, just 128 128 generated tileMap data, I'm interested because I opened another post on tilemaps:

I am able to save files natively by full OS support with node modules via nwjs, but I have not found a way to save generated tilemaps with phaser into real files- because of the object structure:
http://www.html5gamedevs.com/topic/18787-save-tilemap-data-using-nwjs-phaserjs-and-node-fs-can-save-files-convert-tilemap-in-tiled-json-like-file/

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.

Guest
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.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.