Canvas doesn't resize to desired size

I’m making an editor utility widget blueprint. It has a canvas with a vertical box in it and I set the size of the canvas to desired. Looks right in the ui editor but when you run it, the size of the canvas is a lot bigger than it needs to be. How to fix this? I also tried with a size box instead of a canvas but it didn’t make any difference.

1 Like

I concur.

I still haven’t gotten the hang of sizing in widget blueprints. I’ll be watching responses to this post for knowledge.

This feature does not control the size of the widget in any way. It’s for designer preview. You do not even need a canvas here, you’re not using it.

Any reason why you simply do not resize the window as you would any other UE floating tab? Not sure whether you can control EUW window size in BPs. This is more of a Slate thing, I believe.

simply do not resize the widget

It should stay the same size and / or docked once closed and re-run.


Consider a new thread, this is EUW - the rules here do not apply to regular run-time, user facing widgets.

1 Like

Are you trying to fill the the widget in the EUW window or are you trying to limit the size of the EUW window to the size of the widget?

I’m trying to limit the size of the widget, to get rid of all that blank space.

You can’t really adjust the size of the Window itself from the Widget. It’s the other way around, the Window controls the size.

Instead if you want to fill the window and resize it manually, right click the Canvas Panel and replace it with an Overlay. Select the Vertical Box and set it to Fill Vertical and Horizontal. Then resize the window to the size you need, it should remember that size.

1 Like

As mentioned before twice already. This is not a traditional widget, it does not conform to the same rules… Just resize it manually and carry on with your life :smiley:

3 Likes

Yeah, I saw that when I actually tried resizing it. So, there is no way to force it to a certain size with nodes?

Nodes, no. Because you’re thinking / talking about Window Size. You could resize the widget that resides inside that window, but not the window itself.

To visualise it:

image

You get to control the green, not the red. The red is just a slate window widgets live in.

1 Like

I see. On a different note, is there a way to get the text in the editable text boxes to disappear when you click them? And is there a way to center the text in them without spaces. My current design is a bit clumsy, since it doesn’t even allow spaces.

You mean this?

image

center the text

image

Yeah, but there is no “on clicked” event for those textboxes.

Wrap it in a user widget. You will then have access to everything - focus, hover, onclick, enter.

That’s a great lesson to learn:

Don’t try to force Unreal to do what it doesn’t want to do.

There is no such option.

True that. I saw this mentioned too many times recently. The so called self-appointed Unity Refugees with extensive experience trying to fight a losing battle against the UE’s rigid framework.

1 Like

That’s not what I meant. Here wrapping would be creating a new user widget with just the native element inside - like an editable box (it works for everything, though). You’d then use this new custom editable box instead. And, since it’s a fully fledged widget now, you get to do whatever you want with it:

  • create a new widget:

image

  • add just an editable box native widget:

image

  • override what you need, customise it, make it pretty, have variables, script, methods, equip it with Event Dispatchers and so on. Your custom editable text now can:

Use those custom widgets instead of the native editable text boxes.


This is the 101 of making an interface that is modular, flexible and maintainable.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.