Class Index | File Index

Classes


Class bHive


Version all.

Defined in: bHive-1.0.7.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
bHive(construct)
Creates a new bHive instance
Method Summary
Method Attributes Method Name and Description
 
addEventListener(sEvent, fCallback)
Attach an event listener to the canvas object for global user interaction
 
clone(source_object)
Clones a passed bHive object
 
createBitmap(construct)
Creates a bHive Bitmap object
 
createClip(construct)
Creates a bHive Clip object
 
createGradient(construct)
Creates a bHive Gradient object
 
createLine(construct)
Creates a bHive Line object
 
createShape(construct)
Creates a bHive Shape object
 
createSound(construct)
Creates a bHive Audio object
 
createSprite(construct)
Creates a bHive Sprite object
 
createText(construct)
Creates a bHive Text object
 
createVideo(construct)
Creates a bHive Video object
 
Returns Frames Per Second (FPS) that bHive is running at, handy for speed issues.
 
Returns the frame number that the bHive loop has reached.
 
Returns the current rate at which bHive is calling the setInterval method, default is 33.
 
Returns the timestamp in milliseconds since bHive was created.
 
include(scriptSrc)
Includes an external JavaScript file
 
Changes the Global Composite Operational mode of the canvas object.
 
Updates the background color of the canvas element to be color
 
Updates the dimensions of the canvas object to be iW, iH
 
sizeof(ary)
Calculates size of an associative Array
 
theLoop(callback)
Acts in a similar way to the <body onload=".
 
trigger(sFunc, interval, isTime)
Add a timed function to the queue for processing
 
Tween(obj, prop, begin, finish, duration, isTime)
Creates a tween over a period of time or frames to affect the property of an object.
Class Detail
bHive(construct)
Creates a new bHive instance
Parameters:
{Object} construct
Constructor object used to build the bHive runtime
{Integer} construct.width
Width of the canvas in pixels
{Integer} construct.height
Height of the canvas in pixels
{String} construct.domobject
String identifier of the DOM holder object
{String} construct.backgroundColor Optional
Hex colour string for the background color of the canvas object
Method Detail
addEventListener(sEvent, fCallback)
Attach an event listener to the canvas object for global user interaction
Parameters:
{String} sEvent
The event to bind to
{Function} fCallback
The function to call when the event is fired

{Object} clone(source_object)
Clones a passed bHive object
Parameters:
{Object} source_object
Source object reference
Returns:
{Object} New cloned object based on source_object

{Object} createBitmap(construct)
Creates a bHive Bitmap object
Parameters:
{Object} construct
for bHive.Bitmap class
Returns:
{Object} bHive Bitmap object

{Object} createClip(construct)
Creates a bHive Clip object
Parameters:
{Object} construct
for bHive.Clip class
Returns:
{Object} bHive Clip object

{Object} createGradient(construct)
Creates a bHive Gradient object
Parameters:
{Object} construct
for bHive.Gradient class
Returns:
{Object} bHive Gradient object

{Object} createLine(construct)
Creates a bHive Line object
Parameters:
{Object} construct
for bHive.Line class
Returns:
{Object} bHive Line object

{Object} createShape(construct)
Creates a bHive Shape object
Parameters:
{Object} construct
for bHive.Shape class
Returns:
{Object} bHive Shape object

{Object} createSound(construct)
Creates a bHive Audio object
Parameters:
{Object} construct
for bHive.Audio class
Returns:
{Object} bHive Audio object

{Object} createSprite(construct)
Creates a bHive Sprite object
Parameters:
{Object} construct
for bHive.Sprite class
Returns:
{Object} bHive Sprite object

{Object} createText(construct)
Creates a bHive Text object
Parameters:
{Object} construct
for bHive.Text class
Returns:
{Object} bHive Text object

{Object} createVideo(construct)
Creates a bHive Video object
Parameters:
{Object} construct
for bHive.Video class
Returns:
{Object} bHive Video object

{Int} getFPS()
Returns Frames Per Second (FPS) that bHive is running at, handy for speed issues.
Returns:
{Int}

{Int} getFrame()
Returns the frame number that the bHive loop has reached.
Returns:
{Int}

{Int} getFrameRate()
Returns the current rate at which bHive is calling the setInterval method, default is 33.
Returns:
{Int}

{Timestamp} getSystemTime()
Returns the timestamp in milliseconds since bHive was created.
Returns:
{Timestamp} Javascript timestamp from Date object method Date.getTime()

include(scriptSrc)
Includes an external JavaScript file
Parameters:
{String} scriptSrc
Path to JavaScript file

setGlobalComposite(mode)
Changes the Global Composite Operational mode of the canvas object.
Parameters:
{String} mode
Global composite canvas string

setStageColor(color)
Updates the background color of the canvas element to be color
Parameters:
{String} color
HTML formatted color string

setStageDimensions(iW, iH)
Updates the dimensions of the canvas object to be iW, iH
Parameters:
{Int} iW
Width in pixels
{Int} iH
Height in pixels

{Int} sizeof(ary)
Calculates size of an associative Array
Parameters:
{Array} ary
Returns:
{Int} Size of array

theLoop(callback)
Acts in a similar way to the <body onload="...". Attaches a user function to bHive which is called every loop
Parameters:
{Function} callback
Reference to a user created function

{Int} trigger(sFunc, interval, isTime)
Add a timed function to the queue for processing
Parameters:
sFunc
interval
isTime
Returns:
{Int}

{Object} Tween(obj, prop, begin, finish, duration, isTime)
Creates a tween over a period of time or frames to affect the property of an object.
Parameters:
{Object} obj
Source bHive object
{String} prop
Property you want to tween
{Int} begin
Starting value of the tween
{Int} finish
End value of the tween
{Int} duration
Duration of the tween
{Boolean} isTime
If set to true (default) then tween to assumes duration is in seconds, false uses frames.
Returns:
{Object} Tween object

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