Documentation - v19.16.0-dev
    Preparing search index...

    A sprite of a SpriteController, as addSprites returns it and its hits give it back (SpriteHit.sprite): reads and changes its sprite in the controller, which holds it (no state of its own). Removed (removeSprites, clear), it is no longer isValid: its setters do nothing, its getters throw.

    Index

    Properties

    owner: unknown = null

    The application's object for this sprite, free (e.g. its marker): set it when the sprite is added, read it back from a hit. Cleared when the sprite is removed.

    Accessors

    • get ignoreCuttingPlanes(): boolean

      Whether it is left whole by the scene's cutting planes, as a mesh (MeshProxy).

      Returns boolean

    • set ignoreCuttingPlanes(ignore: boolean): void

      Parameters

      • ignore: boolean

      Returns void

    • get imageKey(): string

      The key of its image.

      Returns string

    • get isValid(): boolean

      Whether its sprite is still in the controller.

      Returns boolean

    • get layer(): MeshLayer

      The layer it is drawn in (see MeshLayer).

      Returns MeshLayer

    • set layer(layer: MeshLayer): void

      Parameters

      Returns void

    • get opacity(): number

      Its opacity, in 0..1 (its image still alpha-tested): drawn transparent below the scene's settings.meshes.opaqueAbove, as the parts.

      Returns number

    • set opacity(opacity: number): void

      Parameters

      • opacity: number

      Returns void

    • get visible(): boolean

      Whether it is drawn.

      Returns boolean

    • set visible(visible: boolean): void

      Parameters

      • visible: boolean

      Returns void

    Methods

    • Its world bounds, whatever the camera: its centre, plus half its diagonal on each axis, written to target.

      Parameters

      • target: Box3

      Returns Box3

    • The size of its image, in pixels, as given (width, height), written to target.

      Parameters

      • target: Vector2

      Returns Vector2

    • World position of its centre, written to target.

      Parameters

      • target: Vector3

      Returns Vector3

    • Its size (width, height), in world units, written to target.

      Parameters

      • target: Vector2

      Returns Vector2

    • Replaces its image: the previous one freed with its last sprite.

      Parameters

      Returns void

    • Moves its centre to position, world frame.

      Parameters

      • position: Vector3

      Returns void

    • Sets its size, in world units.

      Parameters

      • width: number
      • height: number

      Returns void