Brunot
Loading...
Searching...
No Matches
AnimationSequence Namespace Reference

Holds functions that are useful to synchronize actions such that specific visual effects occur. More...

Functions

template<std::derived_from< Action > a>
auto typical (const std::vector< Entity * > &intendedTargets, float delayBetweenGroups, int groups, a &intendedAction) -> void
 Sets a group of actions to all have the same initial delay.
template<std::derived_from< Action > a>
auto standardStagger (const std::vector< Entity * > &intendedTargets, float gapBetweenActions, a &intendedAction) -> void
 Adds an action to every entity, but sets it up such that each action will have a small gap between itself and the next.
template<std::derived_from< Action > a>
auto slightOverlap (const std::vector< Entity * > &intendedTargets, float overlapAmount, a &intendedAction) -> void
 Adds an action to every entity, but sets it up such that each action will start a little bit before the last one ends.
template<std::derived_from< Action > a>
auto Staircase (const std::vector< Entity * > &intendedTargets, float delayBetweenActions, a &intendedAction) -> void
 All actions start at the same time, but actions take longer and longer.
template<std::derived_from< Action > a>
auto Spiral (const std::vector< Entity * > &intendedTargets, float numberOfGroups, a &intendedAction) -> void
 All actions start at the same time, but actions take longer and longer.
template<std::derived_from< Action > a>
auto CreateStagger (const std::vector< a > &intendedAction, float delayBetweenActions) -> void
 Creates a buffer between actions with the given delay.
template<std::derived_from< Action > a>
auto SpreadAction (const std::vector< Entity * > &intendedTargets, const a &intendedAction) -> void
 Gives every single Entity the same action, with no special effects.

Detailed Description

Holds functions that are useful to synchronize actions such that specific visual effects occur.

For large scale sequences, like in scoring feedback, you will want to attach actions to entities en masse with individual initial delays. These functions exist to simplify the process for you. They work by modifying the actions initialDelay or Duration.

Function Documentation

◆ CreateStagger()

template<std::derived_from< Action > a>
auto AnimationSequence::CreateStagger ( const std::vector< a > & intendedAction,
float delayBetweenActions )->void

Creates a buffer between actions with the given delay.

Template Parameters
aThe action type to be added to an entity.
Parameters
intendedActionThe actions to have their initial delays changed
delayBetweenActionsHow long the action will buffer between each entity.

◆ slightOverlap()

template<std::derived_from< Action > a>
auto AnimationSequence::slightOverlap ( const std::vector< Entity * > & intendedTargets,
float overlapAmount,
a & intendedAction )->void

Adds an action to every entity, but sets it up such that each action will start a little bit before the last one ends.

All actions have the same duration.

Template Parameters
aThe action type to be added to an entity.
Parameters
intendedTargetsThe entities you are effecting.
overlapAmountHow early you want the next action to occur
intendedActionThe action to be attached to an entity.
Warning
The template, a, MUST be an action type, or this function will not work correctly.
Here is the caller graph for this function:

◆ Spiral()

template<std::derived_from< Action > a>
auto AnimationSequence::Spiral ( const std::vector< Entity * > & intendedTargets,
float numberOfGroups,
a & intendedAction )->void

All actions start at the same time, but actions take longer and longer.

This function only modifies duration and does NOT affect initial delay.

Template Parameters
aThe action type to be added to an entity.
Parameters
intendedTargetsThe entities you are effecting.
numberOfGroupsHow much difference in duration you want between actions
intendedActionThe action to be attached to an entity.
Warning
The template, a, MUST be an action type, or this function will not work correctly.

◆ SpreadAction()

template<std::derived_from< Action > a>
auto AnimationSequence::SpreadAction ( const std::vector< Entity * > & intendedTargets,
const a & intendedAction )->void

Gives every single Entity the same action, with no special effects.

Template Parameters
aThe action type to be added to an entity.
Parameters
intendedTargetsThe entities you are effecting.
intendedActionThe action to be attached to an entity.
Warning
The template, a, MUST be an action type, or this function will not work correctly.
Here is the caller graph for this function:

◆ Staircase()

template<std::derived_from< Action > a>
auto AnimationSequence::Staircase ( const std::vector< Entity * > & intendedTargets,
float delayBetweenActions,
a & intendedAction )->void

All actions start at the same time, but actions take longer and longer.

This function only modifies duration and does NOT affect initial delay.

Template Parameters
aThe action type to be added to an entity.
Parameters
intendedTargetsThe entities you are effecting.
delayBetweenActionsHow much difference in duration you want between actions
intendedActionThe action to be attached to an entity.
Warning
The template, a, MUST be an action type, or this function will not work correctly.
Here is the caller graph for this function:

◆ standardStagger()

template<std::derived_from< Action > a>
auto AnimationSequence::standardStagger ( const std::vector< Entity * > & intendedTargets,
float gapBetweenActions,
a & intendedAction )->void

Adds an action to every entity, but sets it up such that each action will have a small gap between itself and the next.

Template Parameters
aThe action type to be added to an entity.
Parameters
intendedTargetsThe entities you are effecting.
gapBetweenActionsHow much time you want to elapse between each action occuring. You Can input negative numbers if you want them to have overlap
intendedActionThe action to be attached to an entity.
Warning
The template, a, MUST be an action type, or this function will not work correctly.

◆ typical()

template<std::derived_from< Action > a>
auto AnimationSequence::typical ( const std::vector< Entity * > & intendedTargets,
float delayBetweenGroups,
int groups,
a & intendedAction )->void

Sets a group of actions to all have the same initial delay.

Best used within a for loop that increases groups with iterations.

Template Parameters
aThe action type to be added to an entity.
Parameters
intendedTargetsThe entities you are effecting.
delayBetweenGroupsThe delay between groups. Increases as the group number does. Note that it will work best when the same initialDelay is used, but it is not required.
groupsWhich place in line you would like the actions to happen. Think of it as the index that the sequence will play.
intendedActionThe action to be attached to an entity.
Warning
The template, a, MUST be an action type, or this function will not work correctly.