Dynamically Create Layer

Is there an action for creating layers instead of creating from scene window ?
In different scenarios we need to have same layers in every scene , like gui , parallax effect etc. And for multiple level based game it’s so painful to create every layer in every scene one by one .

Layers cannot be created via events, no.

You’re probably better off creating an empty scene with the layers you want and just duplicating it when you have a new level.

1 Like

One other option might be to use external layouts. It’s pretty common practice to use just one scene for all of your scenarios, just create a different external layout for each scenario.

At beginning of scene event, use “Load external Layout” action to bring all of the objects from that layout into the scene.

It’s also pretty common practice to have a global text variable contain the name of the external layout to initially load, and use that variable with the “Load external Layout” action. Then, when it’s time to change scenarios, change the global variable to the name of the external layout for the next scenario and use the “Change Scene” event to re-start the same scene, but since the global variable is different the scene will just clear off all the objects and load the new scenario from the next external layout.

1 Like