Announcement

Collapse
No announcement yet.

UMG - Drag&Drop capturing mouse events.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #31
    Originally posted by NickDarnell View Post
    The documentation that exists is what's above, official doc that covers all the things takes time and this feature still has some rough edges as noted at the top. "On Drag Over" is what is called on the widget that the droppable content is hovering on top of.
    Hi,

    Is there a way to know when a Drag Over is completed (e.g. Drag Over Leave function).

    e.g.

    Let's say I want to highlight an icon with a color when hovering on top of it and dragging another icon. I can use the Drag Over function and change the color of the icon to red, but it seems that there's no way to detect when the Drag Over is completed and hence let me change the color back to it's default state.

    Are these 2 functions what I am looking for, and if so, are you planning to expose them in Blueprint?

    SWidget::OnDragEnter
    https://docs.unrealengine.com/latest...ter/index.html

    SWidget::OnDragLeave
    https://docs.unrealengine.com/latest...ave/index.html


    Thanks,
    Last edited by Onoa; 04-14-2015, 11:07 PM.

    Comment


      #32
      Tried to implement this today and I'm running into the black square problem.

      Comment


        #33
        Hey Nick,
        The post is which version of the engine?
        My engine is UE4.76,Can't implement drag-and-drop in that way,what should I do?
        please help me!

        Comment


          #34
          How would you do this with re-adding the dropped widget back to its parent, if the parent is a canvas panel?

          Comment


            #35
            hello eveyone can you help please

            Comment


              #36
              Originally posted by Slimbenneji View Post
              hello eveyone can you help please
              If you want some help, you're going to have to give us a bit more info....
              I'm @londonisunreal, the organiser of the London Unreal Engine Meetup group.

              Comment


                #37
                Originally posted by Nick Darnell View Post
                Looks like my quick start guide for drag drop didn't survive the drafting stage of the release notes, guess they were already getting a bit hefty - that's right the release notes were bigger

                NOTE: Drag/Drop bug, if you attempt to use it in a fullscreen game it's going to kick you out. Currently it's placing the content into a new temp window, on the list to be fixed. Other random stuff, if you attempt to make a button drag/droppable, you're going to have a bad time. The button is going to capture the mouse on down and the drag will never occur. Also on the list of stuff to fix

                Step 1) On Draggable Widget: You will implement the on mouse down event and do something like this: This allows drag detection to be detected, and will maintain it as long as the Drag Key is pressed.
                [ATTACH=CONFIG]14385[/ATTACH]

                Step 2) On Draggable Widget: When the drag is detected (after movement has overcome the jitter damping in Slate), On Drag Detected will be fired, and you can implement it like this, by creating a DragDropOperation that has a UObject Payload, and some widget representing the dragged content. Here’s an example I made with a spell icon widget.
                [ATTACH=CONFIG]14386[/ATTACH]

                Step 3) On Droppable Widget, you’ll need to implement some logic that does something with the Payload and Operation. I made a simple example that doesn’t do anything fancy it just moves the payload, which happens to be the spell Widget that the drag occurred on, and it just re-parents it to a widget it controls.
                [ATTACH=CONFIG]14387[/ATTACH]

                Step 4)
                Click on [Root] in both the Draggable and Droppable widget's, change their visibility to Visible, instead of Self Hit Test Invisible. That way they actually receive these mouse and drop/drag events.
                I've tried make drag for mobile and i cannot implement that (touch release = Click) and if (touch move = drag). Do you have any suggestions?

                Comment

                Working...
                X