Table of Contents

Class Flow

Provides functionality to create a sequence or multiple sequences of animations. For more information please go to https://flowent.friedsynapse.com/flow

public sealed class Flow : AbstractAnimation, IControllable, IUpdateController
Inheritance
Flow
Implements
Inherited Members
Extension Methods

Constructors

Flow(FlowOptions)

Creates a new flow using the options provided.

public Flow(FlowOptions options)

Parameters

options FlowOptions

Flow(bool)

Creates a new flow.

public Flow(bool autoStart = false)

Parameters

autoStart bool

Whether the flow should start automatically or not.

Methods

At(float, AbstractAnimation)

Starts a new sequence at the timeIndex provided.

public Flow At(float timeIndex, AbstractAnimation animation)

Parameters

timeIndex float

Time index for the sequence to start.

animation AbstractAnimation

Returns

Flow

At(float, List<AbstractAnimation>)

Starts a new sequence at the timeIndex provided.

public Flow At(float timeIndex, List<AbstractAnimation> animations)

Parameters

timeIndex float

Time index for the sequence to start.

animations List<AbstractAnimation>

Returns

Flow

At(float, Func<Echo, AbstractAnimation>)

Starts a new sequence at the timeIndex provided.

public Flow At(float timeIndex, Func<Echo, AbstractAnimation> builder)

Parameters

timeIndex float

Time index for the sequence to start.

builder Func<Echo, AbstractAnimation>

Callback to build the animation.

Returns

Flow

At(float, Func<Flow, AbstractAnimation>)

Starts a new sequence at the timeIndex provided.

public Flow At(float timeIndex, Func<Flow, AbstractAnimation> builder)

Parameters

timeIndex float

Time index for the sequence to start.

builder Func<Flow, AbstractAnimation>

Callback to build the animation.

Returns

Flow

At(float, Func<Tween, AbstractAnimation>)

Starts a new sequence at the timeIndex provided.

public Flow At(float timeIndex, Func<Tween, AbstractAnimation> builder)

Parameters

timeIndex float

Time index for the sequence to start.

builder Func<Tween, AbstractAnimation>

Callback to build the animation.

Returns

Flow

AtDeferred(float, Func<AbstractAnimation>)

Starts a new sequence at the timeIndex provided and uses the callback for the animation builder to add an animation to the sequence. This is useful when you need to create an animation after the current flow has started.

public Flow AtDeferred(float timeIndex, Func<AbstractAnimation> builder)

Parameters

timeIndex float

Time index for the sequence to start.

builder Func<AbstractAnimation>

Callback to build the animation.

Returns

Flow

AtDeferred(float, Func<Echo, AbstractAnimation>)

Starts a new sequence at the timeIndex provided and uses the callback for the animation builder to add an animation to the sequence. This is useful when you need to create an animation after the current flow has started.

public Flow AtDeferred(float timeIndex, Func<Echo, AbstractAnimation> builder)

Parameters

timeIndex float

Time index for the sequence to start.

builder Func<Echo, AbstractAnimation>

Callback to build the animation.

Returns

Flow

AtDeferred(float, Func<Flow, AbstractAnimation>)

Starts a new sequence at the timeIndex provided and uses the callback for the animation builder to add an animation to the sequence. This is useful when you need to create an animation after the current flow has started.

public Flow AtDeferred(float timeIndex, Func<Flow, AbstractAnimation> builder)

Parameters

timeIndex float

Time index for the sequence to start.

builder Func<Flow, AbstractAnimation>

Callback to build the animation.

Returns

Flow

AtDeferred(float, Func<Tween, AbstractAnimation>)

Starts a new sequence at the timeIndex provided and uses the callback for the animation builder to add an animation to the sequence. This is useful when you need to create an animation after the current flow has started.

public Flow AtDeferred(float timeIndex, Func<Tween, AbstractAnimation> builder)

Parameters

timeIndex float

Time index for the sequence to start.

builder Func<Tween, AbstractAnimation>

Callback to build the animation.

Returns

Flow

Conditional(Func<bool>, Action<Flow>)

Executes the onConditionTrue if condition returns true.

public Flow Conditional(Func<bool> condition, Action<Flow> onConditionTrue)

Parameters

