custom widget size

hi

is it possible to / you would you have a widget not full screen (desired or custom) and yet have it anchored center of the screen?
seems the only way to do that is to set the x and y offset manually which would always yield a hit and run / arbitrary solution

thanks

Place it in the middle of the viewport and subtract half the widget size? Or place it in the canvas and anchor to the middle. Not sure what the actual questions is about - perhaps you could rephrase it a bit?

1 Like

this is not an ordinary widget in the sense of a ui overlay widget but merely an add on actor widget
the only way i can get my widget in the middle (of the viewport?) is to have if full screen
if i make it custom or desired the canvas is not the whole screen full (which i think is desirable somewhat in this case) but i struggle to then get it in the middle/ centre
which makes aligning it with the actor more difficult

Not sure i follow, could you explain what you’re trying to do? An example, perhaps? I saw your other thread about world space widget. Perhaps you could demonstrate somehow:

  • what you need, ideally
  • what is not working
  • what you’ve tried

It’s bit fuzzy atm.

want to attach a widget to an actor
have now added a / the widget to the actor bp
struggled at first to get it visible and showing in the right place
had to change its rendering bwetween world and screen
also, i wanted to set the widget base canvas to size>desired in stead of full screen as it is hardly a full screen widget
but once you do that positioning the widget relative to actor becomes incrementally more difficult

thanks

I still do not understand what you mean. A widget component in world space always shows centered around where it’s placed. You can control its size with the Widget Component’s Draw Size - not inside the 2d widget.

You may need to provide an example (image) of what is working and what is not working.


  • a widget with just a button:

  • attached to an actor as a component and working in world space

Do tell what is the exact issue you’re having.

1 Like

lol. let me try to explain more
i base / platform my widgets with a canvas to populate
this is perhaps or perhaps not a good practice / idea for widgets other than the main game widget
anyway, you can size the canvas as either full screen, custom, desired, custom screen desired screen
sizing it as full screen is “wasteful” in my eyes for a small widget
but if you size the canvas as something other than full screen i find that i struggle more with positioning it
i think rendering the widget in world space might be easier to set its position relative to the actor but i am not that far yet
at this point i am at rendering on the screen

Do you mean this? This is just a preview and has no impact on the size of the widget.

yes but my side it affects positioning of the widet in the end

that multiplied with render > screen
like i said i still need to try world render again

i also struggle to set the position of the canvas if i set the canvas size as custom / desired & screen

Because it’s a preview… And we still don’t know what your struggles revolve around since you’ve yet to demonstrate it :person_shrugging:.


if you need help:

  • show what you want
  • show us what you’ve got
  • show us what’s not right

Do you even need canvas? If you’re making a world space widget, in 9/10 cases you do not… Desired Size will be dictated by the component.

yes you are too quick for me
you gave me stuff to work with so let me see what i can do
will revert

1 Like

Canvas is actually a beast. There is a reason this:

…is now set to None in UE5. In UE4 it was set to Canvas by default. Meaning everyone and their mother would have a canvas (one of the most advanced, expensive and controversial widgets) in every single widget, even though it was not needed.

if you want to have a consistent full screen layout, you’ll need to work with the canvas. In almost all other cases, you probably don’t. Probably because people make funky stuff and sometimes they do need it, ofc.

1 Like

thanks for mentioning
its helpful
i started to get the idea that maybe one should not always use canvas
though it seems like a proper way (wrapper)
simply dropping stuff in a vertical box for a more elementary widget seemed inappropriate on the other hand

so what is good practice for an elementary widget that contains one or two texts boxes an image and so forth?

can you perhaps explain the difference between canvas size: desired / custom vs canvas size: desire / custom + screen
i more or less think i undestand the custom and desired part, but what does the screen part do
i think i perhaps understand that part wrong

  • overlay
    • image (fill)
    • vertical box (fill)
      • text box
      • text box

Note that Overlays do (kind of) support zOrder - it’s dictated by the order of elements in the hierarchy.

1 Like

Where do you see those canvas options?

drop down top corner right

This has nothing to with a canvas - it does not even say canvas… This is just a preview of how the widget would look like under specific conditions. To visualise it before you add it elsewhere.

Let’s say you want to design a cool progress bar that will always be 128x32 - you can set it to that size so it’s easy to work with. But you must ensure later on that you DO SET the widget to be this size. This setting does not affect run-time.

If you set this to Desired, the element within the widget will now have a Desired Size to work with in the preview, as they would in the final widget. But the final widget must dictate the same size for this to work.


There are numerous improvements coming to widget workflow. Finally.

Some of them may have made it into 5.5. The Quick Preview sounds like a blessing.

nice. thanks. need to work with that now. need to check my widget sizes. think that will help solve my issues with positioning

what is the best way to place an elementary widget next to an actor?
would it always be to place the widget inside the actor blueprint?
if you keep the widget separate because it is universal to other actors will you struggle to position it next to the relevant actors?
you can of course use the mouse coordinates and set / change the widget transform, but is that a proper way to do it?