setLayers(layers: string[], defaultLayer: string): void
Define the layer names. Should be called before any objects are made.
param
layers- The layer names.
param
defaultLayer- The default layer name.
layers(["bg", "obj", "ui"], "obj") // no layer specified, will be added to "obj" add([ sprite("bean"), ]); // add to "bg" layer add([ sprite("bg"), layer("bg"), ]);
since
v3001.1