Interface ITextEffect
A time-based animation that writes cells into a region of a text mode grid.
Inherited Members
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
public interface ITextEffect : IDisposable
Remarks
Effects are normally driven by a TextModeEffectPlayer, which advances every
active effect once per frame immediately before the view uploads the grid to the GPU.
Hand an effect to view.Effects.Play(...) and the player takes care of the rest,
including disposal.
While it runs, an effect owns every cell in its Region and overwrites them freely. Nothing enforces that ownership, so drawing over a region while an effect is playing there will fight with the effect. Ask the player with IsRegionBusy(in CellRect) when that is a real possibility.
Properties
IsComplete
Gets whether the effect reached its final state. This is true after natural completion and after Skip(), and false for an effect that was stopped part-way.
Declaration
bool IsComplete { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsRunning
Gets whether the effect has been started and has not yet finished. This stays true while the effect is waiting out a start delay and while it is paused.
Declaration
bool IsRunning { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Name
Gets a short name identifying this effect, used in log messages and in the events it publishes. Defaults to the effect's type name.
Declaration
string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Progress
Gets progress through the effect, from 0 at the start to 1 when finished. This is linear progress; the easing curve is applied on top of it internally.
Declaration
float Progress { get; }
Property Value
| Type | Description |
|---|---|
| float |
Region
Gets the block of cells this effect writes to, clamped to the target grid. This resolves when the effect starts, so before then it may still be the unresolved request.
Declaration
CellRect Region { get; }
Property Value
| Type | Description |
|---|---|
| CellRect |
State
Gets the current lifecycle state.
Declaration
TextEffectState State { get; }
Property Value
| Type | Description |
|---|---|
| TextEffectState |
TimeMode
Gets which clock the effect advances on, which is what the player uses to choose a delta time.
Declaration
TextEffectTimeMode TimeMode { get; }
Property Value
| Type | Description |
|---|---|
| TextEffectTimeMode |
Methods
Pause()
Suspends the effect, keeping its progress and everything it has written so far.
Declaration
void Pause()
Resume()
Resumes a paused effect from where it left off.
Declaration
void Resume()
Skip()
Jumps straight to the finished state, writing the final result into the grid.
Declaration
void Skip()
Remarks
This is what a "press any key to skip" control should call, because it leaves the screen looking as though the effect had played out and still raises OnCompleted, so anything chained off completion still runs.
Start()
Starts the effect, or restarts it from the beginning if it already ran.
Declaration
void Start()
Remarks
Starting captures whatever the effect needs from the target grid, so the grid must already hold the content the effect works from. A typewriter captures nothing, but a fade or a transition captures the region as it looks right now.
Stop()
Stops the effect before it finishes, leaving the grid exactly as it looks at this moment.
Declaration
void Stop()
Tick(float)
Advances the effect by one step and writes the resulting cells.
Declaration
void Tick(float deltaTime)
Parameters
| Type | Name | Description |
|---|---|---|
| float | deltaTime | Seconds elapsed since the previous tick. |
Events
OnCompleted
Raised when the effect reaches its final state, either by running out its duration or through Skip().
Declaration
event Action OnCompleted
Event Type
| Type | Description |
|---|---|
| Action |
OnStarted
Raised when the effect begins advancing, after any start delay has elapsed.
Declaration
event Action OnStarted
Event Type
| Type | Description |
|---|---|
| Action |
OnStopped
Raised when the effect is stopped before reaching its final state.
Declaration
event Action OnStopped
Event Type
| Type | Description |
|---|---|
| Action |