- core
- Context
- ElementAllocator
- ElementOutput
- Engine
- Entity
- EventEmitter
- EventHandler
- Group
- Modifier
- OptionsManager
- RenderNode
- Scene
- SpecParser
- Surface
- 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
- Collision
- Constraint
- Curve
- Distance
- Snap
- Surface
- 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
Surface
A base class for viewable content and event targets inside a Famo.us application, containing a renderable document fragment. Like an HTML div, it can accept internal markup, properties, classes, and handle events.
Overview
Options
Methods
Surface(options)
Constructor Parameters
options
Object
default option overrides
Methods
setAttributes(attributes)
Set HTML attributes on this Surface. Note that this will cause dirtying and thus re-rendering, even if values do not change.
Parameters
getAttributes()
Get HTML attributes on this Surface.
Returns
setProperties(properties)
Set CSS-style properties on this Surface. Note that this will cause dirtying and thus re-rendering, even if values do not change.
Parameters
getProperties()
Get CSS-style properties on this Surface.
Returns
addClass(className)
Add CSS-style class to the list of classes on this Surface. Note this will map directly to the HTML property of the actual corresponding rendered <div>.
Parameters
removeClass(className)
Remove CSS-style class from the list of classes on this Surface. Note this will map directly to the HTML property of the actual corresponding rendered <div>.
Parameters
toggleClass(className)
Toggle CSS-style class from the list of classes on this Surface. Note this will map directly to the HTML property of the actual corresponding rendered <div>.
Parameters
setClasses(classList)
Reset class list to provided dictionary.
Parameters
getClasslist()
Get array of CSS-style classes attached to this div.
Returns
setContent(content)
Set or overwrite inner (HTML) content of this surface. Note that this causes a re-rendering if the content has changed.
Parameters
getContent()
Return inner (HTML) content of this surface.
Returns
setOptions(options)
Set options for this surface
Parameters
setup(allocator)Private
One-time setup for an element to be ready for commits to document.
Parameters
commit(context)Private
Apply changes from this component to the corresponding document element. This includes changes to classes, styles, size, content, opacity, origin, and matrix transforms.
Parameters
cleanup(allocator)Private
Remove all Famous-relevant attributes from a document element. This is called by SurfaceManager's detach(). This is in some sense the reverse of .deploy().
Parameters
deploy(target)Private
Place the document element that this component manages into the document.
Parameters
recall()Private
Remove any contained document content associated with this surface from the actual document.
getSize()
Get the x and y dimensions of the surface.
Returns
setSize(size)
Set x and y dimensions of the surface.