Announcement

Collapse
No announcement yet.

[UMG Tutorial] How to create Dragable Windows

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

    [UMG Tutorial] How to create Dragable Windows

    Hi,

    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

    Click image for larger version

Name:	Unbenannt.jpg
Views:	1
Size:	97.0 KB
ID:	1142325


    EDIT: Important this does not contain a map, you need to create a customgamemode and add the DragDropController as the default playercontroller to get this demo working.

    Oh and a little sidenote. You can use the technic i used to determin the mouse position in the viewport (fullscreen or windowmode) to get fullscreen dragdrop stuff working

    Download:
    https://www.dropbox.com/s/buutnfmjww...ndows.zip?dl=0
    Last edited by ruohki; 03-27-2017, 04:00 AM. Reason: links fixed
    Free Inventory System (BP AND C++ Version): Clicky Clicky
    Player Structure System (Houses!) (BP): Pew Pew Marketplace Version: Yoink!
    Howto: Create Dragable UMG Windows: Zoom Zoom

    #2
    Will save people a some time and effort.
    Very useful.
    Thank you.
    Rule#21: Be polite, be professional, but have a plan to kill everyone you meet.

    Comment


      #4
      Awesome, thanks Ruohki!

      Comment


        #5
        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.

        Do you have any idea why this is happening?

        Thanks,

        Comment


          #6
          Thanks a lot ruohki, your projects are really helpful.

          Comment


            #7
            This is very helpfull indeed thanks for the share.
            IF i may be so bold to ask for more comments next time that be great.
            Thanks again and have a happy new year!
            Cheers!

            Comment


              #8
              Originally posted by Onoa View Post
              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.

              Do you have any idea why this is happening?

              Thanks,
              try to cook content first sometimes it helps
              Free Inventory System (BP AND C++ Version): Clicky Clicky
              Player Structure System (Houses!) (BP): Pew Pew Marketplace Version: Yoink!
              Howto: Create Dragable UMG Windows: Zoom Zoom

              Comment


                #9
                Is there a written version of this somewhere?
                Thanks again.

                Comment


                  #10
                  written version? like commented? well ill put down some coments and post an update
                  Free Inventory System (BP AND C++ Version): Clicky Clicky
                  Player Structure System (Houses!) (BP): Pew Pew Marketplace Version: Yoink!
                  Howto: Create Dragable UMG Windows: Zoom Zoom

                  Comment


                    #11
                    Changed the thing, everything is commented now.
                    Free Inventory System (BP AND C++ Version): Clicky Clicky
                    Player Structure System (Houses!) (BP): Pew Pew Marketplace Version: Yoink!
                    Howto: Create Dragable UMG Windows: Zoom Zoom

                    Comment


                      #12
                      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?

                      Click image for larger version

Name:	1.PNG
Views:	1
Size:	57.5 KB
ID:	1064955

                      Comment


                        #13
                        Originally posted by ruohki View Post
                        Changed the thing, everything is commented now.
                        Thank you that is realy nice of you! ★
                        Cheers!

                        Comment


                          #14
                          Thank you ruohki

                          Comment


                            #15
                            I love you for this. That trick with use the parents geometry has changed my unreal life. I am using this method in a inventory system i am working on!
                            Thank you so much ruohki!
                            JcInventory, a Jigsaw Grid based Inventory designed in UMG and blueprint

                            Comment

                            Working...
                            X