A builder class that can be used to construct an Animator wrapping an AnimatorSet implementation. More...
#include <juce_AnimatorSetBuilder.h>
Public Member Functions | |
AnimatorSetBuilder (Animator startingAnimator) | |
Creates a new builder instance specifying the startingAnimator as the first Animator that is started. | |
AnimatorSetBuilder (double delayMs) | |
Creates a builder with an empty starting animation that completes after delayMs. | |
AnimatorSetBuilder (std::function< void()> cb) | |
Creates a builder with a starting animation that completes at the first update and executes the provided callback function. | |
AnimatorSetBuilder | togetherWith (Animator animator) |
Adds an Animator to the execution graph that will start executing at the same time as the Animator provided last to this builder object. | |
AnimatorSetBuilder | togetherWith (double delayMs) |
Adds an empty Animator to the execution graph that will start executing at the same time as the Animator provided last to this builder object, and completes in delayMs. | |
AnimatorSetBuilder | togetherWith (std::function< void()> cb) |
Adds an empty Animator to the execution graph that will start executing at the same time as the Animator provided last to this builder object, completes upon its first update, and executes the provided callback. | |
AnimatorSetBuilder | followedBy (Animator animator) |
Adds an Animator to the execution graph that will start executing after the Animator provided last to this builder object completes. | |
AnimatorSetBuilder | followedBy (double delayMs) |
Adds an empty Animator to the execution graph that will start executing after the Animator provided last to this builder object. | |
AnimatorSetBuilder | followedBy (std::function< void()> cb) |
Adds an empty Animator to the execution graph that will start executing after the Animator provided last to this builder object, completes upon its first update, and executes the provided callback. | |
AnimatorSetBuilder | withTimeTransform (std::function< double(double)> transform) |
Specifies a time transformation function that the built Animator should utilise, allowing accelerating and decelerating the entire set of Animators. | |
Animator | build () |
Builds an Animator that executes the previously described and parameterised execution graph. | |
A builder class that can be used to construct an Animator wrapping an AnimatorSet implementation.
It allows you to compose larger, complex animations by executing multiple constituent Animator instances in a coordinated manner. It essentially builds an Animator with an execution graph referencing other Animators.
Unlike ValueAnimatorBuilder, objects of AnimatorSetBuilder returned by its member functions reference the same underlying, modifiable builder instance. For this reason build() can be called only once on an underlying builder instance. This is to allow you to attach Animators to different points of the execution graph.
E.g. to have two functions followed by different amounts of delay, each followed by another function you would write the following.
|
explicit |
Creates a new builder instance specifying the startingAnimator as the first Animator that is started.
|
explicit |
Creates a builder with an empty starting animation that completes after delayMs.
|
explicit |
Creates a builder with a starting animation that completes at the first update and executes the provided callback function.
AnimatorSetBuilder AnimatorSetBuilder::togetherWith | ( | Animator | animator | ) |
AnimatorSetBuilder AnimatorSetBuilder::togetherWith | ( | double | delayMs | ) |
AnimatorSetBuilder AnimatorSetBuilder::togetherWith | ( | std::function< void()> | cb | ) |
AnimatorSetBuilder AnimatorSetBuilder::followedBy | ( | Animator | animator | ) |
AnimatorSetBuilder AnimatorSetBuilder::followedBy | ( | double | delayMs | ) |
AnimatorSetBuilder AnimatorSetBuilder::followedBy | ( | std::function< void()> | cb | ) |
AnimatorSetBuilder AnimatorSetBuilder::withTimeTransform | ( | std::function< double(double)> | transform | ) |
Specifies a time transformation function that the built Animator should utilise, allowing accelerating and decelerating the entire set of Animators.
The provided function should be monotonically increasing.
Animator AnimatorSetBuilder::build | ( | ) |
Builds an Animator that executes the previously described and parameterised execution graph.
This function should only be called once for every AnimatorSetBuilder created by its public constructor.