Cannot resize created Widget

I have noticed that when I create a new Widget dynamically, I cannot change it size. What I want to do is to create a Widget which contains only Image, and add it to my main Widget. The problem is, I want to change Widget size at runtime, but I can’t. I tried to set new size using reference from “Create…” node as well as change Image size inside the new Widget but nothing seems to work. When I create new Widget, it looks like it is wrapped by additional Canvas Panel with default size 100x30 which cannot be changed. What is the correct way to change size of dynamically created Widget?

Have you tried to use a SizeBox around the image?

Yes, I tried to put Image in SizeBox or Border and still can’t change the size.

I have finally made it by getting Canvas Slot from Widget reference and then changing size of the Widget.

1 Like

thanks for sharing the solution!

this helped me resizing my chat widget for my game when user presses esc… solved a difficult problem for me. thanks a lot!