Skip to content

1681-engine / index / ParallaxLayerOptions

Interface: ParallaxLayerOptions ​

Defined in: src/parallax/ParallaxLayer.ts:15

Properties ​

cull? ​

ts
optional cull?: boolean;

Defined in: src/parallax/ParallaxLayer.ts:40

Hide the layer while none of it is in view (default true). Repeated layers always fill the view.


depth? ​

ts
optional depth?: number;

Defined in: src/parallax/ParallaxLayer.ts:42

Order among the parallax's layers: lower draws further back (default: the order they were added in).


display? ​

ts
optional display?: Container<ContainerChild>;

Defined in: src/parallax/ParallaxLayer.ts:22

Anything already drawn (a sprite, a Graphics, a container of them), drawn once and never repeated.


factorX? ​

ts
optional factorX?: number;

Defined in: src/parallax/ParallaxLayer.ts:24

Share of the camera's horizontal travel the layer moves on screen: 0 fixed to the screen, 1 with the world (default 0.5).


factorY? ​

ts
optional factorY?: number;

Defined in: src/parallax/ParallaxLayer.ts:26

The same vertically (default: factorX).


offsetX? ​

ts
optional offsetX?: number;

Defined in: src/parallax/ParallaxLayer.ts:32

World px added to the layer's position, e.g. where on the level a row of hills stands.


offsetY? ​

ts
optional offsetY?: number;

Defined in: src/parallax/ParallaxLayer.ts:33


repeatX? ​

ts
optional repeatX?: boolean;

Defined in: src/parallax/ParallaxLayer.ts:28

Repeat the texture left and right forever (a texture layer only).


repeatY? ​

ts
optional repeatY?: boolean;

Defined in: src/parallax/ParallaxLayer.ts:30

Repeat the texture up and down forever (a texture layer only).


snap? ​

ts
optional snap?: boolean;

Defined in: src/parallax/ParallaxLayer.ts:38

Land on whole world pixels (default: the camera's roundPixels, i.e. a pixel-perfect engine).


speedX? ​

ts
optional speedX?: number;

Defined in: src/parallax/ParallaxLayer.ts:35

Drift, world px a second, on top of the parallax (clouds).


speedY? ​

ts
optional speedY?: number;

Defined in: src/parallax/ParallaxLayer.ts:36


texture? ​

ts
optional texture?: Texture<TextureSource<any>>;

Defined in: src/parallax/ParallaxLayer.ts:20

A texture to draw, repeated along the axes repeatX / repeatY name (one tiling sprite, as wide as the view whatever the level's length). Give either this or display.

Released under the MIT License.