Class Echo
- Namespace
- FriedSynapse.FlowEnt
An echo is a simple update loop that provides a delta time and other settings for custom animation For more information please go to https://flowent.friedsynapse.com/echo
public sealed class Echo : AbstractAnimation, IControllable
- Inheritance
-
Echo
- Implements
- Inherited Members
- Extension Methods
Constructors
Echo(EchoOptions)
Creates a new echo using the options provided.
public Echo(EchoOptions options)
Parameters
options
EchoOptions
Echo(float?, bool)
Creates a new echo.
public Echo(float? timeout = null, bool autoStart = false)
Parameters
timeout
float?The amount of time for this echo in seconds.
autoStart
boolWhether the echo should start automatically or not.
Properties
StopCondition
public Func<float, bool> StopCondition { get; }
Property Value
Timeout
public float? Timeout { get; }
Property Value
Methods
Apply(params AbstractEchoMotion[])
Applies all the motions to the current echo.
public Echo Apply(params AbstractEchoMotion[] motions)
Parameters
motions
AbstractEchoMotion[]
Returns
Apply(IEnumerable<AbstractEchoMotion>)
Applies all the motions to the current echo.
public Echo Apply(IEnumerable<AbstractEchoMotion> motions)
Parameters
motions
IEnumerable<AbstractEchoMotion>
Returns
Conditional(Func<bool>, Action<Echo>)
Executes the onConditionTrue
if condition
returns true.
public Echo Conditional(Func<bool> condition, Action<Echo> onConditionTrue)
Parameters
Returns
ForAll<TItem>(IEnumerable<TItem>)
Creates a scope for the object so you can add motions designed specifically for that enumeration of objects.
public EchoMotionProxyArray<TItem> ForAll<TItem>(IEnumerable<TItem> elements)
Parameters
elements
IEnumerable<TItem>
Returns
- EchoMotionProxyArray<TItem>
Type Parameters
TItem
For<TItem>(TItem)
Creates a scope for the object so you can add motions designed specifically for that object.
public EchoMotionProxy<TItem> For<TItem>(TItem element)
Parameters
element
TItem
Returns
- EchoMotionProxy<TItem>
Type Parameters
TItem
For<TItem>(params TItem[])
Creates a scope for the object so you can add motions designed specifically for that array of objects.
public EchoMotionProxyArray<TItem> For<TItem>(params TItem[] elements)
Parameters
elements
TItem[]
Returns
- EchoMotionProxyArray<TItem>
Type Parameters
TItem
OnCompleted(Action)
Adds an event called when the animation has completed.
public Echo OnCompleted(Action callback)
Parameters
callback
ActionThe event.
Returns
OnCompleting(Action)
Adds an event called when the animation is completing.
public Echo OnCompleting(Action callback)
Parameters
callback
ActionThe event.
Returns
OnLoopCompleted(Action<int?>)
Adds an event called when the animation loop has completed.
public Echo 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 Echo 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 Echo OnStarted(Action callback)
Parameters
callback
ActionThe event.
Returns
OnStarting(Action)
Adds an event called when the animation is starting.
public Echo OnStarting(Action callback)
Parameters
callback
ActionThe event.
Returns
OnUpdated(Action<float>)
Adds an event called when the animation has updated.
public Echo OnUpdated(Action<float> callback)
Parameters
Returns
OnUpdating(Action<float>)
Adds an event called when the animation is updating.
public Echo OnUpdating(Action<float> callback)
Parameters
Returns
Pause()
Pauses the animation.
public Echo Pause()
Returns
Reset()
Resets the animation so in can be replayed.
public Echo Reset()
Returns
Exceptions
- AnimationException
If the animation is not finished.
- AnimationException
If the echo is not finished.
ResetInternal()
protected override void ResetInternal()
Resume()
Resumes the animation.
public Echo Resume()
Returns
SetAutoStart(bool)
Sets whether this animation should auto-start or not.
public Echo 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 Echo SetDelay(float time)
Parameters
time
float
Returns
SetDelayUntil(Func<bool>)
Sets the callback that holds the starting of the animation.
public Echo SetDelayUntil(Func<bool> callback)
Parameters
Returns
SetEvents(EchoEvents)
Sets all the events for this echo.
public Echo SetEvents(EchoEvents events)
Parameters
events
EchoEvents
Returns
SetEvents(Func<EchoEvents, EchoEvents>)
Creates a builder for events and then sets all the events for this echo.
public Echo SetEvents(Func<EchoEvents, EchoEvents> eventsBuilder)
Parameters
eventsBuilder
Func<EchoEvents, EchoEvents>
Returns
SetLoopCount(int?)
Sets the amount of loops you want this animation to have. If you want infinite loops pass a null value.
public Echo SetLoopCount(int? loopCount)
Parameters
loopCount
int?
Returns
Remarks
Flows only have reset loop types.
SetName(string)
Sets the name of the animation.
public Echo SetName(string name)
Parameters
name
string
Returns
SetOptions(EchoOptions)
Sets all the options for this tween.
public Echo SetOptions(EchoOptions options)
Parameters
options
EchoOptions
Returns
SetOptions(Func<EchoOptions, EchoOptions>)
Creates a builder for options and then sets all the options for this echo.
public Echo SetOptions(Func<EchoOptions, EchoOptions> optionsBuilder)
Parameters
optionsBuilder
Func<EchoOptions, EchoOptions>
Returns
SetSkipFrames(int)
Sets the amount of frames you want to skip at when this animation is started.
public Echo SetSkipFrames(int frames)
Parameters
frames
int
Returns
SetStopCondition(Func<float, bool>)
Sets the condition that when true, it will stop the echo.
public Echo SetStopCondition(Func<float, bool> stopCondition)
Parameters
Returns
SetTimeScale(float)
Sets the time scale for the current animation.
public Echo SetTimeScale(float timeScale)
Parameters
timeScale
float
Returns
SetTimeout(float?)
Sets the amount of time in seconds that this echo will last.
public Echo SetTimeout(float? timeout)
Parameters
timeout
float?
Returns
SetUpdateType(UpdateType)
Sets the update type for the animation.
public Echo SetUpdateType(UpdateType updateType)
Parameters
updateType
UpdateType
Returns
Start()
Starts the animation.
public Echo Start()
Returns
Exceptions
- AnimationException
If the echo has already started.
StartAsync(CancellationToken?)
Starts the animation async(you can await this till the animation finishes).
public Task<Echo> 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 echo has already started.
Stop(bool)
Stops the animation.
public Echo Stop(bool triggerOnCompleted = false)
Parameters
triggerOnCompleted
boolIf set to true will trigger the "OnCompleted" event on the animation