0 votes

Im just getting started with godot and trying to create a button, but my image for the button is a lot bigger then I want, how can I size the button to the size I want? When I adjust the size it looks to be locked

in Engine by (16 points)

have you tried change the scale at the inspector ?

i have but it is inside a horizontal container and the container stays the same height and when i run it the button is still full size

Which node are you using? How is your scene setup?

Im using menu buttons inside a horizontal container. My scene tree consists of margin container then a VBoxContainer, then HBoxContainer, then the menubutton. If i need to resize all my graphics that is going to be a pain.

So the node you use for your button is MenuButton?

1 Answer

+1 vote

Smaller image...or add the image as a child of the button instead of setting the button's image property. The button won't allow you to size it smaller than the icon.

I've gotten around this in one case by adding a sprite as a child of my button and then resizing the sprite. There's probably some sweet button/image feature you'll miss out this way.

by (143 points)
edited by

I was mistaken about anchors. I just rediscovered that sprites don't have anchors. I removed references to anchors in my answer.

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 webmaster@godotengine.org with your username.