Class: Tween

me. Tween

new Tween(object)

Javascript Tweening Engine

Super simple, fast and easy to use tweening engine which incorporates optimised Robert Penner's equation

https://github.com/sole/Tween.js

author sole / http://soledadpenades.com
author mr.doob / http://mrdoob.com
author Robert Eisele / http://www.xarg.org
author Philippe / http://philippe.elsass.me
author Robert Penner / http://www.robertpenner.com/easing_terms_of_use.html
author Paul Lewis / http://www.aerotwist.com/
author lechecacharro
author Josh Faul / http://jocafa.com/

Parameters:
Name Type Description
object Object object on which to apply the tween
Source:
tween.js, line 32
Example
// add a tween to change the object pos.y variable to 200 in 3 seconds
tween = new me.Tween(myObject.pos).to({y: 200}, 3000).onComplete(myFunc);
tween.easing(me.Tween.Easing.Bounce.Out);
tween.start();

Classes

Error

Members

<static, constant> Easing :enum

Easing Function :

me.Tween.Easing.Linear.None
me.Tween.Easing.Quadratic.In
me.Tween.Easing.Quadratic.Out
me.Tween.Easing.Quadratic.InOut
me.Tween.Easing.Cubic.In
me.Tween.Easing.Cubic.Out
me.Tween.Easing.Cubic.InOut
me.Tween.Easing.Quartic.In
me.Tween.Easing.Quartic.Out
me.Tween.Easing.Quartic.InOut
me.Tween.Easing.Quintic.In
me.Tween.Easing.Quintic.Out
me.Tween.Easing.Quintic.InOut
me.Tween.Easing.Sinusoidal.In
me.Tween.Easing.Sinusoidal.Out
me.Tween.Easing.Sinusoidal.InOut
me.Tween.Easing.Exponential.In
me.Tween.Easing.Exponential.Out
me.Tween.Easing.Exponential.InOut
me.Tween.Easing.Circular.In
me.Tween.Easing.Circular.Out
me.Tween.Easing.Circular.InOut
me.Tween.Easing.Elastic.In
me.Tween.Easing.Elastic.Out
me.Tween.Easing.Elastic.InOut
me.Tween.Easing.Back.In
me.Tween.Easing.Back.Out
me.Tween.Easing.Back.InOut
me.Tween.Easing.Bounce.In
me.Tween.Easing.Bounce.Out
me.Tween.Easing.Bounce.InOut

Type:
  • enum
Source:
tween.js, line 460

<static, constant> Interpolation :enum

Interpolation Function :

me.Tween.Interpolation.Linear
me.Tween.Interpolation.Bezier
me.Tween.Interpolation.CatmullRom

Type:
  • enum
Source:
tween.js, line 780

Methods

chain(chainedTween)

chain the tween
Parameters:
Name Type Description
chainedTween me.Tween Tween to be chained
Source:
tween.js, line 280

delay(amount)

delay the tween
Parameters:
Name Type Description
amount Number delay amount expressed in milliseconds
Source:
tween.js, line 208

easing(fn)

set the easing function
Parameters:
Name Type Description
fn me.Tween.Easing easing function
Source:
tween.js, line 250

interpolation(fn)

set the interpolation function
Parameters:
Name Type Description
fn me.Tween.Interpolation interpolation function
Source:
tween.js, line 266

onComplete(onCompleteCallback)

onComplete callback
Parameters:
Name Type Description
onCompleteCallback function callback
Source:
tween.js, line 322

onStart(onStartCallback)

onStart callback
Parameters:
Name Type Description
onStartCallback function callback
Source:
tween.js, line 294

onUpdate(onUpdateCallback)

onUpdate callback
Parameters:
Name Type Description
onUpdateCallback function callback
Source:
tween.js, line 308

repeat(times)

Repeat the tween
Parameters:
Name Type Description
times Number amount of times the tween should be repeated
Source:
tween.js, line 222

start()

start the tween
Source:
tween.js, line 151

stop()

stop the tween
Source:
tween.js, line 196

to(properties, duration)

object properties to be updated and duration
Parameters:
Name Type Argument Default Description
properties Object hash of properties
duration Number <optional>
1000 tween duration
Source:
tween.js, line 129

yoyo(yoyo)

allows the tween to bounce back to their original value when finished
Parameters:
Name Type Description
yoyo Boolean
Source:
tween.js, line 236