Fundamental
Fundamental Functions
makeGraphicsWindow
makeGraphicsWindow
Creates a new graphics window.
name
type
default
description
width
*
number
-
the desired width of the animation window, in pixels
height
*
number
-
the desired height of the animation window, in pixels
canvasDomNode
*
object
-
the DOM node for the html canvas element
Returns
nothing
makeGraphicsWindow(800, 600, document.getElementById('canvas'))
runGraphics
runGraphics
Starts the animation or game running.
name
type
default
description
startFunction
*
function
-
the name of the function that initializes your new world. Takes one argument (the world)
updateFunction
*
function
-
the name of the function that updates your world for the next frame. Takes one argument (the world)
drawFunction
*
number
-
the name of the function that draws the frames of your animation. Takes one argument (the world)
Returns
nothing
runGraphics(startWorld, updateWorld, drawWorld)
endGraphics
endGraphics
Stops the animation from running.
Returns
nothing
endGraphics()
Last updated