Announcement

Collapse
No announcement yet.

How to make buttons appear and then re-appear via clicking on a button?

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

    How to make buttons appear and then re-appear via clicking on a button?

    I originally tried to make a combo box but after learning that there wasn't an easy way of increasing the font size of the combo box I decided that I would do a much more simplified way of making a drop down menu, that being having the player click a button which then lists buttons/options beneath aforementioned button. The problem here is that I'm not sure how to make it so when once the buttons/options are listed after being clicked, how would I go about making it so if the button is clicked again the buttons/options are then hidden again? I assume a looping node comes into this or something to do with a repeating node, but I'm just not sure how to do pull this off.

    The image below is how I'm designing the simplified drop down menu (it doesn't look great, does it?)
    Click image for larger version

Name:	586b77f027.png
Views:	1
Size:	182.8 KB
ID:	1165527
    And the image below here is the nodes I have used so far. I'm sorry if it looks a bit messy, I couldn't find a node that would let me connect all those blue nodes to it like you can with the Branch node.
    Click image for larger version

Name:	46f3eed292.png
Views:	1
Size:	266.1 KB
ID:	1165528

    Any help would be greatly appreciated.

    #2
    You should be able to loop through all of the children by using a for each loop with 'Get Num Children' - 1. As for making them hide after the 2nd click, why not just use a 'Flip Flop' node?
    Marketplace Assets

    Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
    Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
    Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

    Comment


      #3
      Originally posted by Jamendxman3 View Post
      You should be able to loop through all of the children by using a for each loop with 'Get Num Children' - 1. As for making them hide after the 2nd click, why not just use a 'Flip Flop' node?
      Sorry if I sound a bit inexperienced (I'm still learning after all) but what exactly is a flip flop node and how does it work?

      Comment


        #4
        Its a macro node that "flips" between output A and B each time it's called.

        https://docs.unrealengine.com/latest....html#flipflop

        It works well for toggling things, on the same execution. So you could flip between setting visible and setting hidden

        Comment


          #5
          Originally posted by Mosel3y View Post
          Its a macro node that "flips" between output A and B each time it's called.

          https://docs.unrealengine.com/latest....html#flipflop

          It works well for toggling things, on the same execution. So you could flip between setting visible and setting hidden
          It took me a few minutes to wrap my head around this and on my first attempt (as seen in the pic below) I was douptfull and thought I did it wrong. Yet it worked just as I wanted it to!
          Click image for larger version

Name:	b4c767b381.jpg
Views:	1
Size:	120.7 KB
ID:	1091808
          Thank you all for the help! Now I'm just wondering if there's a better way of copy and pasting a lot of buttons and other objects at the same time as they all just pile on top of each other whenever I paste them.

          Comment


            #6
            They'll paste to wherever you are panned to in the viewport if that's what you mean. But also, they'll be selected when you paste them, so you can easily drag them away

            Comment


              #7
              Originally posted by Mosel3y View Post
              They'll paste to wherever you are panned to in the viewport if that's what you mean. But also, they'll be selected when you paste them, so you can easily drag them away
              I'm just wondering if it's possible to paste two buttons at the same time NOT on top of each other. In the picture below I tried copying the row of buttons and pasting them, but they all form on top of each other.
              Click image for larger version

Name:	3cb5a8c98c.png
Views:	1
Size:	34.4 KB
ID:	1091817

              Comment


                #8
                Ah sorry, I thought you meant blueprints ha. Select them in the list copy them, then paste them into something that can contain them, like a vertical box. If you just paste things on the canvas they will be messed up, it will onyl work well if you paste into a widget that makes sense. Pasting a border into the canvas for example, you'll have to correct the size and position and all.

                Comment


                  #9
                  Originally posted by Mosel3y View Post
                  Ah sorry, I thought you meant blueprints ha. Select them in the list copy them, then paste them into something that can contain them, like a vertical box. If you just paste things on the canvas they will be messed up, it will onyl work well if you paste into a widget that makes sense. Pasting a border into the canvas for example, you'll have to correct the size and position and all.
                  Oh okay, I've just brought out a vertical box and I'll be honest I've never used this thing before. The effects are interesting...I wonder what else I could do with these panel objects/tools.

                  Comment


                    #10
                    Just set the visibility of the parent instead of all the children.

                    Comment

                    Working...
                    X