Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ISpriteManager

Defines the minimum interface to fullfil in order to be a sprite manager.

Hierarchy

Implemented by

Index

Properties

cellHeightSearch playground for cellHeight

cellHeight: number

Defines the default height of a cell in the spritesheet

cellWidthSearch playground for cellWidth

cellWidth: number

Defines the default width of a cell in the spritesheet

isPickableSearch playground for isPickable

isPickable: boolean

Gets or sets a boolean indicating if the mesh can be picked (by scene.pick for instance or through actions). Default is true

layerMaskSearch playground for layerMask

layerMask: number

Restricts the camera to viewing objects with the same layerMask. A camera with a layerMask of 1 will render spriteManager.layerMask & camera.layerMask!== 0

nameSearch playground for name

name: string

Gets manager's name

renderingGroupIdSearch playground for renderingGroupId

renderingGroupId: number

Specifies the rendering group id for this mesh (0 by default)

see

https://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered#rendering-groups

sceneSearch playground for scene

scene: Scene

Gets the hosting scene

spritesSearch playground for sprites

sprites: Array<Sprite>

Defines the list of sprites managed by the manager.

textureSearch playground for texture

texture: Texture

Gets or sets the spritesheet texture

Methods

disposeSearch playground for dispose

  • dispose(): void
  • Releases all held resources

    Returns void

intersectsSearch playground for intersects

  • Tests the intersection of a sprite with a specific ray.

    Parameters

    • ray: Ray

      The ray we are sending to test the collision

    • camera: Camera

      The camera space we are sending rays in

    • Optional predicate: (sprite: Sprite) => boolean

      A predicate allowing excluding sprites from the list of object to test

        • Parameters

          Returns boolean

    • Optional fastCheck: boolean

      defines if the first intersection will be used (and not the closest)

    Returns Nullable<PickingInfo>

    picking info or null.

multiIntersectsSearch playground for multiIntersects

  • Intersects the sprites with a ray

    Parameters

    • ray: Ray

      defines the ray to intersect with

    • camera: Camera

      defines the current active camera

    • Optional predicate: (sprite: Sprite) => boolean

      defines a predicate used to select candidate sprites

        • Parameters

          Returns boolean

    Returns Nullable<PickingInfo[]>

    null if no hit or a PickingInfo array

renderSearch playground for render

  • render(): void
  • Renders the list of sprites on screen.

    Returns void

Legend

  • Property
  • Method
  • Constructor
  • Property
  • Static method