If I have some sharing UI component at the same position for different scenes, what is the ideal solution?

For example,

I have a group of text labels, buttons, inputfield, tableview, etc for different scene. 

My requirement:

  1. Totally the same UI component numbers and types.

  2. Totally the same UI position (x, y)

  3. Totally the same size

  4. Totally the same color

for 3-4 different scenes.

What is the ideal solution to handle this case?

I guess:

  1. solution 1: put them into a sharing scene, and let the scene overlap every time?

  2. solution 2: create a new ui panel module which contains all the UI widgets, and then require it for each scene?

  3. solution 3: repeat create them one by one for each scene, a lot for repeat code?

  4. Or other elegant way?

Need your help. 

2, because you don’t state as a requirement that they DO the same thing on every scene.  that way each scene can have its own unique  instance, with all ‘standard’ stuff (position, color, etc) the same, but perhaps a few customized things as well.

As @davebollinger notes, you don’t state if these UI elements should DO the same thing for all 3-4 scenes.

If they do, then I suggest you utilize the Composer “stage” concept. Basically, this lets you insert the Composer stage into the proper z-index order of the overall Corona stage, letting you keep other elements either behind it or in front of it… and those elements will not be affected by Composer scenes or scene transitions, so it’s ideal for keeping a common UI bar/element in front of all Composer scenes.

The example on this page shows basically how to set it up:

https://docs.coronalabs.com/api/library/composer/stage.html

Brent

 Thanks davebollinger, I forgot to mention they will do the same thing.

And I still thank you for helping figure out in what situation I should choose what solution.

Have a good day. 

Thank you, I will the composer stage way.

2, because you don’t state as a requirement that they DO the same thing on every scene.  that way each scene can have its own unique  instance, with all ‘standard’ stuff (position, color, etc) the same, but perhaps a few customized things as well.

As @davebollinger notes, you don’t state if these UI elements should DO the same thing for all 3-4 scenes.

If they do, then I suggest you utilize the Composer “stage” concept. Basically, this lets you insert the Composer stage into the proper z-index order of the overall Corona stage, letting you keep other elements either behind it or in front of it… and those elements will not be affected by Composer scenes or scene transitions, so it’s ideal for keeping a common UI bar/element in front of all Composer scenes.

The example on this page shows basically how to set it up:

https://docs.coronalabs.com/api/library/composer/stage.html

Brent

 Thanks davebollinger, I forgot to mention they will do the same thing.

And I still thank you for helping figure out in what situation I should choose what solution.

Have a good day. 

Thank you, I will the composer stage way.