Dusk get coordination for a cell

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 :slight_smile:

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.

  • Caleb

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 :slight_smile:

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.

  • Caleb

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.