Loading...
Searching...
No Matches
juce::AnimatorSetBuilder Class Reference

## Detailed Description

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.

// Both objects reference the same execution graph, but also refer to different Animators in it
auto builderReferencingFirst = AnimatorSetBuilder { firstFunction };
auto builderReferencingSecond = builderReferencingFirst.togetherWith (secondFunction);
builderReferencingFirst.followedBy (200).followedBy (thirdFunction);
builderReferencingSecond.followedBy (500).followedBy (fourthFunction);
// You could use any one of the builder objects that refer to the same execution graph
auto animator = builderReferencingFirst.build();
juce::AnimatorSetBuilder::AnimatorSetBuilder
AnimatorSetBuilder(Animator startingAnimator)
Creates a new builder instance specifying the startingAnimator as the first Animator that is started.

The documentation for this class was generated from the following file:

- juce_animation/animation/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.

## Constructors and Destructors

## AnimatorSetBuilder() [1/3]

juce::AnimatorSetBuilder::AnimatorSetBuilder | ( | Animator | startingAnimator | ) |

explicit

Creates a new builder instance specifying the startingAnimator as the first Animator that is started.

Referenced by build(), followedBy(), followedBy(), followedBy(), togetherWith(), togetherWith(), togetherWith(), and withTimeTransform().

## AnimatorSetBuilder() [2/3]

juce::AnimatorSetBuilder::AnimatorSetBuilder | ( | double | delayMs | ) |

explicit

Creates a builder with an empty starting animation that completes after delayMs.

## AnimatorSetBuilder() [3/3]

juce::AnimatorSetBuilder::AnimatorSetBuilder | ( | std::function< void()> | cb | ) |

explicit

Creates a builder with a starting animation that completes at the first update and executes the provided callback function.

## Member Functions

## togetherWith() [1/3]

AnimatorSetBuilder juce::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.

References AnimatorSetBuilder().

## togetherWith() [2/3]

AnimatorSetBuilder juce::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.

References AnimatorSetBuilder().

## togetherWith() [3/3]

AnimatorSetBuilder juce::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.

References AnimatorSetBuilder().

## followedBy() [1/3]

AnimatorSetBuilder juce::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.

References AnimatorSetBuilder().

## followedBy() [2/3]

AnimatorSetBuilder juce::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.

References AnimatorSetBuilder().

## followedBy() [3/3]

AnimatorSetBuilder juce::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.

References AnimatorSetBuilder().

## withTimeTransform()

AnimatorSetBuilder juce::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.

References AnimatorSetBuilder().

## build()

Animator juce::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.

References AnimatorSetBuilder().

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited