API Docs for: 0.2
Show:

Animation Class

Defined in: src/animation.js:10

Animation class. Default settings are :

    var defaults = {
         duration: 400,
         easing: "linear",
         complete: undefined,
         step: undefined
    };

Constructor

Animation

(
  • item
  • properties
  • settings
)

Defined in src/animation.js:10

Parameters:

  • item Object

    a paper.js Item instance, which will be animated.

  • properties Object

    properties to animate

  • settings Object
    • duration Number

      Duration of the animation, in ms

    • easing String
    • complete Function

      Called when the animation is over, in .end(). The item is passed as this, the animation as 1st argument

    • step Function

      Called on each .tick()

    • repeat Mixed

      function or true or an integer. The animation will repeat as long as function returns true, true or repeat > 0, decrementing by 1 each time.

Methods

_initializeSettings

(
  • settings
)
private

Normalizes existing values from an Animation settings argument and provides default values if needed.

Parameters:

  • settings Mixed

    a settings object or undefined

end

()

Called when the animations ends, naturally or using .stop(true).

stop

(
  • goToEnd
  • forceEnd
)

Interrupts the animation. If goToEnd is true, all the properties are set to their final value.

Parameters:

  • goToEnd Bool
  • forceEnd Bool

    to prevent loops

tick

()

Called on each step of the animation.

Properties

_continue

Function private

Callback used when queueing animations.

_dataIndex

Number private

Index of the animation in the item's queue.

item

Object

Defined in src/animation.js:51

The animated paper.Item

itemForAnimations

Object

Defined in src/animation.js:57

If provided, use parentItem to use .data and .onFrame. If not, use self.item;

repeat

Mixed

Defined in src/animation.js:64

Repeat parameter. If Function, the animation is repeated as long as the function returns true. If true, the animation is repeated until .end(true) is called. If repeat is an integer, the animation is repeated until repeat is <= 0. Default 0

settings

Object

Defined in src/animation.js:46

Settings, after being normalized in _initializeSettings

startTime

Timestamp

Defined in src/animation.js:40

Time when the Animation is created

stopped

Bool

Defined in src/animation.js:35

True if the animation is stopped

ticker

String

Defined in src/animation.js:98

If the Animation is in onFrame mode : Identifier of the FrameMamanger callback called on every tick.

tweens

Array

Defined in src/animation.js:93

Tweens used by the Animation.