0 votes

I have icons of the size 35x35 pixels, which I load with the following code:

var texture = load("res://UserInterface/Item_icons/"+icon_name)
button.set_button_icon(texture)

whenever the icon gets loaded to empty button of the same size, this button extends around the icon, so one can see the ugly grey margin of the button. Expand icon is turned off.
I tried to set the margin, but that does only change the appearance of the empty button without icon. When the icon is loaded, it does not matter what I did the margin set to in the editor.
Why does the button extend around its icon and how can I make them fit together, so one can not see the button behind the icon anymore?
I would gladly appreciate any hints.

in Engine by (56 points)

1 Answer

0 votes

what about using theTextureButton node

by (290 points)

This would lead to redoing the UI. I will do so, if there really is no way to accomplish it with the icons.

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 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.