# new Animator(target, loop, getter, setter, interpolater)
- Source:
Animator object can only be created by Animation.prototype.animate method. After created, we can use clay.animation.Animator#when to add all keyframes and clay.animation.Animator#start it. Clips will be automatically created and added to the animation instance which created this deferred object.
Parameters:
Name | Type | Description |
---|---|---|
target |
Object | |
loop |
boolean | |
getter |
function | |
setter |
function | |
interpolater |
function |
Methods
# delay(time) → {clay.animation.Animator}
- Source:
Delay given milliseconds
Parameters:
Name | Type | Description |
---|---|---|
time |
number |
Returns:
# done(func) → {clay.animation.Animator}
- Source:
Callback after animation finished
Parameters:
Name | Type | Description |
---|---|---|
func |
function |
Returns:
# during(callback) → {clay.animation.Animator}
- Source:
callback when running animation
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | callback have two args, animating target and current percent |
Returns:
# getClips() → {Array.<clay.animation.Clip>}
- Source:
Get all clips created in start method.
Returns:
- Type
- Array.<clay.animation.Clip>
# start(easing) → {clay.animation.Animator}
- Source:
Start the animation
Parameters:
Name | Type | Description |
---|---|---|
easing |
string | function |
Returns:
# stop()
- Source:
Stop the animation
# then(time, props, easingopt) → {clay.animation.Animator}
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
time |
number | During time since last keyframe |
|
props |
Object | A key-value object. Value can be number, 1d and 2d array |
|
easing |
string | function |
<optional> |
Returns:
# when(time, props, easingopt) → {clay.animation.Animator}
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
time |
number | Keyframe time using millisecond |
|
props |
Object | A key-value object. Value can be number, 1d and 2d array |
|
easing |
string | function |
<optional> |