When should I use a scalebox?

Hello, I’m confused about when to use a scalebox, particularly when using 3d widgets/actor widget components.

If I’m making a main menu that is in screenspace, what elements should be scaled? Is there a disadvantage to scaling everything?

If I’m making a widget in world space with a widget component, would a scale box even do anything? Would it behave differently across different clients with different resolutions?

Currently I used a scalebox on a widget loaded with a widget component to sharpen some text that was a little blurry, is this bad practice? If so, how could I achieve similar results?

Sorry for so many questions, feel free to rapid fire and go into detail where you feel is necessary, I’d like to learn about correct usage so I can fix some of my blueprints before things get overwhelming :slight_smile:

I’ll share the bits I know :slight_smile: .

At times I used the ScaleBox within a SizeBox (within a UserWidget’s widget tree hierarchy) to keep my UI size in control, on a 2D UI. I haven’t used this yet on a 3D UI (WidgetComponent, screen space etc.)

In 2D It can be useful to automatically resize up / down a widget to a fixed size. However, The few times I did this, I thought that resizing to X pixels set on the size box could have a rather limited result compared to what could be percentages of the screen for example. In my use cases it was sufficient. From my experiences as a website developer, it felt rather limited and restrictive.

To sharpen or blur an image often means a destructive operation on the original image. (when sharpening a blurred image would not result in the original quality)

There are various algorithms to resize, sharpen, blur visual elements that depending on context, could each lead to better looking results.

In general, you don’t want to stack destructive operations (blurring then sharpening), and resizing by most percentages should be avoided (quality loss on pixel calculations)

What you might also want to check is if post processing effects (sharpen, blur etc. if you use them) affect widget components in 3D. Haven’t tried.

afaik in 2D scale box / size box is all pixel based, so people using a smaller screen would just see their widgets take more space.

Didn’t try but last time I checked a widget component could be rendered in screen space. Which is rather interesting because a lot of calculations happen either in pixel space (scale, size box) or in UV space (material)

In my experience, I try to avoid size / scale widgets when I can. At times I really want to ensure a certain size, for example 200px for all buttons in a horizontal box regardless of content, but then I’m already 99.9 certain that localization of the button text would not go past that point, and I wouldn’t even need a scale box.

Now at points where I might need a scale box, say to fit in X procedural content that “might” be generated, I’m 99.9 sure I wouldn’t like the result. Why? Because when I scale down say a font to size X I can’t guarantee the visual quality and a scaled font wouldn’t match in the pre configured styling. Usually you’d have X pixels for the paragraph, header 1, 2 3 and so on. Something scaled and altered doesn’t fit in.

Very carefully placed scale boxes could act as safeguards that a pixel based UI wouldn’t leak out of the UI Space the user has on his monitor. That’s the purpose I suppose. A scalebox then would be most useful to define a minimum size on X Y, to get your button size right and so on.