Is there a way to get around the button having a minimum size of 20 pixels vertically?

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

I need a button in my game to be 16 pixels vertically. But Godot has a minimum height of the button at 20 pixels. I get around this by rotating the button 90 degrees but is there a better solution?

:bust_in_silhouette: Reply From: jgodfrey

Not sure about the Button control specifically, though I suspect you could make it more “minimal” via a new theme (though, again, not sure).

Are you putting any text on the button? I assume not since you’re currently rotating it by 90 degrees.

Could you instead use a TextureButton and provide an appropriately sized texture?

Using a TextureButton worked perfectly for me!

thomasedwards | 2020-11-19 00:15

:bust_in_silhouette: Reply From: njamster

If you define a custom font for the button, you can set it’s size as well as “Extra Spacing” towards “Top” and “Bottom”, which can be set to a negative value as well. By doing so you can easily go below 20 pixels.