@moxijs/core - v0.3.4
    Preparing search index...

    Class TilingParallaxLayer

    Specialized parallax layer using PIXI.TilingSprite for efficient infinite scrolling.

    This is the recommended approach for large, repeating backgrounds like sky, clouds, or ground textures. TilingSprite is optimized for repeating patterns and uses tilePosition for seamless scrolling without repositioning the container.

    const skyLayer = new TilingParallaxLayer({
    texture: skyTexture,
    scrollScale: new PIXI.Point(0.2, 0.2)
    // width/height auto-detected from renderer
    });
    parallaxBackground.addLayer(skyLayer);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    mirroring: boolean = false
    moxiEntity: MoxiEntity<Container<ContainerChild>>

    The MoxiEntity instance managing logic for this container

    repeatSize: Point = ...
    scrollOffset: Point = ...
    scrollScale: Point = ...
    tilingSprite: TilingSprite

    Methods

    • Update TilingSprite dimensions (e.g., on window resize)

      Parameters

      • width: number
      • height: number

      Returns void

    • Override updateParallax to use tilePosition instead of container position. This provides seamless infinite scrolling without visible seams.

      Since the ParallaxBackground container now follows the camera, layers inside stay at (0,0) and only use tilePosition for the parallax scrolling effect.

      Camera scale is used to resize the TilingSprite to cover the viewport at different zoom levels.

      Parameters

      • cameraPos: Point
      • cameraScale: Point
      • backgroundOffset: Point

      Returns void