1681-engine / index / ParallaxLayerOptions
Interface: ParallaxLayerOptions ​
Defined in: src/parallax/ParallaxLayer.ts:15
Properties ​
cull? ​
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? ​
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? ​
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? ​
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? ​
optional factorY?: number;Defined in: src/parallax/ParallaxLayer.ts:26
The same vertically (default: factorX).
offsetX? ​
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? ​
optional offsetY?: number;Defined in: src/parallax/ParallaxLayer.ts:33
repeatX? ​
optional repeatX?: boolean;Defined in: src/parallax/ParallaxLayer.ts:28
Repeat the texture left and right forever (a texture layer only).
repeatY? ​
optional repeatY?: boolean;Defined in: src/parallax/ParallaxLayer.ts:30
Repeat the texture up and down forever (a texture layer only).
snap? ​
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? ​
optional speedX?: number;Defined in: src/parallax/ParallaxLayer.ts:35
Drift, world px a second, on top of the parallax (clouds).
speedY? ​
optional speedY?: number;Defined in: src/parallax/ParallaxLayer.ts:36
texture? ​
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.