Animation Class
Animation class. Default settings are :
var defaults = {
duration: 400,
easing: "linear",
complete: undefined,
step: undefined
};
Constructor
Animation
-
item -
properties -
settings
Parameters:
-
itemObjecta paper.js Item instance, which will be animated.
-
propertiesObjectproperties to animate
-
settingsObject-
durationNumberDuration of the animation, in ms
-
easingString -
completeFunctionCalled when the animation is over, in
.end(). The item is passed as this, the animation as 1st argument -
stepFunctionCalled on each
.tick() -
repeatMixedfunction or true or an integer. The animation will repeat as long as function returns
true,trueorrepeat> 0, decrementing by 1 each time.
-
Item Index
Methods
Methods
_initializeSettings
-
settings
Normalizes existing values from an Animation settings argument and provides default values if needed.
Parameters:
-
settingsMixeda
settingsobject 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:
-
goToEndBool -
forceEndBoolto 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
The animated paper.Item
itemForAnimations
Object
If provided, use parentItem to use .data and .onFrame. If not, use self.item;
repeat
Mixed
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
Settings, after being normalized in _initializeSettings
startTime
Timestamp
Time when the Animation is created
stopped
Bool
True if the animation is stopped
ticker
String
If the Animation is in onFrame mode :
Identifier of the FrameMamanger callback called on every tick.
