φ Famo.us University Famo.us/Angular Docs Help Blog Download
  • 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

TweenTransition

A state maintainer for a smooth transition between numerically-specified states. Example numeric states include floats or Transfornm objects. An initial state is set with the constructor or set(startValue). A corresponding end state and transition are set with set(endValue, transition). Subsequent calls to set(endValue, transition) begin at the last state. Calls to get(timestamp) provide the _interpolated state along the way. Note that there is no event loop here - calls to get() are the only way to find out state projected to the current (or provided) time and are the only way to trigger callbacks. Usually this kind of object would be part of the render() path of a visible component.

Overview

Options
Methods
Curve
registerCurve
unregisterCurve
getCurve
getCurves
setOptions
set
reset
getVelocity
get
update
isActive
halt

TweenTransition(options)

Constructor Parameters

options

Object

TODO beginning state

Methods

Curve()

Transition curves mapping independent variable t from domain [0,1] to a range within [0,1]. Includes functions 'linear', 'easeIn', 'easeOut', 'easeInOut', 'easeOutBounce', 'spring'.

registerCurve(curveName, curve)Static

Add "unit" curve to internal dictionary of registered curves.

Parameters
curveName
String
dictionary key
curve
UnitCurve
function of one numeric variable mapping [0,1] to range inside [0,1]
Returns
Boolean
false if key is taken, else true

unregisterCurve(curveName)Static

Remove object with key "curveName" from internal dictionary of registered curves.

Parameters
curveName
String
dictionary key
Returns
Boolean
false if key has no dictionary value

getCurve(curveName)Static

Retrieve function with key "curveName" from internal dictionary of registered curves. Default curves are defined in the TweenTransition.Curves array, where the values represent unitCurve functions.

Parameters
curveName
String
dictionary key
Returns
UnitCurve
curve function of one numeric variable mapping [0,1] to range inside [0,1]

getCurves()Static

Retrieve all available curves.

Returns
Object
curve functions of one numeric variable mapping [0,1] to range inside [0,1]

setOptions(options)

Set internal options, overriding any default options.

Parameters
options
Object
options object

set(endValue, transition, callback)

Add transition to end state to the queue of pending transitions. Special Use: calling without a transition resets the object to that state with no pending actions

Parameters
endValue
number|FamousMatrix|Array.Number|Object.<number, number>
end state to which we _interpolate
transition
Transition=
object of type {duration: number, curve: f[0,1] -> [0,1] or name}. If transition is omitted, change will be instantaneous.
callback
Function()=
Zero-argument function to call on observed completion (t=1)

reset(startValue, startVelocity)

Cancel all transitions and reset to a stable state

Parameters
startValue
number|Array.Number|Object.<number, number>
starting state
startVelocity
Number
starting velocity

getVelocity()

Get current velocity

Returns
Number
velocity

get(timestamp)

Get interpolated state of current action at provided time. If the last action has completed, invoke its callback.

Parameters
timestamp
Number=
Evaluate the curve at a normalized version of this time. If omitted, use current time. (Unix epoch time)
Returns
number|Object.<number|string, number>
beginning state _interpolated to this point in time.

update(timestamp)

Update internal state to the provided timestamp. This may invoke the last callback and begin a new action.

Parameters
timestamp
Number=
Evaluate the curve at a normalized version of this time. If omitted, use current time. (Unix epoch time)

isActive()

Is there at least one action pending completion?

Returns
Boolean

halt()

Halt transition at current state and erase all pending actions.

Branding Terms Privacy Jobs © Famous Industries, Inc. 2015