java.lang.Object
org.praxislive.code.userapi.Property.Animator
- Enclosing class:
Property
Provides keyframe animation support for Property. Methods return this so
that they can be chained - eg.
to(1, 0).in(1, 0.25).easeInOut()-
Method Summary
Modifier and TypeMethodDescriptionease()Convenience method to useEasing.easeeasing for all keyframes.easeIn()Convenience method to useEasing.easeIneasing for all keyframes.Convenience method to useEasing.easeInOuteasing for all keyframes.easeOut()Convenience method to useEasing.easeOuteasing for all keyframes.Set the easing mode for each keyframe.in(double... in) Set the time in seconds for each keyframe.booleanWhether an animation is currently active.linear()Convenience method to useEasing.lineareasing for all keyframes.stop()Stop animating.to(double... to) Set the target values for animation and start animation.Set a consumer to be called each time the Animator finishes animation.
-
Method Details
-
to
Set the target values for animation and start animation. The number of values provided to this method controls the number of keyframes.- Parameters:
to- target values- Returns:
- this
-
in
Set the time in seconds for each keyframe. The number of provided values may be different than the number of keyframes passed to to(). Values will be cycled through as needed.eg.
to(100, 50, 250).in(1, 0.5)is the same asto(100, 50, 250).in(1, 0.5, 1)- Parameters:
in- times in seconds- Returns:
- this
-
easing
Set the easing mode for each keyframe. The number of provided values may be different than the number of keyframes passed to to(). Values will be cycled through as needed.- Parameters:
easing- easing mode to use- Returns:
- this
-
linear
Convenience method to useEasing.lineareasing for all keyframes.- Returns:
- this
-
ease
Convenience method to useEasing.easeeasing for all keyframes.- Returns:
- this
-
easeIn
Convenience method to useEasing.easeIneasing for all keyframes.- Returns:
- this
-
easeOut
Convenience method to useEasing.easeOuteasing for all keyframes.- Returns:
- this
-
easeInOut
Convenience method to useEasing.easeInOuteasing for all keyframes.- Returns:
- this
-
stop
Stop animating. The current property value will be retained.- Returns:
- this
-
isAnimating
public boolean isAnimating()Whether an animation is currently active.- Returns:
- animation active
-
whenDone
Set a consumer to be called each time the Animator finishes animation. Also calls the consumer immediately if no animation is currently active.Unlike restarting an animation by polling isAnimating(), an animation started inside this consumer will take into account any time overrun between the target and actual finish time of the completing animation.
- Parameters:
whenDoneConsumer- function to call- Returns:
- this
-