Multiple messages in the same scene

I am trying to show different messages with some buttons at the same screen location in a given scene. These messages are created on top of the Base layer at the same location and depending on my requirement I show/hide them. Something like a popup/transparent box on top of Base layer with text/buttons. This way only the message content/actions will change, not its coordinates or background.

My requirements

  • Message 1 and Message 2 are in the same layer and position.
  • Some Action 1: Message 1 is shown and its related buttons/actions activated. Message 2 is hidden and its related buttons/actions deactivated.
  • Some Action 2: Message 2 is shown and its related buttons/actions activated. Message 1 is hidden and its related buttons/actions deactivated.

I tried to achieve this by creating both messages/buttons at the same coordinates on the same layer and showing/hidding them as appropriate. However, due to the Z index of the messages and buttons, the whole setup is extremely messy. I tried Deleting messages/actions that are not required, but this will remove the message completely for the next time it is triggered.

I can create different scenes for each message/actions, but that will require user to unnecessary navigate away from the game scene. I would like to show different messages on the top of the Base Scene at different times.

Any better suggestions to achieve my goals?

it sounds like ‘external layouts’ could be useful in your case: External layouts - GDevelop documentation

There is a ‘create’-action that you can use for getting deleted objects back into your scene.

Thank you!

Also, I created an object group with all the items that are created from external layout and then deleted it once they are no longer required. The setup is working fine for me. Is that a recommended way to delete/hide objects created from “Create objects from external Layout…” action?

Good to read that you found external layouts useful.

As there is no action “delete objects from external layouts”, your solution seems to be the best way to do it.

1 Like