Multiple widgets or one master interface.

Hey there

So my project is coming along well. Im essentially making a 2D game out of widgets, just a click and point type deal.

Its starting to get…Large to say the least. Im super into compressing and organising and was wondering weither its better to split my screen up into 5 seperate widgets, And call them all rather than have one master interface that does everything.

When it comes to cleaniness/organisation or pure performance, what would be the better option?

You can do it either way. But we did one project with a monolithic widget and it got big real quick. All subsequent projects we broke widgets out into individual screens. Much more maintainable and manageable for code.

Keep in mind if you separate widgets then the order they are added to the display matters. No element of a widget added later can appear “below” a widget added earlier.

You’ll also want to manage how the widgets are added. We used the HUD CPP class to manage them all.

1 Like

You create a master canvas and add user widgets to that canvas - its slots give you access to zOrder.

1 Like

Ah yeah ok, as I was thinking.

Dang :laughing:, This is going to be quite the job organising all of these.

Thanks guys :slight_smile: :trophy:

2 Likes

i think you’ll find it worthwhile to check out common UI.

Now that I am using it, I would hate to go back to not using it. Makes UMG life a lot easier.

1 Like

Might want to look at GridPanels and NamedSlot.
Those will bump up your UMG game quite a lot.

These article changed my way of dealing with UMG. Highly recommended: https://joyrok.com/UMG-Layouts-Tips-and-Tricks

1 Like

Thanks, Ill take alook into those now! They look exactly what Im looking for. I think my widget/umg/Ui game is quite weak.

Just started reading the document

“Most of the time when I’m working I see lots of crazy layouts including multiple size boxes and canvas nested in another canvas and all these other ways to try to control the layout size. These then become fragile and overly complicated widgets…”

I feel personally attacked :laughing: :laughing:

Yeah this is perfect. Im going to have a good read of this and start googling keywords.

This all makes alot more sense.

Thanks everyone :slight_smile: :trophy:

I can also recommend CommonUI as @BIGTIMEMASTER suggested.
Adding everything to a master widget might seem simply at first but turns into a horrible mess if your UI isn’t super simple to begin with.

1 Like

Having installed common Ui,
It is a baffling bit of kit. I dont really know where to start or what to use it for, With tutorials thin on the ground.
Im concerned Ill accidently blend old widgets and new widgets and create this carnage middle ground which is even worse.

Infact I think my question sits at one, Is there a way to specifically size a grid to a pixal?

For example I currently have my canvas panal laid out in specific pixals. But I want to swap the canvas panal for a grid, But the grids dont seem to work in pixals.

equally my work area just doesnt seem sized correctly?


This is showing my Grid is changing the shape of my image.


This is showing my area is set to 2560x1440.
Yet an image set at 1440 goes off the bottom meaning that the work area cannot be 2560x1440?

I can change the area to custom and set it, But the viewport wont see it as such.

I have stumbled into some big old roadblocks that I think Ive just flailed around and avoided to this point. lol :sob: I can feel alot of tutorials coming up in my future.