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