Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to Drag and Move a Widget?

I have several Widgets I want to move with Drag and Drop. I posted Drag and Move in the Headline because the Usual Drag and Drop is not what I want. Usually You Drag something, It remains in place and a Copy is moved with the Cursor to the destination place... However I don't want to move a Copy, I want to move the original Widget directly.

  1. Is this possible within the Widgets Blueprint and how? I have tested some approach where I had to use 2 Gates and in the Character Blueprint which is ugly if you ask me... Widget logic should remain in the widget.

  2. Is there a reason why the DragVisual is bigger than the original Widget?

Thank you very much in advance!

Product Version: Not Selected
more ▼

asked Dec 07 '14 at 12:12 AM in Blueprint Scripting

avatar image

73 7 9 11

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I Solved it on my own. I didn't use any DragVisual. I used the OnDragOver Event to set the new Position. To do so I needed some Information I only get in the OnDragDetected Function. I Save the Result of GetScreenSpaceLocation with Absolute to Local into a Custom Variable of my Widget as an Offset. Pic1OnDragDetected

On Drag over Event in the Widget which is a layer under the Draggable Widget (In my case an 'empty' UserInterfaceWidget with just a Canvas). This Event and in the OnDrop Event are the same. In my Case I don't need the payload at all... well maybe later if i can drag more than one mini Windows (Widgets). Thats because my UserInterfaceWidgets has a Variable/Reference to the unique Draggable which I can use. I add it as Child to the Canvas, Cast the return Value to CanvasPanelSlot and can now set the position to whatever I want. I my case it is the position of the MouseCursor. Thats the PointerEvents Screen Space Position calculated in Absolute to local (By the MyGeometry thingy) From that substract the Offset we created earlier. DropOnThisWidget Voila, thats your Drag and Drop/Move to any location Window.

more ▼

answered Dec 07 '14 at 02:29 AM

avatar image

73 7 9 11

avatar image arhon Mar 10 '15 at 11:15 PM

Hi, nice work! I've been trying to replicate this code for the 4.7.2 version, however, on initial click the widget is set to the upper left corner of my screen. Were you able to make it work, or am I missing something?

avatar image Maxxomatik Mar 10 '15 at 11:29 PM

Hi, thank you! Actually I rewrite the whole thing at the moment. Unfortunately I don't get to that point until weekend. I'll let you know if I found something asap..

avatar image MugenCity Sep 21 '15 at 09:58 PM

Any chance you can show us how you re-did this Maxxomatik?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question