jetlag2d
    Preparing search index...

    Class VideoSprite

    VideoSprite describes any object whose visual representation is achieved by playing a video.

    Index
    • Build a VideoSprite

      Parameters

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

          The height of the image, in meters

        • Optionaloffset?: JLOffset

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

        • vid: string

          The name of the video file to use

        • 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 VideoSprite

    actor?: Actor<unknown>

    The Actor to which this ImageSprite is attached

    height: number

    Height of the image

    offset: JLOffset

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

    sprite: Sprite

    The image to display for this actor

    src: string

    The name of the video file

    width: number

    Width of the image

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

    Z index of the image

    • set onEnd(callback: () => void): void

      Code to run when the video playback reaches the end. Setting this replaces any previously-set handler; only one can be registered at a time.

      Parameters

      • callback: () => void

      Returns void

    • Render the video 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

        Should this go in the foreground (true) or background (false)

      Returns void