Class Flow
- Namespace
- FriedSynapse.FlowEnt
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
boolWhether 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
floatTime index for the sequence to start.
animation
AbstractAnimation
Returns
At(float, List<AbstractAnimation>)
Starts a new sequence at the timeIndex
provided.
public Flow At(float timeIndex, List<AbstractAnimation> animations)
Parameters
timeIndex
floatTime index for the sequence to start.
animations
List<AbstractAnimation>
Returns
At(float, Func<Echo, AbstractAnimation>)
Starts a new sequence at the timeIndex
provided.
public Flow At(float timeIndex, Func<Echo, AbstractAnimation> builder)
Parameters
timeIndex
floatTime index for the sequence to start.
builder
Func<Echo, AbstractAnimation>Callback to build the animation.
Returns
At(float, Func<Flow, AbstractAnimation>)
Starts a new sequence at the timeIndex
provided.
public Flow At(float timeIndex, Func<Flow, AbstractAnimation> builder)
Parameters
timeIndex
floatTime index for the sequence to start.
builder
Func<Flow, AbstractAnimation>Callback to build the animation.
Returns
At(float, Func<Tween, AbstractAnimation>)
Starts a new sequence at the timeIndex
provided.
public Flow At(float timeIndex, Func<Tween, AbstractAnimation> builder)
Parameters
timeIndex
floatTime index for the sequence to start.
builder
Func<Tween, AbstractAnimation>Callback to build the animation.
Returns
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
floatTime index for the sequence to start.
builder
Func<AbstractAnimation>Callback to build the animation.
Returns
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
floatTime index for the sequence to start.
builder
Func<Echo, AbstractAnimation>Callback to build the animation.
Returns
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
floatTime index for the sequence to start.
builder
Func<Flow, AbstractAnimation>Callback to build the animation.
Returns
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
floatTime index for the sequence to start.
builder
Func<Tween, AbstractAnimation>Callback to build the animation.
Returns
Conditional(Func<bool>, Action<Flow>)
Executes the onConditionTrue
if condition
returns true.
public Flow Conditional(Func<bool> condition, Action<Flow> onConditionTrue)
Parameters
Returns
OnCompleted(Action)
Adds an event called when the animation has completed.
public Flow OnCompleted(Action callback)
Parameters
callback
ActionThe event.
Returns
OnCompleting(Action)
Adds an event called when the animation is completing.
public Flow OnCompleting(Action callback)
Parameters
callback
ActionThe event.
Returns
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
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
OnStarted(Action)
Adds an event called when the animation has started.
public Flow OnStarted(Action callback)
Parameters
callback
ActionThe event.
Returns
OnStarting(Action)
Adds an event called when the animation is starting.
public Flow OnStarting(Action callback)
Parameters
callback
ActionThe event.
Returns
OnUpdated(Action<float>)
Adds an event called when the animation has updated.
public Flow OnUpdated(Action<float> callback)
Parameters
Returns
OnUpdating(Action<float>)
Adds an event called when the animation is updating.
public Flow OnUpdating(Action<float> callback)
Parameters
Returns
Pause()
Pauses the animation.
public Flow Pause()
Returns
Queue(AbstractAnimation)
Queues an animation in the current sequence.
public Flow Queue(AbstractAnimation animation)
Parameters
animation
AbstractAnimation
Returns
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
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
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
QueueAwaiter(AbstractFlowAwaiter)
Queues an awaiter in the current sequence.
public Flow QueueAwaiter(AbstractFlowAwaiter flowAwaiter)
Parameters
flowAwaiter
AbstractFlowAwaiter
Returns
QueueAwaiter(Func<bool>)
Queues a callback as an awaiter in the current sequence.
public Flow QueueAwaiter(Func<bool> waitCondition)
Parameters
Returns
QueueAwaiter(Task)
Queues a task as an awaiter in the current sequence.
public Flow QueueAwaiter(Task task)
Parameters
task
Task
Returns
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
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
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
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
QueueDelay(float)
Queues a delay in the current sequence.
public Flow QueueDelay(float delay)
Parameters
delay
float
Returns
Reset()
Resets the animation so in can be replayed.
public Flow Reset()
Returns
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
SetAutoStart(bool)
Sets whether this animation should auto-start or not.
public Flow SetAutoStart(bool autoStart)
Parameters
autoStart
bool
Returns
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
SetDelayUntil(Func<bool>)
Sets the callback that holds the starting of the animation.
public Flow SetDelayUntil(Func<bool> callback)
Parameters
Returns
SetEvents(FlowEvents)
Sets all the events for this flow.
public Flow SetEvents(FlowEvents events)
Parameters
events
FlowEvents
Returns
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
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
Remarks
Flows only have reset loop types.
SetName(string)
Sets the name of the animation.
public Flow SetName(string name)
Parameters
name
string
Returns
SetOptions(FlowOptions)
Sets all the options for this flow.
public Flow SetOptions(FlowOptions options)
Parameters
options
FlowOptions
Returns
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
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
SetTimeScale(float)
Sets the time scale for the current animation.
public Flow SetTimeScale(float timeScale)
Parameters
timeScale
float
Returns
SetUpdateType(UpdateType)
Sets the update type for the animation.
public Flow SetUpdateType(UpdateType updateType)
Parameters
updateType
UpdateType
Returns
Start()
Starts the animation.
public Flow Start()
Returns
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
Exceptions
- AnimationException
If the flow has already started.
Stop(bool)
Stops the animation.
public Flow Stop(bool triggerOnCompleted = false)
Parameters
triggerOnCompleted
boolIf set to true will trigger the "OnCompleted" event on the animation