Right at the moment i am trying to use the tmx format in my little project. Unfortunately I noticed at one point i start to struggle. I don't get how to calculate a position of an tile with a specific gid in a tileset.
The gid self is really simple. Gid= tileX + (mapwidth * tileY) //mapwidth in tiles
The point is if I have just the gid,mapwidth/height and tilewidth/height. With which way i can calculate tileX and tileY.
I'm sure the solution is quite simple and obvious because It should be just simple math. But i cannot get a clear thought right know and need some assistance
With Google I didn't found an explanation which is clear enough, yet. I hope some of you have an idea for me