- 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
Context
The top-level container for a Famous-renderable piece of the document. It is directly updated by the process-wide Engine object, and manages one render tree root, which can contain other renderables.
Overview
Options
Methods
add
migrate
getSize
setSize
getPerspective
setPerspective
emit
on
removeListener
pipe
unpipe
Context(container)
Constructor Parameters
container
Node
Element in which content will be inserted
Methods
add(obj)
Add renderables to this Context's render tree.
Parameters
obj
Object
renderable object
Returns
RenderNode
RenderNode wrapping this object, if not already a RenderNode
migrate(container)
Move this Context to another containing document element.
Parameters
container
Node
Element to which content will be migrated
getSize()
Gets viewport size for Context.
Returns
Array.Number
viewport size as [width, height]
setSize(size)
Sets viewport size for Context.
Parameters
size
Array.Number
[width, height]. If unspecified, use size of root document element.
update(contextParameters)Private
Commit this Context's content changes to the document.
Parameters
contextParameters
Object
engine commit specification
getPerspective()
Get current perspective of this context in pixels.
Returns
Number
depth perspective in pixels
setPerspective(perspective, transition, callback)
Set current perspective of this context in pixels.
Parameters
perspective
Number
in pixels
transition
Object
Transitionable object for applying the change
callback
Function(Object)
function called on completion of transition
emit(type, event)
Trigger an event, sending to all downstream handlers listening for provided 'type' key.
Parameters
type
String
event type key (for example, 'click')
event
Object
event data
Returns
EventHandler
this
on(type, handler)
Bind a callback function to an event type handled by this object.
Parameters
type
String
event type key (for example, 'click')
handler
Function(string, Object)
callback
Returns
EventHandler
this
removeListener(type, handler)
Unbind an event by type and handler. This undoes the work of "on".
Parameters
type
String
event type key (for example, 'click')
handler
Function
function object to remove
Returns
EventHandler
internal event handler object (for chaining)
pipe(target)
Add event handler object to set of downstream handlers.
Parameters
target
EventHandler
event handler target object
Returns
EventHandler
passed event handler
unpipe(target)
Remove handler object from set of downstream handlers. Undoes work of "pipe".
Parameters
target
EventHandler
target handler object
Returns
EventHandler
provided target