condition Func<bool>

The condition.

onConditionTrue Action<Flow>

The callback.

Returns

Flow

OnCompleted(Action)

Adds an event called when the animation has completed.

public Flow OnCompleted(Action callback)

Parameters

callback Action

The event.

Returns

Flow

OnCompleting(Action)

Adds an event called when the animation is completing.

public Flow OnCompleting(Action callback)

Parameters

callback Action

The event.

Returns

Flow

OnLoopCompleted(Action<int?>)

Adds an event called when the animation loop has completed.

public Flow OnLoopCompleted(Action<int?> callback)

Parameters

callback Action<int?>

The event. The parameter represents the number of loops left. If there are infinite loops it'll send a null param.

Returns

Flow

OnLoopStarted(Action<int?>)

Adds an event called when the animation loop has started.

public Flow OnLoopStarted(Action<int?> callback)

Parameters

callback Action<int?>

The event. The parameter represents the number of loops left. If there are infinite loops it'll send a null param.

Returns

Flow

OnStarted(Action)

Adds an event called when the animation has started.

public Flow OnStarted(Action callback)

Parameters

callback Action

The event.

Returns

Flow

OnStarting(Action)

Adds an event called when the animation is starting.

public Flow OnStarting(Action callback)

Parameters

callback Action

The event.

Returns

Flow

OnUpdated(Action<float>)

Adds an event called when the animation has updated.

public Flow OnUpdated(Action<float> callback)

Parameters

callback Action<float>

The event.

Returns

Flow

OnUpdating(Action<float>)

Adds an event called when the animation is updating.

public Flow OnUpdating(Action<float> callback)

Parameters

callback Action<float>

The event.

Returns

Flow

Pause()

Pauses the animation.

public Flow Pause()

Returns

Flow

Queue(AbstractAnimation)

Queues an animation in the current sequence.

public Flow Queue(AbstractAnimation animation)

Parameters

animation AbstractAnimation

Returns

Flow

Queue(Func<Echo, AbstractAnimation>)

Queues an animation in the current sequence.

public Flow Queue(Func<Echo, AbstractAnimation> builder)

Parameters

builder Func<Echo, AbstractAnimation>

Callback to build the animation.

Returns

Flow

Queue(Func<Flow, AbstractAnimation>)

Queues an animation in the current sequence.

public Flow Queue(Func<Flow, AbstractAnimation> builder)

Parameters

builder Func<Flow, AbstractAnimation>

Callback to build the animation.

Returns

Flow

Queue(Func<Tween, AbstractAnimation>)

Queues an animation in the current sequence.

public Flow Queue(Func<Tween, AbstractAnimation> builder)

Parameters

builder Func<Tween, AbstractAnimation>

Callback to build the animation.

Returns

Flow

QueueAwaiter(AbstractFlowAwaiter)

Queues an awaiter in the current sequence.

public Flow QueueAwaiter(AbstractFlowAwaiter flowAwaiter)

Parameters

flowAwaiter AbstractFlowAwaiter

Returns

Flow

QueueAwaiter(Func<bool>)

Queues a callback as an awaiter in the current sequence.

public Flow QueueAwaiter(Func<bool> waitCondition)

Parameters

waitCondition Func<bool>

Returns

Flow

QueueAwaiter(Task)

Queues a task as an awaiter in the current sequence.

public Flow QueueAwaiter(Task task)

Parameters

task Task

Returns

Flow

QueueDeferred(Func<AbstractAnimation>)

Queues a callback for the animation builder in the current sequence. This is useful when you need to create an animation after the current flow has started.

public Flow QueueDeferred(Func<AbstractAnimation> builder)

Parameters

builder Func<AbstractAnimation>

Callback to build the animation.

Returns

Flow

QueueDeferred(Func<Echo, AbstractAnimation>)

Queues a callback for the animation builder in the current sequence. This is useful when you need to create an animation after the current flow has started.

public Flow QueueDeferred(Func<Echo, AbstractAnimation> builder)

Parameters

builder Func<Echo, AbstractAnimation>

Callback to build the animation.

Returns

Flow

QueueDeferred(Func<Flow, AbstractAnimation>)

Queues a callback for the animation builder in the current sequence. This is useful when you need to create an animation after the current flow has started.

