jetlag2d
    Preparing search index...

    Class ImageSprite

    ImageSprite describes any object whose visual representation is a single image that is not animated.

    Index
    • Build an image that can be rendered

      Parameters

      • cfg: {
            height: number;
            img: string | PixiSprite;
            offset?: JLOffset;
            width: number;
            z?: 0 | 1 | 2 | 4 | -4 | 3 | -3 | -2 | -1;
        }
        • height: number

          The height of the image, in meters

        • img: string | PixiSprite

          The name of the file to use as the image, or a PixiSprite

        • Optionaloffset?: JLOffset

          An offset between the component's center and its RigidBody's center (optional)

        • width: number

          The width of the image, in meters

        • Optionalz?: 0 | 1 | 2 | 4 | -4 | 3 | -3 | -2 | -1

          An optional z index in the range [-4,4]

      Returns ImageSprite

    actor?: Actor<unknown>

    The Actor to which this ImageSprite is attached

    height: number

    Height of the image

    image: Sprite

    The image to display for this actor

    offset: JLOffset

    An offset between the ImageSprite's center and the RigidBody's center

    width: number

    Width of the image

    z: -4 | -3 | -2 | -1 | 0 | 1 | 2 | 3 | 4

    Z index of the image

    • An internal method that lets us overwrite the image used by an ImageSprite with something generated directly by PIXI. This lets us turn screenshots into ImageSprites.

      Parameters

      Returns void

    • Render the image when it does not have a rigidBody. This is only used for Parallax

      Parameters

      • anchor: { cx: number; cy: number }

        The center x/y at which to draw the image

      • camera: CameraService

        The camera for the current stage

      • foreground: boolean

        Does this belong in the foreground (true) or background?

      Returns void