How to retrieve an object's origin point values

With about 25 hours of Gdevelop under my belt, I’m starting to get comfortable with the environment and have started to streamline my code. I searched the forum, but couldn’t seem to find this tidbit of information: Is is possible to extract the Origin point values relative to the object. I don’t need to know where the origin is relative to the scene, I need the offset values entered here:


Is this possible without a lot of fancy foot work (e.g. spawning an instance of the object so that it’s upper left corner is at 0,0 of the scene then using Object.PointX(“Origin”) and Object.PointY(“Origin”) to get the values). If the example is the only way, then I will have to resort to adding object variables to hold the values - just makes more work in the long run, since the values already exist in the Object definition.


Considering these are offset values that kind of “subtract” from the position of the top left corner of the Sprite, maybe you could just make ANOTHER point with no offset - like the “UL” point you have there - and then use THAT to get the value of the offset? Something like:

NewObject2.PointX("Origin") - NewObject2.PointX("UL")

This way, regardless of the position of the Sprite, the expression will always give you the offset of the “Origin” point correctly. The same can be done for the Y axis, too.

NewObject2.PointY("Origin") - NewObject2.PointY("UL")

I’m not sure if there are better ways, this is all I can think of right now. ^^;
I hope this helps!

Thanks, MayhemCats - that might be a better option than storing the center offset values in shape variables.