Sprite

BGE. Sprite

new Sprite(owner, canvasBitmap, spriteSheet, cellWidth, cellHeight, argsopt) → {dynamic}

Parameters:
Name Type Attributes Default Description
owner GameEntity
canvasBitmap object
spriteSheet object
cellWidth integer
cellHeight integer
args object <optional>
{}
Properties:
Name Type Description
spriteSheet object

roBitmap to pick cells from

cellWidth integer

Width of each animation cell in the sprite image in pixels

cellHeight integer

Height of each animation cell in the sprite image in pixels

animations object

Lookup map of animation name -> SpriteAnimation object

activeAnimation SpriteAnimation

The current animation being played

Source:

Extends

  • AnimatedImage

Methods

addAnimation(name, frameList, frameRate, playModeopt) → {object}

Parameters:
Name Type Attributes Default Description
name string
frameList object
frameRate integer
playMode string <optional>
"loop"
Source:

applyPreTranslation(x, y) → {void}

Apply a pre-translation to set the pivot point for the sprite cell

Parameters:
Name Type Description
x float
y float
Source:

getCellDrawIndex() → {integer}

Source:

playAnimation(animationName) → {void}

Play an animation from the set of animations in this SpriteSheet

Parameters:
Name Type Description
animationName string
Source: