0 votes

So I have encountered this odd little problem, in the editor I have added an image to a button that I set to be smaller than it's original size and everything appears to be fine:

https://i.imgur.com/Un5JMn0.png

However, when I decide to actually play the scene, the button image size completely changes.

https://i.imgur.com/VNI5RVS.png

I assume this is it returning to the image default size, but I'm wondering why exactly and if there is a way to stop it from doing that. For the record I'm using an ImageTexture with the following settings:

Flags: Mipmaps, Repeat, Filter
Image: [MyImage it's 512x512]
Size: 130, 130
Storage: Uncompressed
Lossy Quality: 0.7

Thanks to anyone who helps!

in Engine by (15 points)

You can change the scale of the button to adjust for a larger image, but unless you are going to zoom in on the button at some point in-game, I’d just alter the image size in your preferred image editing software. It lowers the size of the image file and eliminates the cost of scaling.

1 Answer

0 votes
Best answer

Look in the inspector and find the field named Scale under the Control, Rect header. If you wanted the image to be half the size, then you would set it to (0.5, 0.5). However, I would recommend editing the original image in a text editor to fit the proper size since scaling can be costly. You should only scale if you intend to scale back up to the original size.

by (97 points)
selected by
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.