layers(layers: string[], defaultLayer: string): void

paramlayers- The layer names.

paramdefaultLayer- The default layer name.

deprecatedUse

setLayers(["bg", "obj", "ui"], "obj")

// no layer specified, will be added to "obj"
add([
     sprite("bean"),
]);

// add to "bg" layer
add([
    sprite("bg"),
    layer("bg"),
]);

sincev3001.0