- java.lang.Object
-
- org.praxislive.code.userapi.Property.Animator
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Property.Animatorease()Convenience method to useEasing.easeeasing for all keyframes.Property.AnimatoreaseIn()Convenience method to useEasing.easeIneasing for all keyframes.Property.AnimatoreaseInOut()Convenience method to useEasing.easeInOuteasing for all keyframes.Property.AnimatoreaseOut()Convenience method to useEasing.easeOuteasing for all keyframes.Property.Animatoreasing(Easing... easing)Set the easing mode for each keyframe.Property.Animatorin(double... in)Set the time in seconds for each keyframe.booleanisAnimating()Whether an animation is currently active.Property.Animatorlinear()Convenience method to useEasing.lineareasing for all keyframes.Property.Animatorstop()Stop animating.Property.Animatorto(double... to)Set the target values for animation and start animation.Property.AnimatorwhenDone(Consumer<Property> whenDoneConsumer)Set a consumer to be called each time the Animator finishes animation.
-
-
-
Method Detail
-
to
public Property.Animator to(double... 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
public Property.Animator in(double... 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
public Property.Animator easing(Easing... 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
public Property.Animator linear()
Convenience method to useEasing.lineareasing for all keyframes.- Returns:
- this
-
ease
public Property.Animator ease()
Convenience method to useEasing.easeeasing for all keyframes.- Returns:
- this
-
easeIn
public Property.Animator easeIn()
Convenience method to useEasing.easeIneasing for all keyframes.- Returns:
- this
-
easeOut
public Property.Animator easeOut()
Convenience method to useEasing.easeOuteasing for all keyframes.- Returns:
- this
-
easeInOut
public Property.Animator easeInOut()
Convenience method to useEasing.easeInOuteasing for all keyframes.- Returns:
- this
-
stop
public Property.Animator 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
public Property.Animator whenDone(Consumer<Property> whenDoneConsumer)
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
-
-