A | |
add | |
addActor, gamvas. | |
addAnimation, gamvas. | |
addOnLoad, gamvas. | |
addOnReady, gamvas. | |
addPrismaticJoint, gamvas. | |
addRevoluteJoint, gamvas. | |
addSound, gamvas. | |
addState | |
alignParticleToPath, gamvas. | |
B | |
bodyCircle, gamvas. | |
bodyPolygon, gamvas. | |
bodyRect, gamvas. | |
C | |
clearScreen, gamvas. | |
connect, gamvas. | |
copy, gamvas. | |
createBody, gamvas. | |
D | |
degToRad, gamvas.math | |
difference, gamvas. | |
distance, gamvas. | |
doCollide, gamvas. | |
done, gamvas. | |
draw | |
drawDebug, gamvas. | |
E | |
enter | |
exitEvent | |
extend, gamvas. | |
F | |
find | |
G | |
g, gamvas. | |
getActors, gamvas. | |
getCanvas, gamvas | |
getCanvasDimension, gamvas | |
getCanvasPosition, gamvas | |
getClipRect, gamvas. | |
getContext2D, gamvas | |
getCurrentAnimation, gamvas. | |
getCurrentState | |
getFPS, gamvas. | |
getGlobalTimeScale, gamvas. | |
getImage, gamvas. | |
getLastFrameLength, gamvas. | |
getMilliseconds, gamvas. | |
getParticleRate, gamvas. | |
getPosition | |
getSeconds, gamvas. | |
getSound, gamvas. | |
getState, gamvas. | |
getValue, gamvas. | |
getWorld, gamvas. | |
getX, gamvas. | |
getY, gamvas. | |
H | |
h, gamvas. | |
hasFullScreen, gamvas | |
hasMultiTouch, gamvas | |
hasOrientation, gamvas |
Add a gamvas.AStarNode to the node system
add: function( n )
Returns a new vector adding vector v to the current vector
gamvas.Vector2D.prototype.add = function( v )
Add a gamvas.Actor to the state.
addActor: function( act )
Adds a animation
addAnimation: function( anim )
Add a function to be called when the HTML document is loaded
addOnLoad: function( fnc )
Add a function to be called when gamvas is ready and right before rendering the first frame.
addOnReady: function( fnc )
Add a Box2D prismatic joint between this actor and another
addPrismaticJoint: function( t, tp, tv, params )
Add a Box2D revolute joint between this actor and another
addRevoluteJoint: function( t, tp, params )
Add a gamvas.Sound to the state.
addSound: function( snd )
Adds a actor state
addState: function( state, activate )
Add a state to the state system
addState: function( state )
If true, align particle orientation along their movement
alignParticleToPath: function( yesno )
make the actor a physics object with a circle as body shape
bodyCircle: function( x, y, radius, type )
make the actor a physics object with a non rectangular polygon shape If you just need a rectangle, there is a shortcut: gamvas.actor.bodyRect
bodyPolygon: function( x, y, polys, cx, cy, type )
make the actor a physics object with a rectangular body shape
bodyRect: function( x, y, width, height, type )
Clears the screen.
clearScreen: function()
Connect two nodes
connect: function( n, auto )
Returns a copy of the vector
gamvas.Vector2D.prototype.copy = function()
Create a Box2D b2Body object for the actor.
createBody: function( type, shape )
Convert a angle in degrees to a angle in radians
degToRad: function( deg )
Returns a new vector holding the difference between vector v and the current vector
gamvas.Vector2D.prototype.difference = function( v )
Returns the distance between the current vector and vector v
gamvas.Vector2D.prototype.distance = function( v )
This function is called to check of two objects should collide.
doCollide: function( a, c, om )
Are all resources loaded?
gamvas.Resource.prototype.done = function()
Gets called when the actor is drawn.
draw: function( t )
Gets called when the state should draw.
draw: function( t )
Draw the animation according to its position, rotation and scale settings
draw: function( t )
draws the image, using its position, rotation and scale information
this.draw = function()
Draw the particle emitter
draw: function( t )
Overwrite this function to draw your game objects.
draw: function( t )
Draw the physics debug information.
drawDebug: function()
Gets called when the state is entered.
enter: function()
The enter function is called when the state is entered.
enter: function()
return from a unhandled keypress on onKey* functions
exitEvent: function()
return from a unhandled mouseevent on onMouse* functions
exitEvent: function()
Find a path between two positions in the grid
find: function( xs, ys, xe, ye )
Find a path between two points in 2D space, or two gamvas.AStarNode elements
find: function( nxs, nys, xe, ye )
The path cost function, should return a value that represents how hard it is to reach the current node
g: function( n )
returns all the actors added with gamvas.State.addActor as array, sorted by their gamvas.Actor.layer
getActors: function()
Get the canvas element
getCanvas: function()
Get the width and height of the canvas
getCanvasDimension: function()
Get the position in DOM of the current canvas
getCanvasPosition: function()
Gets the clipping rectangle of a image as gamvas.Rect
this.getClipRect = function()
Get the 2D context object of the canvas
getContext2D: function()
Get the current gamvas.Animation object that is playing
getCurrentAnimation: function()
Get the current gamvas.ActorState the actor is in
getCurrentState: function()
Get the current state
getCurrentState: function()
Returns the current frames per second.
getFPS: function()
Returns the global timescale
getGlobalTimeScale: function()
Load a image from url
gamvas.Resource.prototype.getImage = function( url )
Returns the time elapsed since the last call to render a frame.
getLastFrameLength: function()
Get the milliseconds since gamvas was started.
getMilliseconds: function()
Get the current particle emission rate
getParticleRate: function()
Gets the position of a DOM element
getPosition: function( el )
Returns the position of the mouse as gamvas.Vector2D
getPosition: function( ev )
Get the seconds since gamvas was started.
getSeconds: function()
Load a sound/music file from url
gamvas.Resource.prototype.getSound = function( url )
Get a certain state
getState: function( name )
Get the field value of position x,y in the grid
getValue: function( x, y )
Get the Box2D world object
getWorld: function()
Returns the x position of the mouse over the canvas.
getX: function( ev )
Returns the y position of the mouse over the canvas.
getY: function( ev )
The heuristic estimate
h: function( n, t )
Test if real fullscreen more is supported
hasFullScreen: function()
Test if device supports multi touch operations
hasMultiTouch: function()
Test if browser does support device orientation (does not mean the device actually supports it, you should always provide alternative controls for your game, if it does not support device orientation)
hasOrientation: function()