# Is it possible to move buttons or other ui elements over each other dynamically in Godot?

What im trying to do is have it set up so that if the player clicks on a character their ability's will appear on the ui, but i want to use the same ui space for the other characters as well.

So is it possible to have multiple buttons in the same area and then depending on which character is selected only the buttons connected to that character appear?

Thank you in advance for the help.

• How have you tried to do this so far? Jan 7 '20 at 0:18
• So far playing around with disabling the buttons, but next i was thinking of having the buttons off screen and then when you click on the characters ill just have the buttons physically move. Jan 7 '20 at 0:24

To answer your question as written, yes, you can have multiple Control nodes sharing the same space, and only set one to be visible at a time.

Note that BobStats and JaneStats are sharing the same PanelContainer, but only BobStats is visible. I've wired up the following signal connections:

Button1.pressed -> BobStats.show()
Button1.pressed -> JaneStats.hide()
Button2.pressed -> BobStats.hide()
Button2.pressed -> JaneStats.show()


There's a node called a TabContainer that is specifically designed for showing one control at a time:

However, based on how you've described your question, I'm thinking you don't actually want multiple controls sharing the same space, but rather a single set of controls whose values you modify when a particular character is selected.

• I eventually settled on having the ui elements off screen and swapping them as needed, but this was still very helpful so thank you. Jan 7 '20 at 5:35