Class Index | File Index

Classes


Class bHive.Bitmap


Version all.

Defined in: bHive-1.0.7.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
bHive.Bitmap(construct, parentObject)
Creates a new bHive.Bitmap instance
Method Summary
Method Attributes Method Name and Description
 
addEventListener(sEvent, fCallback)
Adds an event listener to the Bitmpa object
 
addTile(ident, sx, sy, sWidth, sHeight)
Saves a portion of the bitmap to the tiles array for use later
 
Removes and event listener from the object
 
draw(parentX, parentY)
Draws object to canvas
 
drawTile(ident, dx, dy, dWidth, dHeight)
Recalls a saved tile and displays it on the canvas at position dx,dy.
 
slice(sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight)
Displays a portion of the bitmap onto the canvas
Class Detail
bHive.Bitmap(construct, parentObject)
Creates a new bHive.Bitmap instance
Parameters:
construct
parentObject
Method Detail
addEventListener(sEvent, fCallback)
Adds an event listener to the Bitmpa object
Bitmap = engine.createBitmap({constructor});Bitmap.addEventListener('oncomplete', myFunction);
Parameters:
{String} sEvent
Name of event
{Function} fCallback
Function to call when event is fired

addTile(ident, sx, sy, sWidth, sHeight)
Saves a portion of the bitmap to the tiles array for use later
Parameters:
{String} ident
string name to identify the tile
{Int} sx
X co-ordinate of first point
{Int} sy
Y co-ordinate of first point
{Int} sWidth
Width of the slice
{Int} sHeight
Height of the slice

deleteEventListener(sEvent)
Removes and event listener from the object
Bitmap = engine.createBitmap({constructor});Bitmap.addEventListener('oncomplete', myFunction); Bitmap.deleteEventListener('oncomplete');
Parameters:
{String} sEvent
Name of event

draw(parentX, parentY)
Draws object to canvas
Bitmap = engine.createBitmap({constructor});Bitmap.draw();
Parameters:
{Int} parentX
{Int} parentY

drawTile(ident, dx, dy, dWidth, dHeight)
Recalls a saved tile and displays it on the canvas at position dx,dy. You can optionally scale the tile to suit.
Parameters:
{String} ident
string name to identify the tile
{Int} dx
X co-ordinate of destination onto canvas
{Int} dy
Y co-ordinate of destination onto canvas
{Int} dWidth
Optional value to stretch the output width
{Int} dHeight
Optional value to stretch the output height

slice(sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight)
Displays a portion of the bitmap onto the canvas
Parameters:
{Int} sx
X co-ordinate of first point
{Int} sy
Y co-ordinate of first point
{Int} sWidth
Width of the slice
{Int} sHeight
Height of the slice
{Int} dx
X co-ordinate of destination onto canvas
{Int} dy
Y co-ordinate of destination onto canvas
{Int} dWidth
Optional value to stretch the output width
{Int} dHeight
Optional value to stretch the output height

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Oct 25 2011 15:15:50 GMT+0400 (GST)