Announcement

Collapse
No announcement yet.

UMG - Input handling, when there are multiple widgets displayed

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

    UMG - Input handling, when there are multiple widgets displayed

    Let's say I have added to viewport one widget. It can interact with mouse etc, and it works fine.


    Then at some point I add another widget to Viewport. I want this newly added widget to be able to capture mouse events as well.

    But.. it doesn't work!

    I can only interact with second widget, when the first one is not added to viewport.
    Ideas ?
    https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

    #2
    Are you "childing" the 2nd widget to the first? Maybe could be this.
    Last edited by creasso; 12-14-2014, 12:53 PM. Reason: grammar, lol
    VIDA - U4 Indie Goth Horror Game
    Project Thread

    Comment


      #3
      Hm I don't.

      So You say I should create one full screen widget, and then parent to it all other widgets ?
      Worth trying.
      https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

      Comment


        #4
        Don't get me wrong, I said you "could" LOL.

        My game now is working this way, a "one widget to rule them all" thing, I'm just "splitting" complexity among widgets related to each functionality, after, I place instances inside the "One Widget" in the own UMG editor, but I think that until by code this parent/child relationship means "who's inside who".

        To manage what is shown or not I'm using a simple visibility toggle, but I think you could also create and parent/child them realtime.

        Hope it works.

        Added: Get a fullscreen "constant" widget doesn't seen a so much crazy approach if you consider that our "mouse cursor layer" could be it.
        Last edited by creasso; 12-14-2014, 02:41 PM.
        VIDA - U4 Indie Goth Horror Game
        Project Thread

        Comment


          #5
          Make the Canvas (the big blank area) of the widget "HitTestInvisible" so the underlying widget can receive input. Just because you can see trough doesnt mean you can click trough . Altho the Childing Method is alot better for example if you have some widget windows wich you want to Zorder on click etc
          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


            #6
            Childing multiple widgets worked.
            Though it's hardly ideal solution still, it at least works! That's enough for testing .
            https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

            Comment


              #7
              why isnt childing ideal?
              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


                #8
                Originally posted by iniside View Post
                Childing multiple widgets worked.
                Though it's hardly ideal solution still, it at least works! That's enough for testing .
                What I usually do in these cases is that I create an enum in the character handling the menu with all the possible menus and use a switch to check on which menu you are on. Then you can just customize what happens in each menu.

                Comment


                  #9
                  yes or you use an overlay and multible borders so you can set visibility and have only 1 widget to deal with
                  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


                    #10
                    Originally posted by ruohki View Post
                    why isnt childing ideal?
                    Well it add some complexity, and at that point I'm not sure how to do moveable windows. But as I said, it's more than enough for what I'm doing right now.
                    https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

                    Comment


                      #11
                      When you add your child to the present user interface. Save down a reference grab the Canvas Slot -> SetPosition. (easy spoken for the movement, might be doing a tutorial on moveable windows this we) The childing is an awesome feature. I can create a kind of Window styled widget with all the functionality (movement, close, minimize etc) and to that window widget you can add your special content widget. so you dont have to do the basic stuff over and over
                      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
                        Anything mutually exclusive that takes up identical screen space can also be done with a Widget Switcher

                        Comment

                        Working...
                        X