0
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ How have you tried to do this so far? \$\endgroup\$
    – DMGregory
    Jan 7, 2020 at 0:18
  • \$\begingroup\$ 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. \$\endgroup\$
    – mike west
    Jan 7, 2020 at 0:24

1 Answer 1

2
\$\begingroup\$

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.

enter image description here

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()

enter image description here

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

enter image description here

enter image description here

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.

\$\endgroup\$
1
  • \$\begingroup\$ I eventually settled on having the ui elements off screen and swapping them as needed, but this was still very helpful so thank you. \$\endgroup\$
    – mike west
    Jan 7, 2020 at 5:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .