Get the size of this bounding box as a Pt
Get height of canvas
The bounding box of the canvas
Get a boolean to indicate whether the animation is playing
Get this space's bounding box
Get the size of this bounding box as a Pt
Get width of canvas
Add an IPlayer to this space. An IPlayer can define the following callback functions:
animate( time, ftime, space )
start(bound, space)
resize( size, event )
action( type, x, y, event )
Subclasses of Space may define other callback functions.clear all contents in the space
Get a default form for drawing in this space
Pause the animation
a boolean value to set if this function call should be a toggle (between pause and resume)
Main play loop. This implements window.requestAnimationFrame and calls it recursively.
Override this play()
function to implemenet your own animation loop.
current time
Main animate function. This calls all the items to perform
current time
Play animation loop, and then stop after duration
time has passed.
a value in millisecond to specify a time period to play before stopping, or -1
to play forever
Set whether the rendering should be repainted on each frame
a boolean value to set whether to repaint each frame
Remove a player from this Space
an IPlayer that has an animateID
property
Remove all players from this Space
Custom rendering
rendering context
Replay the animation after stop()
. This resets the end-time counter.
You may also use pause()
and resume()
for temporary pause.
Resize the space
Resume the pause animation
Specify when the animation should stop: immediately, after a time period, or never stops.
a value in millisecond to specify a time period to play before stopping, or -1
to play forever, or 0
to end immediately. Default is 0 which will stop the animation immediately.
Generated using TypeDoc
Space is an abstract class that represents a general context for expressing Pts. See Space guide for details.