[UMG] The image under scalebox disappears when its alignment set to centre


I’m having a weird issue with UMG scale box:

		I've created 2 blueprint widgets, one of them is the child widget and the other one is a main widget. The child is referenced in the main widget.

		The issue happens here. I use some umg scaleboxex in the main widget to hold the referenced child widget (the intention is to keep the child widget's original width&height ratio). I set the child widget's (which is under the scalebox) alignment to be either centered vertically&horizontally or fill vertically&horizontally, then populate the main UI widget to the level. When I play the level, only the ones with alignment set to be fill both way can be displayed, while the centred aligned child widgets cannot be seen at all. But, I need to use the centre alignment setting, otherwise the scalebox won't work to keep the child widge's original ratio.

		Sorry if this has been posted before, but I haven't been able to find any answer. If this has already been asked, can anyone give a link for this?

		I can't upload the project as it exceeds the size limit, but I can send if anyone is interested in this issue

Can you show BP_icon?

Is it an image box?

Hi ClockworkOcean, the hierarchy in BP_Icon is here, it is an overlay holding an image (its brush is a UI material instance) and a rich textblock

Hi - yes, sorry, can’t see anything obvious :frowning:

I have noticed that UMG is a bit clunky. Sometimes very unlikely hierarchies work fine, and other times, simple things just wont work.

The only thing I can recommend is changing the way you’re doing it until it does work. You could also forget about the sub widget thing and just put the text directly in the main widget…

Hi ClockworkOcean, unfortunately, anyway I have to use this sub widget to handle the background images and texts, as this sub widget will be referenced in a lot of other widgets all throughout the game.
Thank you anyway as well.

Hi, sorry, too many variables. I can’t regenerate this problem.

If you can make a small project containing only what’s needed, I will take a look.

( You can make a new empty project and migrate just the widget into it, it will carry the other parts with it ).

Hi ClockworkOcean, thank you.
And I have sort out this issue.
Just in the sub widget, I put another scalebox wrapping the background image.
Then again I wrap the sub widget in a scalebox when call it in the main UI widget, set the sub widget’s alignment to fill both way, it perfectly displays in viewport, and keep the original ratio.

Yes, that’s exactly the kind of mad thing you have to do with UMG every now and then :smiley: