tileson
tileson copied to clipboard
Using tileset with size different than map tile/grid size
Tiled™ allows you to use tilesets with tile size different than tile size defined in map options. This couse problems:
-
tson::Tile::getDrawindRect()
- returns wrong texture coordinates ->[ map_grid_width * tile_x_index, map_grid_height * tile_y_index, tile.width, tile.height ]
. Should be:[ tile_width * tile_x_index, tile_height * tile_y_index, tile.width, tile.height ]
. Note that tile width and height are correct. -
tson::TileObject::getPosition()
return wrong tile position on the map ->[ tile_width * tile_x_index, tile_height * tile_y_index ]
. Should be:[ map_grid_width * tile_x_index, map_grid_height * tile_y_index ]