BUG - UMG 4.6.1 - "Hidden" don't get layout space.

I’ve planned on use an image widget to expand my widget viewport to fullscreen.
But, on use the image flagged as “Hidden” it stops expanding and from getting layout space.

26800-imageanchors.jpg

The workaround was keep the image Hit Test Invisible and use a completely transparent image to still drawing it. :frowning:

26811-hiddenusage.jpg

But the description as you see doesn’t describes such behaviour to Hidden.

Best Regards.

I’m not sure I understand the plan as stated, can you explain how the image is going to be used? Looking at the canvas code, hidden widgets do contribute to the canvases desired size, apparently so do collapsed ones.

This widget would just contain a small 50x50 image inside a canvas, a mouse cursor.

But, as I read somewhere, to get a fullscreen widget we need other content on the widget to “force” fullscreen expansion I could not get the root canvas neither a child canvas to expand the Widget area, trying with Canvas Slots plus my cursor image caused the widget to doesn’t show.

On the other hand, other widgets I made with a background image widget “anchored to corners” fills the screen completelly, so I thought about place a “dummy” image hiden to keep the Root Widget layout fullsized and allow my cursor to travel on the free space created.

“IF” I make the image widget Hidden or Collapsed the entire widget vanishes when playing Standalone (on Editor it does appear), notice that the layout holder and the cursor has not hierarchy relationship, so I suppose that the only reason to this is that Layout fill behaviour on Hidden is not being considered.

All widgets added to the viewport are fullscreen. Assuming you don’t try to adjust their position or force a size, they’ll cover the entire screen.

Your image you’ve anchored to all 4 corners isn’t providing any size information. Anchoring to all 4 corners is in effect stating that you’re only as large as your parent, based on the percentages of the anchors. So if the parent is full screen, and you’re anchored at all 4 corners, you will also.

I don’t know why you’re getting behavior you’re getting though, I suspect it’s something else. Try making your root widget a border with a canvas inside so you can see when the widget is on screen.

Here we go: :smiley:

As you see, no size neither layout manipulation.

Now the results:

And just on switch th holder to hidden:

Hope this helps

Hmm, this is unrelated, but don’t load a widget in that manner, the blueprints are an editor time only concept, that’s why the WidgetBlueprint class is in an editor module - the UBlueprint will likely be soon as well. You should expose a TSubclassOf UUserWidget, UProperty on your HUD, set the value in the editor, and it will be the class you want in native code. No need to muck around with hardcoded paths and loading blueprint assets.

While in the editor, you can use Ctrl+Shift+W to open the widget reflector. You can use it to pick on widgets in the editor to figure out what’s there, 4.7 adds the ability to see what UMG widgets exist, for now all you’ll see are the Slate ones they create, but might be helpful in debugging.

Nick if you could point a way to load a widget on C++ on a better way and “without any Level Blueprint interaction” I’ll be thankful, some minutes ago I got a problem with this UBlueprint stuff since on package the UserWidget it should become another thing (I’m on this now, maybe I’ll get it trough FStreamableManager and one DataAsset storing FStringReferences).

I’m trying to make a game whose the entire logic and gameplay is outside from the level BP (that I’m using just to map related events), this way, I don’t need to provide the entire gamelogic on each map myself or a modder makes to it.

You don’t have to spawn a widget in the level blueprint, you can spawn then anywhere. Some people use HUD, others use the Player Controller, the thing to keep in mind if you use the player controller is to only spawn them for local player controllers, since replicated versions of the player controllers for multiplayer clients are also added to your game.

Occasionally the level makes sense, like when you have a Main Menu level, that you load when the game starts that does some fancy stuff in the background while the UI sits on top.

My controller has no Blueprint, it’s spawned by the engine Default Class.
My Pawn/Character has no Blueprint, it’s spawned on PlayerStar… Hey! I could use a custom PlayerStart to my game (that will be surely placed on each level built) to fire the UMG chain and place it on my HUD. :smiley:

Thank you to force me to think LOL.

Your tip about Spawn anywhere got me to look on the Project settings and see that I could extend my HUD class with a Blueprint and also use it “IF” I also extend my gamemode on a BP. Thanks!

Hello ,

It sounds like you have things figured out. I am going to go ahead and mark your response as an answer for now. If you feel like this issue still needs more work feel free to post and open this issue back up.

Make it a great day