Class Anim
- extends Base
A class for constructing animation instances.
Properties
Bucket for custom getters and setters
The default getter to use when getting object properties.
The default setter to use when setting object properties.
The default unit to use with properties that pass the RE_DEFAULT_UNIT test.
Time in milliseconds passed to setInterval for frame processing
Default Value: 20
Regex of properties that should use the default unit.
Properties inherited from Base:
Methods
private
static
void
_runFrame
(
)
Called per Interval to handle each animation frame.
static
Array
getBezier
(
points
,
t
)
Get the current position of the animated element based on t.
Each point is an array of "x" and "y" values (0 = x, 1 = y)
At least 2 points are required (start and end).
First point is start. Last point is end.
Additional control points are optional.
- Parameters:
-
points
<Array>
An array containing Bezier points
-
t
<Number>
A number between 0 and 1 which is the basis for determining current position
- Returns:
Array
- An array containing int x and y member data
static
void
pause
(
)
Pauses all animation instances.
Chainable: This method is chainable.
static
void
run
(
)
Runs all animation instances.
Chainable: This method is chainable.
static
void
stop
(
)
Stops all animation instances.
Chainable: This method is chainable.
Methods inherited from EventTarget:
_getType,
_monitor,
_parseType,
addTarget,
after,
before,
bubble,
detach,
detachAll,
fire,
getEvent,
getTargets,
on,
once,
publish,
removeTarget,
subscribe,
unsubscribe,
unsubscribeAll
Methods inherited from Attribute:
_addAttrs,
_addLazyAttr,
_defAttrChangeFn,
_fireAttrChange,
_getAttr,
_getAttrCfg,
_getAttrInitVal,
_getAttrs,
_getStateVal,
_isLazyAttr,
_normAttrVals,
_protectAttrs,
_set,
_setAttr,
_setAttrs,
_setAttrVal,
_setStateVal,
addAttr,
addAttrs,
attrAdded,
get,
getAttrs,
modifyAttr,
removeAttr,
reset,
set,
setAttrs
Methods inherited from Base:
_aggregateAttrs,
_defDestroyFn,
_defInitFn,
_destroyHierarchy,
_filterAttrCfs,
_getAttrCfgs,
_getClasses,
_initHierarchy,
_initHierarchyData,
_preInitEventCfg,
destroy,
init,
toString
Events
directionChange
(
event
)
Fires when the value for the configuration attribute 'direction' is changed. You can listen for the event using the
on method if you wish to be notified before the attribute's value has changed, or using the
after method if you wish to be notified after the attribute's value has changed.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
durationChange
(
event
)
Fires when the value for the configuration attribute 'duration' is changed. You can listen for the event using the
on method if you wish to be notified before the attribute's value has changed, or using the
after method if you wish to be notified after the attribute's value has changed.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
easingChange
(
event
)
Fires when the value for the configuration attribute 'easing' is changed. You can listen for the event using the
on method if you wish to be notified before the attribute's value has changed, or using the
after method if you wish to be notified after the attribute's value has changed.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
elapsedTimeChange
(
event
)
Fires when the value for the configuration attribute 'elapsedTime' is changed. You can listen for the event using the
on method if you wish to be notified before the attribute's value has changed, or using the
after method if you wish to be notified after the attribute's value has changed.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
end
(
ev
)
fires after the animation completes.
- Parameters:
-
ev
<Event>
The end event.
fromChange
(
event
)
Fires when the value for the configuration attribute 'from' is changed. You can listen for the event using the
on method if you wish to be notified before the attribute's value has changed, or using the
after method if you wish to be notified after the attribute's value has changed.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
iteration
(
ev
)
fires when an animation begins an iteration.
- Parameters:
-
ev
<Event>
The iteration event.
iterationCountChange
(
event
)
Fires when the value for the configuration attribute 'iterationCount' is changed. You can listen for the event using the
on method if you wish to be notified before the attribute's value has changed, or using the
after method if you wish to be notified after the attribute's value has changed.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
iterationsChange
(
event
)
Fires when the value for the configuration attribute 'iterations' is changed. You can listen for the event using the
on method if you wish to be notified before the attribute's value has changed, or using the
after method if you wish to be notified after the attribute's value has changed.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
nodeChange
(
event
)
Fires when the value for the configuration attribute 'node' is changed. You can listen for the event using the
on method if you wish to be notified before the attribute's value has changed, or using the
after method if you wish to be notified after the attribute's value has changed.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
pause
(
ev
)
fires when an animation is paused.
- Parameters:
-
ev
<Event>
The pause event.
pausedChange
(
event
)
Fires when the value for the configuration attribute 'paused' is changed. You can listen for the event using the
on method if you wish to be notified before the attribute's value has changed, or using the
after method if you wish to be notified after the attribute's value has changed.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
resume
(
ev
)
fires when an animation is resumed (run from pause).
- Parameters:
-
ev
<Event>
The pause event.
reverseChange
(
event
)
Fires when the value for the configuration attribute 'reverse' is changed. You can listen for the event using the
on method if you wish to be notified before the attribute's value has changed, or using the
after method if you wish to be notified after the attribute's value has changed.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
runningChange
(
event
)
Fires when the value for the configuration attribute 'running' is changed. You can listen for the event using the
on method if you wish to be notified before the attribute's value has changed, or using the
after method if you wish to be notified after the attribute's value has changed.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
start
(
ev
)
fires when an animation begins.
- Parameters:
-
ev
<Event>
The start event.
startTimeChange
(
event
)
Fires when the value for the configuration attribute 'startTime' is changed. You can listen for the event using the
on method if you wish to be notified before the attribute's value has changed, or using the
after method if you wish to be notified after the attribute's value has changed.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
toChange
(
event
)
Fires when the value for the configuration attribute 'to' is changed. You can listen for the event using the
on method if you wish to be notified before the attribute's value has changed, or using the
after method if you wish to be notified after the attribute's value has changed.
- Parameters:
-
event
<Event.Facade>
An Event Facade object with the following attribute specific properties added: - prevVal
- The value of the attribute, prior to it being set
- newVal
- The value the attribute is to be set to
- attrName
- The name of the attribute being set
- subAttrName
- If setting a property within the attribute's value, the name of the sub-attribute property being set
tween
(
ev
)
fires every frame of the animation.
- Parameters:
-
ev
<Event>
The tween event.
Events inherited from Base:
Configuration Attributes
How iterations of the animation should behave.
Possible values are "normal" and "alternate".
Normal will repeat the animation, alternate will reverse on every other pass.
Default Value: "normal"
The length of the animation. Defaults to "1" (second).
The method that will provide values to the attribute(s) during the animation.
Defaults to "Easing.easeNone".
Current time the animation has been running.
Default Value: 0
from
- Object
supports any unit, provided it matches the "to" (or default)
unit (e.g. "{width: 10em', color: 'rgb(0, 0 0)', borderColor: '#ccc'}".
If using the default ('px' for length-based units), the unit may be omitted (
(e.g. "{width: 100}, borderColor: 'ccc'}", which defaults to pixels
and hex, respectively).
The starting values for the animated properties.
Fields may be strings, numbers, or functions.
If a function is used, the return value becomes the from value.
If no from value is specified, the DEFAULT_GETTER will be used.
The number of iterations that have occurred.
Resets when an animation ends (reaches iteration count or stop() called).
Default Value: 0
The number of times the animation should run
Default Value: 1
The object to be animated.
Whether or not the animation is currently paused.
Default Value: false
If true, animation begins from last frame
Default Value: false
Whether or not the animation is currently running.
Default Value: false
Date stamp for the first frame of the animation.
Default Value: 0
to
- Object
supports any unit, provided it matches the "from" (or default)
unit (e.g. "{width: '50%', color: 'red', borderColor: '#ccc'}".
If using the default ('px' for length-based units), the unit may be omitted (
(e.g. "{width: 100}, borderColor: 'ccc'}", which defaults to pixels
and hex, respectively).
The ending values for the animated properties.
Fields may be strings, numbers, or functions.
Configuration attributes inherited from Base: