Namespace CAAT
Defined in: CAAT.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
<static> |
Acceleration data.
|
<static> |
CAAT.ALT_KEY
Alt key code
|
<static> |
When switching scenes, cache exiting scene or not.
|
<private> <static> |
CAAT.CLAMP
// do not clamp coordinates.
|
<static> |
CAAT.CONTROL_KEY
Control key code
|
<static> |
CAAT.CSS_TEXT_METRICS
Control how CAAT.Font and CAAT.TextActor control font ascent/descent values.
|
<static> |
CAAT.currentDirector
Current animated director.
|
<static> |
CAAT.DEBUG
set this variable before building CAAT.Director intances to enable debug panel.
|
<static> |
CAAT.DEBUG_DIRTYRECTS
if CAAT.Director.setClear uses CLEAR_DIRTY_RECTS, this will show them on screen.
|
<static> |
CAAT.DEBUGAABB
debug axis aligned bounding boxes.
|
<static> |
CAAT.DEBUGAABBCOLOR
Bounding boxes color.
|
<static> |
CAAT.DEBUGBB
show Bounding Boxes
|
<static> |
CAAT.DEBUGBBBCOLOR
Bounding Boxes color.
|
<static> |
CAAT.director
Registered director objects.
|
<static> |
CAAT.DRAG_THRESHOLD_X
Do not consider mouse drag gesture at least until you have dragged
DRAG_THRESHOLD_X and DRAG_THRESHOLD_Y pixels.
|
<static> |
CAAT.ENDRAF
if RAF, this value signals end of RAF.
|
<static> |
CAAT.ENTER_KEY
Enter key code
|
<static> |
CAAT.FPS
expected FPS when using setInterval animation.
|
<static> |
CAAT.FPS_REFRESH
debug panel update time.
|
<static> |
CAAT.FRAME_TIME
time to process one frame.
|
<static> |
CAAT.GLRENDER
is GLRendering enabled.
|
<static> |
CAAT.INTERVAL_ID
if setInterval, this value holds CAAT.setInterval return value.
|
<static> |
CAAT.keyListeners
Aray of Key listeners.
|
<static> |
CAAT.Keys
|
<static> |
CAAT.Module
This function defines CAAT modules, and creates Constructor Class objects.
|
<static> |
CAAT.NO_RAF
Use RAF shim instead of setInterval.
|
<static> |
CAAT.PMR
Points to Meter ratio value.
|
<static> |
CAAT.RAF
requestAnimationFrame time reference.
|
<static> |
CAAT.renderEnabled
Boolean flag to determine if CAAT.loop has already been called.
|
<static> |
time between two consecutive RAF.
|
<static> |
CAAT.rotationRate
Device motion angles.
|
<static> |
CAAT.SET_INTERVAL
time between two consecutive setInterval calls.
|
<static> |
CAAT.SHIFT_KEY
Shift key code
|
<static> <constant> |
CAAT.TOUCH_AS_MOUSE
Constant to set touch behavior as single touch, compatible with mouse.
|
<static> |
CAAT.TOUCH_AS_MULTITOUCH
Constant to set CAAT touch behavior as multitouch.
|
<static> |
CAAT.TOUCH_BEHAVIOR
Set CAAT touch behavior as single or multi touch.
|
<static> |
Array of window resize listeners.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
CAAT.enableBox2DDebug(set, director, world, scale)
(As Eemeli Kelokorpi suggested)
Enable Box2D debug renderer.
|
<static> |
CAAT.enableDeviceMotion()
Enable device motion events.
|
<static> |
CAAT.endLoop()
Stop animation loop.
|
<static> |
CAAT.getCurrentScene()
Return current scene.
|
<static> |
CAAT.getCurrentSceneTime()
Return current director's current scene's time.
|
<static> |
CAAT.log()
Log function which deals with window's Console object.
|
<static> |
CAAT.loop(fps)
Main animation loop entry point.
|
<static> |
CAAT.RegisterDirector(director)
Register and keep track of every CAAT.Director instance in the document.
|
<static> |
CAAT.registerKeyListener(f)
Register a function callback as key listener.
|
<static> |
CAAT.registerResizeListener(f)
Register a function callback as window resize listener.
|
<static> |
CAAT.renderFrameRAF(now)
|
<static> |
CAAT.setCoordinateClamping(clamp)
This function makes the system obey decimal point calculations for actor's position, size, etc.
|
<static> |
CAAT.setCursor(cursor)
Set the cursor.
|
<static> |
CAAT.unregisterResizeListener(director)
Remove a function callback as window resize listener.
|
Field Detail
<static>
CAAT.accelerationIncludingGravity
Acceleration data.
Defined in: Input.js.
Defined in: Input.js.
<static>
CAAT.ALT_KEY
Alt key code
Defined in: KeyEvent.js.
Defined in: KeyEvent.js.
<static>
CAAT.CACHE_SCENE_ON_CHANGE
When switching scenes, cache exiting scene or not. Set before building director instance.
Defined in: Constants.js.
Defined in: Constants.js.
<private> <static>
CAAT.CLAMP
// do not clamp coordinates. speeds things up in older browsers.
Defined in: Constants.js.
Defined in: Constants.js.
<static>
CAAT.CONTROL_KEY
Control key code
Defined in: KeyEvent.js.
Defined in: KeyEvent.js.
<static>
CAAT.CSS_TEXT_METRICS
Control how CAAT.Font and CAAT.TextActor control font ascent/descent values.
0 means it will guess values from a font height
1 means it will try to use css to get accurate ascent/descent values and fall back to the previous method
in case it couldn't.
Defined in: Constants.js.
Defined in: Constants.js.
<static>
CAAT.currentDirector
Current animated director.
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
<static>
CAAT.DEBUG
set this variable before building CAAT.Director intances to enable debug panel.
Defined in: Constants.js.
Defined in: Constants.js.
<static>
CAAT.DEBUG_DIRTYRECTS
if CAAT.Director.setClear uses CLEAR_DIRTY_RECTS, this will show them on screen.
Defined in: Constants.js.
Defined in: Constants.js.
<static>
CAAT.DEBUGAABB
debug axis aligned bounding boxes.
Defined in: Constants.js.
Defined in: Constants.js.
<static>
CAAT.DEBUGAABBCOLOR
Bounding boxes color.
Defined in: Constants.js.
Defined in: Constants.js.
<static>
CAAT.DEBUGBB
show Bounding Boxes
Defined in: Constants.js.
Defined in: Constants.js.
<static>
CAAT.DEBUGBBBCOLOR
Bounding Boxes color.
Defined in: Constants.js.
Defined in: Constants.js.
<static>
CAAT.director
Registered director objects.
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
<static>
CAAT.DRAG_THRESHOLD_X
Do not consider mouse drag gesture at least until you have dragged
DRAG_THRESHOLD_X and DRAG_THRESHOLD_Y pixels.
This is suitable for tablets, where just by touching, drag events are delivered.
Defined in: Constants.js.
Defined in: Constants.js.
<static>
CAAT.ENDRAF
if RAF, this value signals end of RAF.
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
<static>
CAAT.ENTER_KEY
Enter key code
Defined in: KeyEvent.js.
Defined in: KeyEvent.js.
<static>
CAAT.FPS
expected FPS when using setInterval animation.
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
<static>
CAAT.FPS_REFRESH
debug panel update time.
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
<static>
CAAT.FRAME_TIME
time to process one frame.
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
<static>
CAAT.GLRENDER
is GLRendering enabled.
Defined in: Constants.js.
Defined in: Constants.js.
<static>
CAAT.INTERVAL_ID
if setInterval, this value holds CAAT.setInterval return value.
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
<static>
CAAT.keyListeners
Aray of Key listeners.
Defined in: Input.js.
Defined in: Input.js.
<static>
CAAT.Keys
Defined in: KeyEvent.js.
<static>
CAAT.Module
This function defines CAAT modules, and creates Constructor Class objects.
obj parameter has the following structure:
{
defines{string}, // class name
depends{Array=}, // dependencies class names
extendsClass{string}, // class to extend from
extensdWith{object}, // actual prototype to extend
aliases{Array} // other class names
}
Defined in: ModuleManager.js.
Defined in: ModuleManager.js.
<static>
CAAT.NO_RAF
Use RAF shim instead of setInterval. Set to != 0 to use setInterval.
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
<static>
CAAT.PMR
Points to Meter ratio value.
Defined in: B2DBodyActor.js.
Defined in: B2DBodyActor.js.
<static>
CAAT.RAF
requestAnimationFrame time reference.
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
<static>
CAAT.renderEnabled
Boolean flag to determine if CAAT.loop has already been called.
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
<static>
CAAT.REQUEST_ANIMATION_FRAME_TIME
time between two consecutive RAF. usually bigger than FRAME_TIME
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
<static>
CAAT.rotationRate
Device motion angles.
Defined in: Input.js.
Defined in: Input.js.
<static>
CAAT.SET_INTERVAL
time between two consecutive setInterval calls.
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
<static>
CAAT.SHIFT_KEY
Shift key code
Defined in: KeyEvent.js.
Defined in: KeyEvent.js.
<static> <constant>
CAAT.TOUCH_AS_MOUSE
Constant to set touch behavior as single touch, compatible with mouse.
Defined in: Input.js.
Defined in: Input.js.
<static>
CAAT.TOUCH_AS_MULTITOUCH
Constant to set CAAT touch behavior as multitouch.
Defined in: Input.js.
Defined in: Input.js.
<static>
CAAT.TOUCH_BEHAVIOR
Set CAAT touch behavior as single or multi touch.
Defined in: Input.js.
Defined in: Input.js.
<static>
CAAT.windowResizeListeners
Array of window resize listeners.
Defined in: Input.js.
Defined in: Input.js.
Method Detail
<static>
CAAT.enableBox2DDebug(set, director, world, scale)
(As Eemeli Kelokorpi suggested)
Enable Box2D debug renderer.
Defined in: B2DBodyActor.js.
Defined in: B2DBodyActor.js.
- Parameters:
- set
- {boolean} enable or disable
- director
- {CAAT.Foundation.Director}
- world
- {object} box2d world
- scale
- {numner} a scale value.
<static>
CAAT.enableDeviceMotion()
Enable device motion events.
This function does not register a callback, instear it sets
CAAT.rotationRate and CAAt.accelerationIncludingGravity values.
Defined in: Input.js.
Defined in: Input.js.
<static>
CAAT.endLoop()
Stop animation loop.
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
<static>
{CAAT.Foundation.Scene}
CAAT.getCurrentScene()
Return current scene.
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
- Returns:
- {CAAT.Foundation.Scene}
<static>
{number}
CAAT.getCurrentSceneTime()
Return current director's current scene's time.
The way to go should be keep local scene references, but anyway, this function is always handy.
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
- Returns:
- {number} current scene's virtual time.
<static>
CAAT.log()
Log function which deals with window's Console object.
Defined in: Constants.js.
Defined in: Constants.js.
<static>
CAAT.loop(fps)
Main animation loop entry point.
Must called only once, or only after endLoop.
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
- Parameters:
- fps
- {number} desired fps. fps parameter will only be used if CAAT.NO_RAF is specified, that is switch from RequestAnimationFrame to setInterval for animation loop.
<static>
CAAT.RegisterDirector(director)
Register and keep track of every CAAT.Director instance in the document.
Defined in: AnimationLoop.js.
Defined in: AnimationLoop.js.
- Parameters:
- director
<static>
CAAT.registerKeyListener(f)
Register a function callback as key listener.
Defined in: Input.js.
Defined in: Input.js.
- Parameters:
- f
<static>
CAAT.registerResizeListener(f)
Register a function callback as window resize listener.
Defined in: Input.js.
Defined in: Input.js.
- Parameters:
- f
<static>
CAAT.renderFrameRAF(now)
Defined in: AnimationLoop.js.
- Parameters:
- now
<static>
CAAT.setCoordinateClamping(clamp)
This function makes the system obey decimal point calculations for actor's position, size, etc.
This may speed things up in some browsers, but at the cost of affecting visuals (like in rotating
objects).
Latest Chrome (20+) is not affected by this.
Default CAAT.Matrix try to speed things up.
Defined in: Constants.js.
Defined in: Constants.js.
- Parameters:
- clamp
- {boolean}
<static>
CAAT.setCursor(cursor)
Set the cursor.
Defined in: Input.js.
Defined in: Input.js.
- Parameters:
- cursor
<static>
CAAT.unregisterResizeListener(director)
Remove a function callback as window resize listener.
Defined in: Input.js.
Defined in: Input.js.
- Parameters:
- director