CLASSES
TagsA - Z

Sprite

Sprite

Description

class Sprite

Constructor

new Sprite(name, manager)

Create a new Sprite. A tutorial about sprites can be found here : https://doc.babylonjs.com/tutorials/Sprites

Parameters

Name Type Description
name string Name of the sprite
manager SpriteManager The sprite manager

Members

name : string

The sprite name

position : Vector3

The sprite position

color : Color4

The sprite color

width : number

height : number

angle : number

The sprite angle

cellIndex : number

The index of the cell

invertU : number

True if invert in U axis ; False otherwise

invertV : number

True if invert in V axis ; False otherwise

disposeWhenFinishedAnimating : boolean

True if dispose when finished animating ; False otherwise

animations : Animation[]

Animations array

isPickable : boolean

actionManager : ActionManager

size : number

The sprite size

Methods

playAnimation(from, to, loop, delay, onAnimationEnd) → void

Parameters

Name Type Description
from number Number of the first frame
to number Number of the last frame
loop boolean True : loop ; False : don't loop
delay number

stopAnimation() → void

Function to stop the sprite animation

dispose() → void