Can somebody give me a good explanation about how pivot works?

In all software I used before, a pivot point determines an "anchor" or offset relative to the object, that is added to the global position itself.

But not in Godot, or that's what it seems, at least.

What I'm trying to do is setting the pivot using pivot_offset (by the way, poorly documented, even the name isn't that) to half the size of my control, and then when I set its position.y to zero, the control aligns with the upper border of the canvas, but not centered on the control itself as the pivot may suggest: it uses the top-left corner of the control instead, as if the pivot wasn't changed before.

Is pivot used for all transform (position/rotation/scale), or is only for resizing/rotating controls?

The same goes to anchors: why sould I care about anchors, if all positioning inside the canvas is done on absolute coordinates, not relative to anchors?

When I see this, what I expect is position to be = (0,0), based on anchoring:

But no, this is what I get instead, based on absolute canvas coordinates:

Ok, after some research, I've get to some conclussions:

  • Controls does not work as Node2D in regads to pivots.
  • You can only read the control's position from the top-left corner of the screen (or container) to the top-left corner of the control. So if you want to move to a position, you need to ask for the container's size, and then subtract the control's own size, and do the math.
  • If, for any reason, you rotate your control... good look getting the corners of that Control (it's completely up to you and your math skills).
  • Theres a get_rect() method which I have not tested yet, but doesn't take into account rotation.