jStage.Sprite

Description

A sprite is a means of manipulating 2D sprite sheet images, be it for animating (using jStage.Animation), or selecting individual frames.

Hierarchy

Function List

Function Documentation

Sprite(srcImage, cols, rws, frameRate, frameCount, srcX, srcY, srcW, srcH, nextSprite)constructor

Parameters

srcImage:The source image from which this sprite will be constructed.

cols:The number of columns to slice the image up into. If undefined or null, 1 is assumed.

rws:The number of rows to slice the image up into. If undefined or null, 1 is assumed.

frameRate:The target framerate, if this sprite is to be used as part of an animation. If undefined or null, 24.0 is assumed.

frameCount:The length of the animation in frames, if this sprite is to be used as part of an animation. If undefined or null, cols*rws

srcX:The X coordinate of the top-left bound of the crop rectangle used to generate the sprite sheet from the source image. If undefined or null, 0.0 is assumed.

srcY:The Y coordinate of the top-left bound of the crop rectangle used to generate the sprite sheet from the source image. If undefined or null, 0.0 is assumed.

srcW:The width of the crop rectangle used to generate the sprite sheet from the source image. If undefined or null, srcImg.width is assumed.

srcH:The height of the crop rectangle used to generate the sprite sheet from the source image. If undefined or null, srcImg.width is assumed.

nextSprite:The next sprite in the animation sequence, if this sprite is to be used as part of an animation. If undefined or null, this is assumed (looping).