+1 vote

So this sounds stupid but I can't figure out how to move the pivot point for Buttons. For example, I have a button and wanted to rotate it from the center. It rotates to the top-left as its pivot point. The tooltip on the Select Mode says I should press V to change pivot but I'm not seeing any visual feedback at all when I press it nor does the pivot point change.

in Engine by (142 points)
edited by

2 Answers

+2 votes
Best answer

There are no pivot points for Canvas objects.

A simple workaround is to add a Container with width and height set to 0. Then add your button as a child of this Container by positioning it to the button's -halfwidth and -halfheight.

by (750 points)
selected by

Thanks! I did not know buttons didn't have them

0 votes

You need to make sure your node is selected and the cursor is located where you want the pivot point to go, then press V. The shortcuts generally only work when you're hovering the panel they are assigned to.

by (5,274 points)

That did work for Sprites but on Buttons it doesn't work. I can't even see the offset property on the button's property inspector

Oh my mistake, I thought Node2D is where the offset property came from. Apparently they're only on specific nodes like Sprites.

As vinod says below, use a work around.

Us an empty parent node as a pivot point.

What I would do is use a Position2D node as a parent, since it has a visible cross hair. Put the button as a child of it, set the property "Behind Parent" to true so you can see it, or change it's Z order. Then move your button while knowing that Position2D cross hair is your pivot. After that, go back and do your rotations on the Position2D.

Thanks! This sounds like a good idea

You're welcome. X)

helpful thanks! position2d works

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.