Image Sizing retrieval for Mathematics game

Godot Version

match symbol:
“+”:
var size = Image.load_from_file(“res://Sprites/Operators/plus_symbol.png”).get_size()

print(size)
custom_minimum_size = size

Question

Hello! I am trying to make a math game, which requires pulling an image from a png file and then sizing a Hboxcontainer to hold a few thing inside (1,3,+, etc.) If I try to get the size of the image using the above code, it doesn't work (I get like 8.3 x 0 instead of 2048x2048 like I expect) Anyone else run into this issue?? Thanks for the help!

You can’t get 8.3 because get_size() returns an integer vector. Don’t use size for the variable name because that may be the name of an already existing built in property of the node your script is attached to it.

Check for error and warning messages.

That’s odd. Is your plus sign image really 2048x2048 ?

You’re supposed to use GDScript.load() to load resources. Then you should be able to configure the gui controls to hold and display the things you want without dealing with the sizes at all.