the linchpin object is meant to put the four voxels at the center of the screen via its coordinates
I’m using the pytmx module to import the map. However, I have been unable to correctly translate the supplied x/y coordinates to something that pygame can show on the screen. In addition, the coordinates for placed objects seem to have its own rules, separate from the tiles.
In pygame, the coordinates start at the topleft (x=0, y=0) and directions pointing to right/down for x/y result in positive values, opposite directions result in negative values.
This is the function I used to translate the x/y values of the imported tiles (which is not working as intended, of course):
Since your to_isometric2 functions looks fine at first sight, provided those constants are the correct values, can you show a screenshot of the result in pygame? It might give a hint about where this is going wrong.
Object coordinates map to the screen rather similar to tiles, btw, except that they use more fine-grained values based on the map’s tile height:
I’m sorry I don’t think I can help you further with this. I would only suggest that before trying to center the view on the linchpin object, to just render the object on the map. That way I think it’s easier to check whether it matches the position in Tiled.
Once it has the right position relative to the tiles, you can figure out how to translate the view to center it on the screen.