shtanton Posted May 22, 2016 Share Posted May 22, 2016 Hi I have a tilemap that's I'm using but I need to get the value of a tile at a certain location on the tilemap and haven't been able to find any way to do this Basically one of my layers is for hitboxes so in order for my collision script to work, the program needs to see whether there is a hitbox at the location the player is trying to move to Thanks in advance Link to comment Share on other sites More sharing options...
askariwa Posted May 23, 2016 Share Posted May 23, 2016 Hi,what do you mean by "certain location" ? if the coordinates are given in tile values then you have to get the tile using the getTile method, if they are in pixel values then use the getTileWorldXY method. After getting the tile, you can read its index property to get its type or its properties public property to get its "properties" (defined in Tiled) See this example for tile properties. Link to comment Share on other sites More sharing options...
shtanton Posted May 24, 2016 Author Share Posted May 24, 2016 On 5/23/2016 at 4:18 PM, askariwa said: Hi,what do you mean by "certain location" ? if the coordinates are given in tile values then you have to get the tile using the getTile method, if they are in pixel values then use the getTileWorldXY method. After getting the tile, you can read its index property to get its type or its properties public property to get its "properties" (defined in Tiled) See this example for tile properties. Thanks, this really helped! askariwa 1 Link to comment Share on other sites More sharing options...
Recommended Posts