Button With Image changing size between editor and playing scene

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Connall Lindsay
:warning: Old Version Published before Godot 3 was released.

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!

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.

Michael Paul | 2017-11-16 01:16

:bust_in_silhouette: Reply From: bitbloom

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.