Pixeljs

A simple and flexible HTML5 and JavaScript powered game engine.

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

Asset Class

Provides the base functionality and properties required to create an entity that can be used to provide a visual representation of an Entity.

Inheritance Hierarchy

  • Asset

Properties

Name Description
loaded A boolean value indicating whether or not the asset has been loaded.

Methods

Name Description
draw An abstract method with the purpose of drawing the asset to the Layer that the owning Entity exists on.
load An abstract method with the purpose of loading the asset.
onLoad Registers the callback to be invoked when the asset has finished loading.
prepare Prepare the information required to load the asset.

Remarks

The asset class should not be directly instantiated. Instead, a class should be derived from it to provide specific functionality to that type of asset.

Supported Platforms

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

In addition to these tested browsers, the Asset class is supported by any browser that supports the HTML5 canvas.