You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the title says. Using the scripting function TileMap.tileToPixel(x,y) in a registered custom file writer returns the input values instead of the pixel coordinates as described in the documentation.
The text was updated successfully, but these errors were encountered:
Ah, I'm afraid that currently this conversion function only works for opened maps, and not for maps that are being saved or maps that have been created using new TileMap(). This is because it relies on the MapRenderer instance to do the conversion and this instance is stored in the MapDocument, which is only available for open files.
But of course this function should always work, so we'll need to figure out some solution. The EditableMap class could instantiate its own MapRenderer, or the MapRenderer instance could be moved from the MapDocument into the Map. For the former I'm not too happy with the duplicated code and instance, and for the latter I'm not too happy about instantiating a renderer at a level where it's not always needed. Maybe it would be enough to create it on-demand.
Right, in that case the workaround is easy, though it becomes rather more tricky / annoying if you need to support non-orthogonal maps. I'm currently running into this issue while trying to look into MikeMnD/tiled-to-godot-export#26. :-)
As the title says. Using the scripting function
TileMap.tileToPixel(x,y)
in a registered custom file writer returns the input values instead of the pixel coordinates as described in the documentation.The text was updated successfully, but these errors were encountered: