I am trying to build a game dusk. I need to add an image on top of a cell. What is the best way to calculate the actual coordination of a tile ? I could not find a method in dusk to do that.
thanks,
I am trying to build a game dusk. I need to add an image on top of a cell. What is the best way to calculate the actual coordination of a tile ? I could not find a method in dusk to do that.
thanks,
Sorry for the delay, I didn’t notice this post
You can use the following:
[lua]
local pixelX, pixelY = map.tilesToPixels(tileX, tileY)
[/lua]
Where (tileX, tileY) is the position of the tile you want to position it at.
It seems this method doesn’t consider the camera focus and zoom information. It always calculates as if the tileset is rendered by default setting.
Sorry for the delay, I didn’t notice this post
You can use the following:
[lua]
local pixelX, pixelY = map.tilesToPixels(tileX, tileY)
[/lua]
Where (tileX, tileY) is the position of the tile you want to position it at.
It seems this method doesn’t consider the camera focus and zoom information. It always calculates as if the tileset is rendered by default setting.