How to size a button

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Dring

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

have you tried change the scale at the inspector ?

asetyowatir | 2018-03-09 15:19

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

Dring | 2018-03-09 18:05

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

Zylann | 2018-03-09 18:59

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.

Dring | 2018-03-09 19:49

So the node you use for your button is MenuButton?

Zylann | 2018-03-10 01:24

:bust_in_silhouette: Reply From: bitwes

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.

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

bitwes | 2018-03-10 05:24