Pixeljs

A simple and flexible HTML5 and JavaScript powered game engine.

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

AnimatedSprite.draw Method

Draws the asset to the Layer that the owning Entity exists on. (Overrides Asset.draw.)

Parameters

Name Description
entity The Entity that the asset being drawn should represent.

Remarks

The Entity that is passed to the draw method is used to determine where in the scene the asset should be drawn to and also determines which layer it should be drawn to.

If an asset is present in an Entity, the draw method will be called automatically by the internal game loop; preventing a need to call it manually.

Examples

Supported Platforms

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