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
optionsFlowOptions
Flow(bool)
Creates a new flow.
public Flow(bool autoStart = false)
Parameters
autoStartboolWhether 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
timeIndexfloatTime index for the sequence to start.
animationAbstractAnimation
Returns
At(float, List<AbstractAnimation>)
Starts a new sequence at the timeIndex provided.
public Flow At(float timeIndex, List<AbstractAnimation> animations)
Parameters
timeIndexfloatTime index for the sequence to start.
animationsList<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
timeIndexfloatTime index for the sequence to start.
builderFunc<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
timeIndexfloatTime index for the sequence to start.
builderFunc<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
timeIndexfloatTime index for the sequence to start.
builderFunc<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
timeIndexfloatTime index for the sequence to start.
builderFunc<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
timeIndexfloatTime index for the sequence to start.
builderFunc<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
timeIndexfloatTime index for the sequence to start.
builderFunc<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
timeIndexfloatTime index for the sequence to start.
builderFunc<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
callbackActionThe event.
Returns
OnCompleting(Action)
Adds an event called when the animation is completing.
public Flow OnCompleting(Action callback)
Parameters
callbackActionThe event.
Returns
OnLoopCompleted(Action<int?>)
Adds an event called when the animation loop has completed.
public Flow OnLoopCompleted(Action<int?> callback)
Parameters
callbackAction<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
callbackAction<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
callbackActionThe event.
Returns
OnStarting(Action)
Adds an event called when the animation is starting.
public Flow OnStarting(Action callback)
Parameters
callbackActionThe 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
animationAbstractAnimation
Returns
Queue(Func<Echo, AbstractAnimation>)
Queues an animation in the current sequence.
public Flow Queue(Func<Echo, AbstractAnimation> builder)
Parameters
builderFunc<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
builderFunc<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
builderFunc<Tween, AbstractAnimation>Callback to build the animation.
Returns
QueueAwaiter(AbstractFlowAwaiter)
Queues an awaiter in the current sequence.
public Flow QueueAwaiter(AbstractFlowAwaiter flowAwaiter)
Parameters
flowAwaiterAbstractFlowAwaiter
Returns
QueueAwaiter(Func<bool>)
Queues a callback as an awaiter in the current sequence.
public Flow QueueAwaiter(Func<bool> waitCondition)
Parameters
Returns
QueueAwaiter(Func<Task>)
Queues a callback that retrieves a task as an awaiter in the current sequence.
public Flow QueueAwaiter(Func<Task> getTask)
Parameters
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
builderFunc<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
builderFunc<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
builderFunc<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
builderFunc<Tween, AbstractAnimation>Callback to build the animation.
Returns
QueueDelay(float)
Queues a delay in the current sequence.
public Flow QueueDelay(float delay)
Parameters
delayfloat
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
autoStartbool
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
timefloat
Returns
SetDelayUntil(Func<bool>)
Sets the callback that holds the starting of this animation.
public Flow SetDelayUntil(Func<bool> callback)
Parameters
Returns
SetEvents(FlowEvents)
Sets all the events for this flow.
public Flow SetEvents(FlowEvents events)
Parameters
eventsFlowEvents
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
eventsBuilderFunc<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
loopCountint?
Returns
Remarks
Flows only have reset loop types.
SetName(string)
Sets the name of the animation.
public Flow SetName(string name)
Parameters
namestring
Returns
SetOptions(FlowOptions)
Sets all the options for this flow.
public Flow SetOptions(FlowOptions options)
Parameters
optionsFlowOptions
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
optionsBuilderFunc<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
framesint
Returns
SetTimeScale(float)
Sets the time scale for the current animation.
public Flow SetTimeScale(float timeScale)
Parameters
timeScalefloat
Returns
SetUpdateType(UpdateType)
Sets the update type for the animation.
public Flow SetUpdateType(UpdateType updateType)
Parameters
updateTypeUpdateType
Returns
SetWaitFor(params AbstractAnimation[])
Sets the animation that holds the starting of this animation.
public Flow SetWaitFor(params AbstractAnimation[] animations)
Parameters
animationsAbstractAnimation[]
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
tokenCancellationToken?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
triggerOnCompletedboolIf set to true will trigger the "OnCompleted" event on the animation