Pixeljs

A simple and flexible HTML5 and JavaScript powered game engine.

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

Sprite.load Method

Loads the asset.

Parameters

Name Description
info An object containing the following properties:

  • name: the name of the sprite to load.
  • transparencyKey: an object containing an R, G and B value which represent the respective RGB value that should be transparent.
  • 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.