i’ve clicked together some stuff to show how you could implement moveable windows in your game. (Also manages ZOrder)
the code isnt really documented but it should be easy enough to understand. If you have any questions dont hesitate to ask them.
This BP stuff can be used as a canvas. Use the DragableWindowWidget to attach some childs to it so you wont have to deal with rewriting the drag logic over and over for every window your game has
This example has been very useful so far. I’m finally starting to get a grip on how stuff works in UMG. I’ve noticed one issue, the example you’ve created works well in PIE and in New Editor Window, but it doesn’t work in Stand Alone Game. The mouse cursor doesn’t pick up the widgets and instead controls and rotates the camera.
Thanks for the commented version. I didn’t really understand all the mouse events when I first used the non-commented version of this
One question though, why is this Slot as Canvas Slot and not Border Slot, since the first child in the widget root is a Border Slot? By “OuterParent” are you referring to the actual root of the widget? So the root in UMG is always a canvas slot?
the Slot as Canvas Slot will grab the Canvas in the Parents Space. Since the Direct parent is a Canvas, the widget is inside a Canvas Slot, we also dont want to move the widget itself because the only way we could do that is the translation, we move the parent slot