MSCDavide / andengine

Automatically exported from code.google.com/p/andengine
0 stars 0 forks source link

TMXLayer.getTileAt #45

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. getting the tile at the users touch coordinates
2.
3.

What is the expected output? What do you see instead?
the touch coordinates should correspond to their respective tile in the tilemap.

What version of the product are you using? On what operating system?
current jar from examples

Please provide any additional information below.
shouldn't one divide by the tile height for within the getTileAt method to get 
the tile row?

Original issue reported on code.google.com by p.love.m...@gmail.com on 4 Aug 2011 at 4:44

GoogleCodeExporter commented 9 years ago
To be clear...

in TMXLayer.java, getTileAtXY() currently has the following
final int tileRow = (int)(localCoords[VERTEX_INDEX_Y] / 
tmxTiledMap.getTileWidth());

and it should be

final int tileRow = (int)(localCoords[VERTEX_INDEX_Y] / 
tmxTiledMap.getTileHeight());

ie, location dived by tile height, not width.

Original comment by sean.stu...@gmail.com on 8 Sep 2011 at 9:46