Global values » Background Layer

Background Layer

A BackgroundLayer is a normal layer, but you don’t have to set its size or position; it will always assume the size of the screen.

By default it’s white, but you can give it another color.

bg = new BackgroundLayer
    backgroundColor: "#ccc"

Regarding Stacking order: This type of layer will always have an index of -1 or lower.

One of the problems with background layers is that the layer.sendToBack() function can place a layer underneath the background layer.

It’s now recommended to set the color of the Screen instead.

Screen.backgroundColor = "#fff"