How can I have custom, hi res icons that scale using stretch mode 2D?

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

I’m having a bit of trouble customizing the premade HUD nodes in Godot. I’m currently using Stretch Mode/2D, Aspect/Expand, and I’d like to have custom icons for things like the HSlider’s Grabber that will still look clear and crisp when expanded.

The problem is I can’t seem to set the scaled size of the icon. For example, I’d like to use an image that’s much larger than the initial grabber size, something like 100x100 pixels, and scale it down, so that when the menu is expanded, it automatically increases the size without becoming blurry. With other images that aren’t actually replacing the default nodes’ icons its fine, because I can just change the size of the icon, but I can’t seem to do that here. I just get a 100x100 image slapped onto the slider.

How can I reduce the size of custom icons that are applied to the built in HUD nodes?

Sounds like you want to create a custom menu that behaves just as you want it to?

Becbunzen | 2020-06-02 15:50

I guess, it depends what you mean, that’s a pretty vague question. I want to change the size of the Grabber of the default HSlider node, without having to change the size of the texture I’m using for it.

denxi | 2020-06-02 20:04

I have wanted to do similar things, like an OptionButton with icons that are of different size when collapsed and expanded, but not found a way to do it.

Becbunzen | 2020-06-02 20:54

Searching around more, it seems that svg files are still not supported natively. If an svg is imported it will be converted to a png.

Becbunzen | 2020-06-03 07:29