Jump to content

Tilemap get object position


Zenext
 Share

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;

    }

})

Link to comment
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/

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...