API Documentation for: 1.0.0
Show:

RelativePlugin Class

Defined in: RelativePlugin:38
Module: TweenJS

The RelativePlugin for TweenJS enables relative numeric values for tweens. Install using:

RelativePlugin.install();

Once installed, you can pass in relative numeric property values as strings beginning with "+" or "-". For example, the following tween would tween the x position of foo from its initial value of 200 to 50 (200-150), then to 125 (50+75).

foo.x = 200;
Tween.get(foo).to({x:"-150"}, 500).to({x:"+75"}, 500);

Constructor

RelativePlugin

()

Defined in RelativePlugin:38

Item Index

Methods

Properties

  • ID static

Methods

change

(
  • tween
  • step
  • prop
  • value
  • ratio
  • end
)
Any static

Defined in change:110

Called before a property is updated by the tween. See change for more info.

Parameters:

Returns:

Any:

init

(
  • tween
  • prop
  • value
)
Any static

Defined in init:76

Called by TweenJS when a new property initializes on a tween. See init for more info.

Parameters:

Returns:

Any:

install

() static

Defined in install:67

Installs this plugin for use with TweenJS. Call this once after TweenJS is loaded to enable this plugin.

step

(
  • tween
  • step
  • props
)
static

Defined in step:90

Called when a new step is added to a tween (ie. a new "to" action is added to a tween). See step for more info.

Parameters:

Properties

ID

String static readonly

Defined in ID:58

READ-ONLY. A unique identifying string for this plugin. Used by TweenJS to ensure duplicate plugins are not installed on a tween.