# Widget size

**URL:** <https://forums.unrealengine.com/t/widget-size/2243607>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [December 26, 2024, 12:42pm UTC](https://forums.unrealengine.com/t/widget-size/2243607 "2024-12-26T12:42:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dvg75](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dvg75/32/1007779_2.png) [@dvg75](https://forums.unrealengine.com/u/dvg75)\
**Post date:** [December 26, 2024, 12:42pm UTC](https://forums.unrealengine.com/t/widget-size/2243607/1 "2024-12-26T12:42:37Z")

</div>

Hello,

Im trying to make a widget appears when an event is applied to a static mesh.

My problem is i can’t get a fixed size of my widget, canvas panel has a desired/custom/desired or anything else, it does not matter, it will alway go off display.

Any idea why it happened?

 ![canvas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/e/4/ee49451d714bfb76acb6667a61a4b28fd179fee6.png)

thank you

---

<div class="post-metadata">

**Author:** ![lordlolek](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lordlolek/32/906205_2.png) [@lordlolek](https://forums.unrealengine.com/u/lordlolek)\
**Post date:** [December 26, 2024, 1:14pm UTC](https://forums.unrealengine.com/t/widget-size/2243607/2 "2024-12-26T13:14:33Z")

</div>

Is it screen space or world space widget? Is it spawned directly on the screen or is it inside of some other widget?

---

<div class="post-metadata">

**Author:** ![dvg75](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dvg75/32/1007779_2.png) [@dvg75](https://forums.unrealengine.com/u/dvg75)\
**Post date:** [December 26, 2024, 1:35pm UTC](https://forums.unrealengine.com/t/widget-size/2243607/3 "2024-12-26T13:35:48Z")

</div>

it’s a click event creating a widget

 ![widgetss](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/c/1/5c134f657d83bc12d0e578d29a6b3dc864f831e5.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 26, 2024, 1:45pm UTC](https://forums.unrealengine.com/t/widget-size/2243607/4 "2024-12-26T13:45:39Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/d/4/bd4d1cc4c22dce50bf9f6732d4372009ff5daac7.png)

`Set Size in Viewport` here. You can set the position, too.

---

<div class="post-metadata">

**Author:** ![dvg75](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dvg75/32/1007779_2.png) [@dvg75](https://forums.unrealengine.com/u/dvg75)\
**Post date:** [December 26, 2024, 2:00pm UTC](https://forums.unrealengine.com/t/widget-size/2243607/5 "2024-12-26T14:00:59Z")

</div>

awesonme. thank you very much! next is to find a way to make the widget dragable.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 26, 2024, 2:06pm UTC](https://forums.unrealengine.com/t/widget-size/2243607/6 "2024-12-26T14:06:06Z")

</div>

> [@How to move a widget panel when I press the mouse button, and follow the mouse cursor](https://forums.unrealengine.com/t/how-to-move-a-widget-panel-when-i-press-the-mouse-button-and-follow-the-mouse-cursor/469473/3):
>
> Yes, that is what I try to do

---

<div class="post-metadata">

**Author:** ![dvg75](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dvg75/32/1007779_2.png) [@dvg75](https://forums.unrealengine.com/u/dvg75)\
**Post date:** [December 26, 2024, 6:44pm UTC](https://forums.unrealengine.com/t/widget-size/2243607/7 "2024-12-26T18:44:33Z")

</div>

thanks!

you might have a path or a clue relative to my next problem.

pickin up a mesh from a widget  
drop it in the scene  
move rotate  
delete  
pick another etc…

---

<div class="post-metadata">

**Author:** ![dvg75](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dvg75/32/1007779_2.png) [@dvg75](https://forums.unrealengine.com/u/dvg75)\
**Post date:** [December 26, 2024, 7:38pm UTC](https://forums.unrealengine.com/t/widget-size/2243607/8 "2024-12-26T19:38:13Z")

</div>

I’ve managed to get my widget clickable and moveable from point A to somewhere else.

THe widget stays in point A, is being duplicated under the mouse until point B and when mouse button is released just disappears.

And actually never left point A.

 ![on mouse event](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/e/2/fe2acf251d2a08f5d54ef4bff77cb5a7ec6c3352.png)  
 ![on drag detected](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/9/d/49d9180f074f40b61003a499ddd8665930292226.png)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 27, 2024, 3:29pm UTC](https://forums.unrealengine.com/t/widget-size/2243607/9 "2024-12-27T15:29:35Z")

</div>

> [@dvg75](#):
>
> And actually never left point A.

If you want to use Drag & Drop, you must also implement the **Drop** part. Note that the method I suggested in the linked thread does not use Drag & Drop at all; there we actually move the very widget rather than its visual copy.

> [@dvg75](#):
>
> you might have a path or a clue relative to my next problem.
> 
> pickin up a mesh from a widget  
> drop it in the scene

May ways, some simpler than others:

- simple:

> [@Dragging 3D object 'out of' a UI button but position not updating when holding](https://forums.unrealengine.com/t/dragging-3d-object-out-of-a-ui-button-but-position-not-updating-when-holding/232066/6):
>
> so many different links of events… […]if there’s a way to approach this in a simpler fashion Let me clarify; what I originally suggested is suitable for a situation where you want both - dragging a widget and dragging an actor around simultaneously. Spawning and dragging after an interface click is easier as we don’t care about widget position: [[Image from Gyazo]](https://gyazo.com/845ee0e5a16140ad15da7f127fe34cf8) The above should be in the Player Controller. Here the button was set to Mouse Down so it releases focus even though i…

- more advanced, where we _simultaneously_ Drag & Drop a widget:

> [@Getting Mouse Position During Drag and Drop UMG](https://forums.unrealengine.com/t/getting-mouse-position-during-drag-and-drop-umg/85760/15):
>
> Because it's undocumented, arcane knowledge obtainable only by those knowing a secret handshake. The below assumes you have overridden and using a Game Mode, a Player Controller and created a custom Drag & Drop Operation. in the Player Controller A Custom Event converts screen space to world space via deprojection and sets actor’s position: in the Custom Drag & Drop Operation blueprint Event Dragged spits out screen space coordinates and feeds them to an Event Dispatcher, we…

* * *

> move rotate  
> delete  
> pick another etc…

Too many ways to implement this - depends on the details. The most common way would be to handle it in the Player Controller where input stores a reference to the selected object and messages the appropriate interface whose functions the interactive objects implement.

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [January 26, 2025, 3:29pm UTC](https://forums.unrealengine.com/t/widget-size/2243607/10 "2025-01-26T15:29:38Z")

</div>

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