Announcement

Collapse
No announcement yet.

What happened to the ChangeMenuWidget node

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

    What happened to the ChangeMenuWidget node

    On the bottom part of this page it mentions a ChangeMenuWidget node https://api.unrealengine.com/INT/Pro...G/3/index.html but this seems to be missing from 4.20 How do I now change to a new widget when I press on an option. I don't want tabs I want a new window and Its a 3d widget also.

    #2
    Look like a custom function node that removes a widget from the viewport, clears its variable (so the GC can pick it up), creates a new widget, stores it in a reference and adds it to the viewport.

    There's no catch here.

    Comment


      #3
      I don't have a viewport its a 3d widget. Add to viewport puts it in the center of the screen

      Comment


        #4
        You do have a viewport, everybody does . Add to viewport does not do anything to the widget's location, these are the anchors, offsets, parent hierarchy, canvas position, that control widget screen space; you have full control over them and you can also directly set viewport position.

        If you want to use a 3d widget instead:

        - create a 2d widget
        - add a widget component to the actor that will control it
        - assign the above-mentioned 2d widget class to that component
        - moving component moves the widget (moving the embedded 2d widget will also move the widget, but in relative space)

        If you want to effortlessly swap the embedded widgets often, do so in a macro.
        Last edited by Everynone; 08-16-2018, 04:41 AM.

        Comment


          #5
          Originally posted by Everynone View Post
          You do have a viewport, everybody does . Add to viewport does not do anything to the widget's location, these are the anchors, offsets, parent hierarchy, canvas position, that control widget screen space; you have full control over them and you can also directly set viewport position.

          If you want to use a 3d widget instead:

          - create a 2d widget
          - add a widget component to the actor that will control it
          - assign the above-mentioned 2d widget class to that component
          - moving component moves the widget (moving the embedded 2d widget will also move the widget, but in relative space)

          If you want to effortlessly swap the embedded widgets often, do so in a macro.
          Ya I can do a 3d widget place it in the world click on it, have it do things but the only thing I can't do is have it switch to another window. You mention using a macro, are there any tutorials that go over that?

          Comment


            #6
            I just tested it and you can swap widgets around in a widget component just fine. Widget Component -> Set Widget. That's it, it's literally one node. Is there anything particular that should work but it does not?

            You mention using a macro, are there any tutorials that go over that?
            Macro tutorial? Macro is what you put inside:

            https://docs.unrealengine.com/en-us/...erGuide/Macros

            Macro for a widget component swap out would look like this:

            Click image for larger version  Name:	Capture.PNG Views:	1 Size:	63.6 KB ID:	1516369

            This will essentially replace one widget with another in the same component.

            eidt: It's even easier if you spawn widgets before hand, keep them hidden and replace the widget components loadout using a stored reference - this is actually a path that I'd take. You won't have to worry about saving data in the widgets that get replaced. That's, of course, providing it's desirable.
            Last edited by Everynone; 08-16-2018, 04:27 PM.

            Comment


              #7
              Originally posted by Everynone View Post
              I just tested it and you can swap widgets around in a widget component just fine. Widget Component -> Set Widget. That's it, it's literally one node. Is there anything particular that should work but it does not?



              Macro tutorial? Macro is what you put inside:

              https://docs.unrealengine.com/en-us/...erGuide/Macros

              Macro for a widget component swap out would look like this:

              Click image for larger version Name:	Capture.PNG Views:	1 Size:	63.6 KB ID:	1516369

              This will essentially replace one widget with another in the same component.

              eidt: It's even easier if you spawn widgets before hand, keep them hidden and replace the widget components loadout using a stored reference - this is actually a path that I'd take. You won't have to worry about saving data in the widgets that get replaced. That's, of course, providing it's desirable.
              Ok I don't think I explained myself properly. So in the main widget I have a picture of an item. Then I have put a button over that item and in the widget graph I chose the onclick event and what I'm trying to do is when you click on that button in the widget it will change the 3d widget to another widget. Is that possible?

              Comment


                #8
                This might explain it better

                Comment


                  #9
                  Is that possible?
                  Yes, drag a wire from the Widget Component > Get User Widget > Cast To (wWindowBrowser) > Get Image > Get Brush > Set Members in SlateBrush > expose Image pin on the node

                  Comment


                    #10
                    Originally posted by Everynone View Post

                    Yes, drag a wire from the Widget Component > Get User Widget > Cast To (wWindowBrowser) > Get Image > Get Brush > Set Members in SlateBrush > expose Image pin on the node
                    Ok I think I'm almost there. Thanks for all your help so far. I've included what I can follow so far in the pic below I'm just unsure about a few things. When you say Get Image do you mean? The image that is in the other widget? because that was just an example the widget I'm trying to load has multiple images of items I want to click on and I guess because I don't know what image you mean I'm usure of what you mean by get brush and slatebrush do you mean the node called get brush in the second pic I uploaded? Also when I search for slatebrush a lot of options come back.

                    Comment


                      #11
                      When you say Get Image do you mean?
                      A reference of the image you want to change. The clicked image I presume - I do not know how your system is supposed to work so I must assume certain things.

                      Normally, if you wanted to update a widget component's image from the outside, you'd do this:

                      Click image for larger version  Name:	brush.PNG Views:	1 Size:	93.4 KB ID:	1516649

                      Judging by what you said above, your situation is different, though. You'll be updating it from the inside, by clicking on the image that needs changing, right? How does the user chooses which images appears in the clicked slot? You will need to pull the correct image from somewhere.

                      Comment


                        #12
                        Originally posted by Everynone View Post

                        A reference of the image you want to change. The clicked image I presume - I do not know how your system is supposed to work so I must assume certain things.

                        Normally, if you wanted to update a widget component's image from the outside, you'd do this:

                        Click image for larger version Name:	brush.PNG Views:	1 Size:	93.4 KB ID:	1516649

                        Judging by what you said above, your situation is different, though. You'll be updating it from the inside, by clicking on the image that needs changing, right? How does the user chooses which images appears in the clicked slot? You will need to pull the correct image from somewhere.
                        so I’m not trying to change the image but change the widget. The image that seems to appear in the slot is actually a new widget with that image already in there. So it goes like this. Widget 1 has 3 images a cup a ball and a brick. The user will click on the image of the ball which will then load up widget number 2 which has images of 5 different balls and each of them would select a new widget. I want to do this in the 1st widget itself. So I put a button over the cup another button on the brick and one last one over the ball. Then I will go into the graph for the widget. Select the button for the ball. Click onClicked for that button and from there load up a whole new widget. Is this possible?

                        Comment


                          #13
                          Everynone Do you understand what I’m trying to do? I’m not sure if I’ve explained it properly.

                          Comment


                            #14
                            so I’m not trying to change the image but change the widget.
                            So you want to replace the button + image with another widget? Kind of tricky.

                            The main problem is that your wrap box does not contain user widgets - you used a button + image. Those 2 should be wrapped in a separate widget - rather then replacing them with a new widget, you could update the existing widget. You can still do it with your setup but do not insist on replacing the wrap box' slot with another button+image or another widget. The reason is below.

                            You cannot insert objects into UMG panels the way you insert data into arrays, you can only add at the end. If you wanted to exchange image 4 out 10, you would have to clear the panel first and then repopulate the whole thing. This also requires extra sorting and keeping track of the indexes - it's not particularly difficult, but it's annoying.

                            My advice here would be to wrap the button + image combo into a separate widget and populate the wrap box with those. The user widget can then have an onClick event that pulls an image out of whenever you want and update itself.
                            This is all assuming (again) that every widget in the wrap box is of the same class.

                            Comment


                              #15
                              Originally posted by Everynone View Post

                              So you want to replace the button + image with another widget? Kind of tricky.

                              The main problem is that your wrap box does not contain user widgets - you used a button + image. Those 2 should be wrapped in a separate widget - rather then replacing them with a new widget, you could update the existing widget. You can still do it with your setup but do not insist on replacing the wrap box' slot with another button+image or another widget. The reason is below.

                              You cannot insert objects into UMG panels the way you insert data into arrays, you can only add at the end. If you wanted to exchange image 4 out 10, you would have to clear the panel first and then repopulate the whole thing. This also requires extra sorting and keeping track of the indexes - it's not particularly difficult, but it's annoying.

                              My advice here would be to wrap the button + image combo into a separate widget and populate the wrap box with those. The user widget can then have an onClick event that pulls an image out of whenever you want and update itself.
                              This is all assuming (again) that every widget in the wrap box is of the same class.
                              Ahh I can see where the misunderstanding is coming from. I’m not trying to replace the image and button with another widget. I’m trying to replace the widget with another widget. The button would just fire that event. I want it to switch it to a whole new widget entirely is that possible?

                              Comment

                              Working...
                              X