Pixeljs

A simple and flexible HTML5 and JavaScript powered game engine.

View Project on GitHub Download Pixel.js (v0.9b)

AnimatedSprite.load Method

Loads the asset. (Overrides Asset.load.)

Parameters

Name Description
info An object containing the following properties:

  • name: the name of the SpriteSheet.
  • rows: the number of rows in the sheet.
  • frames: the number of frames in each row.
  • transparencyKey: an object containing an R, G and B value which represent the respective RGB value that should be transparent.
  • defaultFrame: the value to be assigned to the defaultFrame property.
  • speed: the value to be assigned to the speed property.
  • callback: the function to be called when the asset has finished loading.
callback Optional: the function to be called when the asset has finished loading. If a callback is provided in the info parameter and the callback parameter, the callback parameter will take presidence.

Examples

Supported Platforms

Google Chrome, Mozilla FireFox, Internet Explorer 9+, Opera, Safari.