jetlag2d
    Preparing search index...

    Class ParallaxSystem

    ParallaxSystems present a set of images that seem to scroll relative to the position of the actor on whom the camera is centered.

    The speeds of layers are a very important concept.

    • 1 means "moves at same speed as hero", which means "fixed position"
    • 0 means "doesn't move", which means "looks like a tiled background"
    • in-between should be interesting
    • negative means "moves too fast"
    Index
    • Add a parallax layer to the current level

      Parameters

      • cfg: {
            anchor: { cx: number; cy: number };
            isAuto?: boolean;
            isHorizontal?: boolean;
            speed: number;
        }
        • anchor: { cx: number; cy: number }

          The position of one instance of the image. All other instances will be tiled from this point.

        • OptionalisAuto?: boolean

          Should the image scroll automatically, or in relation to the camera position?

        • OptionalisHorizontal?: boolean

          True for moving in X, false for moving in Y

        • speed: number

          Speed that the picture seems to move.

      • imageMaker: () => ImageSprite | AnimatedSprite

        Code for making each ImageSprite or AnimatedSprite

      Returns void