Download

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?)
586b77f027.png
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.
5ba54cc1f9482d1d4807ce35e3a47e9cc3595721.png

Any help would be greatly appreciated.

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?

Its a macro node that “flips” between output A and B each time it’s called.

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!
cc02dfb3550b89c18869b1f415a96041c894517c.jpeg
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.

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.
3cb5a8c98c.png

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.

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