public Flow QueueDeferred(Func<Flow, AbstractAnimation> builder)

Parameters

builder Func<Flow, AbstractAnimation>

Callback to build the animation.

Returns

Flow

QueueDeferred(Func<Tween, AbstractAnimation>)

Queues a callback for the animation builder in the current sequence. This is useful when you need to create an animation after the current flow has started.

public Flow QueueDeferred(Func<Tween, AbstractAnimation> builder)

Parameters

builder Func<Tween, AbstractAnimation>

Callback to build the animation.

Returns

Flow

QueueDelay(float)

Queues a delay in the current sequence.

public Flow QueueDelay(float delay)

Parameters

delay float

Returns

Flow

Reset()

Resets the animation so in can be replayed.

public Flow Reset()

Returns

Flow

Exceptions

AnimationException

If the animation is not finished.

AnimationException

If the flow is not finished.

ResetInternal()

protected override void ResetInternal()

Resume()

Resumes the animation.

public Flow Resume()

Returns

Flow

SetAutoStart(bool)

Sets whether this animation should auto-start or not.

public Flow SetAutoStart(bool autoStart)

Parameters

autoStart bool

Returns

Flow

Remarks

Auto-start will be slower than a true-start. See more at https://flowent.friedsynapse.com/tips#h.s5cucrg5qyjc

SetDelay(float)

Sets the amount of time in seconds that you want to delay when this animation is started.

public Flow SetDelay(float time)

Parameters

time float

Returns

Flow

SetDelayUntil(Func<bool>)

Sets the callback that holds the starting of the animation.

public Flow SetDelayUntil(Func<bool> callback)

Parameters

callback Func<bool>

Returns

Flow

SetEvents(FlowEvents)

Sets all the events for this flow.

public Flow SetEvents(FlowEvents events)

Parameters

events FlowEvents

Returns

Flow

SetEvents(Func<FlowEvents, FlowEvents>)

Creates a builder for events and then sets all the events for this flow.

public Flow SetEvents(Func<FlowEvents, FlowEvents> eventsBuilder)

Parameters

eventsBuilder Func<FlowEvents, FlowEvents>

Returns

Flow

SetLoopCount(int?)

Sets the amount of loops you want this animation to have. If you want infinite loops pass a null value.

public Flow SetLoopCount(int? loopCount)

Parameters

loopCount int?

Returns

Flow

Remarks

Flows only have reset loop types.

SetName(string)

Sets the name of the animation.

public Flow SetName(string name)

Parameters

name string

Returns

Flow

SetOptions(FlowOptions)

Sets all the options for this flow.

public Flow SetOptions(FlowOptions options)

Parameters

options FlowOptions

Returns

Flow

SetOptions(Func<FlowOptions, FlowOptions>)

Creates a builder for options and then sets all the options for this flow.

public Flow SetOptions(Func<FlowOptions, FlowOptions> optionsBuilder)

Parameters

optionsBuilder Func<FlowOptions, FlowOptions>

Returns

Flow

SetSkipFrames(int)

Sets the amount of frames you want to skip at when this animation is started.

public Flow SetSkipFrames(int frames)

Parameters

frames int

Returns

Flow

SetTimeScale(float)

Sets the time scale for the current animation.

public Flow SetTimeScale(float timeScale)

Parameters

timeScale float

Returns

Flow

SetUpdateType(UpdateType)

Sets the update type for the animation.

public Flow SetUpdateType(UpdateType updateType)

Parameters

updateType UpdateType

Returns

Flow

Start()

Starts the animation.

public Flow Start()

Returns

Flow

Exceptions

AnimationException

If the flow has already started.

StartAsync(CancellationToken?)

Starts the animation async(you can await this till the animation finishes).

public Task<Flow> StartAsync(CancellationToken? token = null)

Parameters

token CancellationToken?

The cancellation doesn't cancel the task, but rather terminates the animation. The task will be completed

Returns

Task<Flow>

Exceptions

AnimationException

If the flow has already started.

Stop(bool)

Stops the animation.

public Flow Stop(bool triggerOnCompleted = false)

Parameters

triggerOnCompleted bool

If set to true will trigger the "OnCompleted" event on the animation

Returns

Flow