Sprite

Class used to represent a sprite

see

http://doc.babylonjs.com/babylon101/sprites

Hierarchy

  • Sprite

Index

Constructors

constructor

Find examples in Playground
  • Creates a new Sprite

    Parameters

    • name: string

      defines the name

    • manager: ISpriteManager

      defines the manager

    Returns Sprite

Properties

actionManager

Find examples in Playground
actionManager: Nullable<ActionManager>

Gets or sets the associated action manager

angle

Find examples in Playground
angle: number

Gets or sets rotation angle

animations

Find examples in Playground
animations: Animation[]

Gets the list of attached animations

cellIndex

Find examples in Playground
cellIndex: number

Gets or sets the cell index in the sprite sheet

color

Find examples in Playground
color: Color4

Gets or sets the main color

disposeWhenFinishedAnimating

Find examples in Playground
disposeWhenFinishedAnimating: boolean

Gets or sets a boolean indicating that this sprite should be disposed after animation ends

height

Find examples in Playground
height: number

Gets or sets the height

invertU

Find examples in Playground
invertU: number

Gets or sets a boolean indicating if UV coordinates should be inverted in U axis

invertV

Find examples in Playground
invertV: number

Gets or sets a boolean indicating if UV coordinates should be inverted in B axis

isPickable

Find examples in Playground
isPickable: boolean

Gets or sets a boolean indicating if the sprite can be picked

isVisible

Find examples in Playground
isVisible: boolean

Gets or sets a boolean indicating if the sprite is visible (renderable). Default is true

name

Find examples in Playground
name: string

defines the name

position

Find examples in Playground
position: Vector3

Gets or sets the current world position

size

Find examples in Playground
size: number

Gets or sets the sprite size

width

Find examples in Playground
width: number

Gets or sets the width

Methods

dispose

Find examples in Playground
  • dispose(): void
  • Release associated resources

    Returns void

playAnimation

Find examples in Playground
  • playAnimation(from: number, to: number, loop: boolean, delay: number, onAnimationEnd: function): void
  • Starts an animation

    Parameters

    • from: number

      defines the initial key

    • to: number

      defines the end key

    • loop: boolean

      defines if the animation must loop

    • delay: number

      defines the start delay (in ms)

    • onAnimationEnd: function

      defines a callback to call when animation ends

        • (): void
        • Returns void

    Returns void

stopAnimation

Find examples in Playground
  • stopAnimation(): void
  • Stops current animation (if any)

    Returns void

Generated using TypeDoc