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
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?
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:
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
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.
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
…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.
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
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.
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?