Change the "pivot" of Tiled Object Templates for GameMaker 1.4

Hi There!

I use GameMaker Studio 1.4 and wanted to rely heavily on tiled for level creation.
So I created object templates in tiled but when I export the map as .room.gmx and load that in Gamemaker, the coordinates of several objects are off.
It seems like Tiled exports the coordinates of the top left corner of the sprite used for the template, whereas in Gamemaker I use the centre of the sprite as pivot/reference point/center of object (or whatever you want to call it).

In tiled I tried changing the x and y settings of the template objects but this didn’t do anything at all (even though the tiny point indicator in the template preview moved)

Also both GameMaker and Tiled are at the newest version (at the time of writing Tiled 1.9.0)

How can I actually change the pivot/reference point/objectcentre in tiled, so that the objects will also appear at the same position in gamemaker? Or is there any other solution? Specific custom properties?

Thanks in advance and have a good day :slight_smile:

I’ve not used the GMX export so I don’t know if this applies to it, but hopefully it just uses the same origin as Tiled:
The origin for Tile Objects is based on the Object Alignment setting in the tile’s Tileset. Sounds like you want to set that to “Center”. This will change snapping behaviour though, it’ll be the centre point that’s snapping, not the edges.
Although, you said Tiled exports top left, but the default Object Alignment is Bottom Left for orthographic maps, so maybe the exporter just always forces top left…

I think some sort of custom property-based option to export a different origin point would be pretty good, since one may want different origins/pivots between Tiled and Game Maker.

1 Like

Ah, great, thank you.
Changing the Alignment didn’t do anything concerning my discribed problem, but your tip led me to the solution:
In the tileset settings you could also set a “drawing offset”. Of course unfortunately all the images (in the tileset) used for your templates would have to be the same size for this to work. But it is a solution non the less. :+1:

(And I guess, if this would be problematic for someone, then you just would need to have multiple tilesets each containing their own set of image-sizes)

Glad you found a workaround!

It would still be nice if the export respected the Tileset settings and/or provided some way to set custom origin points for objects.

True.
Preferably custom origin points, as this could be the case in GameMaker, too. :wink:

But I guess it depends on how high the number of people is who actually use the native gmx export of tiled. As I didn’t find anything about my problem online, I’m afraid it’s not an high prio issue.