- 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
SpringTransition
SpringTransition is a method of transitioning between two values (numbers, or arrays of numbers) with a bounce. The transition will overshoot the target state depending on the parameters of the transition.
Overview
Options
Methods
period
dampingRatio
velocity
reset
getVelocity
setVelocity
isActive
halt
get
set
SpringTransition(state)
Constructor Parameters
state
Number|Array
Initial state
Methods
SpringTransition.DEFAULT_OPTIONS()ProtectedStatic
period()
The amount of time in milliseconds taken for one complete oscillation when there is no damping Range : [0, Infinity]
dampingRatio()
The damping of the snap. Range : [0, 1] 0 = no damping, and the spring will oscillate forever 1 = critically damped (the spring will never oscillate)
velocity()
The initial velocity of the transition.
reset(pos, vel)
Resets the position and velocity
Parameters
pos
Number|Array.Number
positional state
vel
Number|Array
velocity
getVelocity()
Getter for velocity
Returns
Number|Array
velocity
setVelocity()
Setter for velocity
Returns
Number|Array
velocity
isActive()
Detects whether a transition is in progress
Returns
Boolean
halt()
Halt the transition
get()
Get the current position of the transition
Returns
Number|Array
state
set(endState, definition, callback)
Set the end position and transition, with optional callback on completion.
Parameters
endState
Number|Array
Final state
definition
Object
Transition definition
callback
Function
Callback