[SOLVED] Create a drop-down menu

How do I create a drop-down menu?

Working on a managerial game, it would be very useful having a resource like this, but I can’t find any tutorial about it. Do you have any suggestion?

Thanks!

What you exactly expect?
Cause if it is just a rectangle with some text
Then that would be no different than normal menu

You create that rectangle object and simply hide it
Now if you click on where it should show you simply show it

And now you add all your options there in events with condition
Rectangle object is visible
And they only work if it is visible
Simple as that

I would recommend looking into tweens, you could tween them all on screen and off screen.

There are infinite ways to do things in Gdevelop.

You can have the menu on another layer and hide/show it. Make sure to ignore the interaction if the layer is hidden.

You could create the menu as an external layout and add or delete it when needed.

If you want to animate the opening, you could add 1 object at a time while moving the objects. You could use the object mask extension to make it more smooth looking or to keep the menu small while scrolling the objects into and out of the masked area.

Here’s an example of scrolling with a masked area.
https://forum.gdevelop.io/t/how-do-you-transfer-a-variable-value-to-another-variable-solved/51540/12?u=keith_1357

Thank you all for your replies, now I understand that there are so many ways to do something so generic and that my question was too much vague.

I’m using an external layout (since it’s a recurring menu in different points of the scene) with simple transition without any kind of animation and I’m getting used to that.

I have problems with overlapped buttons, though.

I have a first step (Choose Category event) in which I can choose between 4 categories (Physical, Attack, Defense, Development) on 4 different layer and everything works smooth using “Layer x is visible”.

My problem is in the next phase, in which I choose the ability to power-up:
all the abilities Buttons are in a Group and the “layer x is visible” should be the condition that set the active buttons BUT no matter what layer is visible, abilities in
the Physical Layer are the only clickable.


I don’t know if there are enough information to understand what’s wrong, but thank you in advance!

Do the buttons overlap? If so, you might need to disable the interactions of the hidden buttons or only add them when needed.