- core
- Context
- ElementAllocator
- ElementOutput
- Engine
- Entity
- EventEmitter
- EventHandler
- Group
- Modifier
- OptionsManager
- RenderNode
- Scene
- SpecParser
- Transform
- View
- ViewSequence
- events
- EventArbiter
- EventFilter
- EventMapper
- inputs
- Accumulator
- GenericSync
- MouseSync
- PinchSync
- RotateSync
- ScaleSync
- ScrollSync
- TouchSync
- TouchTracker
- TwoFingerSync
- math
- Matrix
- Quaternion
- Random
- Utilities
- Vector
- modifiers
- Draggable
- Fader
- ModifierChain
- StateModifier
- physics
- PhysicsEngine
- physics/bodies
- Body
- Circle
- Particle
- Rectangle
- physics/constraints
- Surface
- Collision
- Constraint
- Curve
- Distance
- Snap
- Wall
- Walls
- physics/forces
- Drag
- Force
- Repulsion
- RotationalDrag
- RotationalSpring
- Spring
- VectorField
- physics/integrators
- SymplecticEuler
- surfaces
- CanvasSurface
- ContainerSurface
- ImageSurface
- InputSurface
- TextareaSurface
- VideoSurface
- transitions
- CachedMap
- Easing
- MultipleTransition
- SnapTransition
- SpringTransition
- Transitionable
- TransitionableTransform
- TweenTransition
- WallTransition
- utilities
- KeyCodes
- Timer
- Utility
- views
- ContextualView
- Deck
- DrawerLayout
- EdgeSwapper
- FlexibleLayout
- Flipper
- GridLayout
- HeaderFooterLayout
- Lightbox
- RenderController
- ScrollContainer
- Scroller
- Scrollview
- SequentialLayout
- widgets
- NavigationBar
- TabBar
Engine
The singleton object initiated upon process startup which manages all active Context instances, runs the render dispatch loop, and acts as a listener and dispatcher for events. All methods are therefore static. On static initialization, window.requestAnimationFrame is called with the event loop function. Note: Any window in which Engine runs will prevent default scrolling behavior on the 'touchmove' event.
Overview
Methods
Methods
step()PrivateStatic
Inside requestAnimationFrame loop, step() is called, which: calculates current FPS (throttling loop if it is over limit set in setFPSCap), emits dataless 'prerender' event on start of loop, calls in order any one-shot functions registered by nextTick on last loop, calls Context.update on all Context objects registered, and emits dataless 'postrender' event on end of loop.
initialize()PrivateStatic
Initialize famous for app mode
pipe(target)
Add event handler object to set of downstream handlers.
Parameters
Returns
unpipe(target)
Remove handler object from set of downstream handlers. Undoes work of "pipe".
Parameters
Returns
on(type, handler)Static
Bind a callback function to an event type handled by this object.
Parameters
Returns
emit(type, event)
Trigger an event, sending to all downstream handlers listening for provided 'type' key.
Parameters
Returns
removeListener(type, handler)Static
Unbind an event by type and handler. This undoes the work of "on".
Parameters
Returns
getFPS()Static
Return the current calculated frames per second of the Engine.
Returns
setFPSCap(fps)Static
Set the maximum fps at which the system should run. If internal render loop is called at a greater frequency than this FPSCap, Engine will throttle render and update until this rate is achieved.
Parameters
getOptions(key)Static
Return engine options.
Parameters
Returns
setOptions(options)Static
Set engine options
Parameters
createContext(el)Static
Creates a new Context for rendering and event handling with provided document element as top of each tree. This will be tracked by the process-wide Engine.
Parameters
Returns
registerContext(context)Static
Registers an existing context to be updated within the run loop.
Parameters
Returns
getContexts()Static
Returns a list of all contexts.
Returns
deregisterContext(context)Static
Removes a context from the run loop. Note: this does not do any cleanup.
Parameters
nextTick(fn)Static
Queue a function to be executed on the next tick of the Engine.
Parameters
defer(fn)Static
Queue a function to be executed sometime soon, at a time that is unlikely to affect frame rate.