Creating a Common UI Across Levels

ashes999

  • Posts: 9
First, apologies if this is addressed in the Stencylpedia -- I went through the crash courses and didn't find the answer to this there.

How do I create a UI that's common across all levels, without duplicating it into each level?

Simply: if you look at Balls in Space, all rooms have the following elements right at the top:

- Room #
- Achievements button
- Mute/Menu button

How exactly did they do that?

Hectate

  • *
  • Posts: 4643
If the behavior to control GUI elements is a Scene Behavior, then you just attach it to all the scenes that require that GUI. For example, in Balls in Space the buttons are created by a behavior attached to the scene, but only the level scenes and not the main menu, etc.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

ashes999

  • Posts: 9
Ah, interesting. I'll try that out and see how it pans out; thanks.

I assume you mean, they created a behaviour which contained three buttons and the text field -- and not three separate behaviours.

I'm used to thinking in terms of "this class creates all the stuff for the level" and having UI in one place. It's a bit strange that there's no concept of a HUD or GUI in Stencyl.