Designed to provide utility related to Bitmaps.
bitmapFromTexture
texture
scale
Creates a faux Bitmap from a TextureAtlas entry.
texture
Texture
The texture from a TextureAtlas to create the Bitmap analogue from.
scale
Number
A scale for the spritesheet to undo, e.g. a half sized spritesheet gets a scale of 2 to restore it to normal size.
loadSpriteSheet
spritesheetData
spritesheetImage
[scale=1]
[libName='lib']
Replaces Bitmaps in the global lib dictionary with a faux Bitmap that pulls the image from a spritesheet. This function should be called after you have loaded up javascript assets exported from Flash, but before you have instantiated those assets.
spritesheetData
Object
The JSON object describing the frames in the atlas. This is expected to fit the JSON Hash format as exported from TexturePacker.
spritesheetImage
Image | HTMLCanvasElement
The spritesheet image that contains all of the frames.
[scale=1]
Number
optional
The scale to apply to all sprites from the spritesheet. For example, a half sized spritesheet should have a scale of 2.
[libName='lib']
String
optional
The global dictionary to add items to.