Class WaveEffect
Rolls a sine wave through a region, displacing its rows or columns as it passes.
Inherited Members
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
public sealed class WaveEffect : AmbientEffectBase, ITextEffect, IDisposable
Remarks
Displacement is in whole cells, because a grid has no smaller step. An amplitude of one cell therefore reads as a distinct wobble rather than as a smooth ripple, which suits a failing display or an underwater scene more than it suits a gentle drift.
Content displaced past the edge of the region is not wrapped around. Rolling it back in on the far side would join two unrelated parts of the screen together, which reads as a tear rather than as a wave.
Properties
Amplitude
Gets or sets how far a row or column is displaced at the crest, in cells.
Declaration
public int Amplitude { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Horizontal
Gets or sets whether rows slide sideways, which is the usual reading of a wave through text. When false, columns slide up and down instead.
Declaration
public bool Horizontal { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
WaveCount
Gets or sets how many complete waves span the region. Higher values give a tighter ripple.
Declaration
public float WaveCount { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
OnAmbientStart()
Called when the effect starts, after the region has been captured.
Declaration
protected override void OnAmbientStart()
Overrides
OnEffectRelease()
Called when the effect is disposed. Return anything rented from the context here.
Declaration
protected override void OnEffectRelease()
Overrides
OnEffectTick(float, float)
Called once per tick to draw the effect at the given progress.
Declaration
protected override void OnEffectTick(float progress, float easedProgress)
Parameters
| Type | Name | Description |
|---|---|---|
| float | progress | Linear progress from 0 to 1. |
| float | easedProgress | Progress with the easing curve applied. |
Overrides
SetHorizontal(bool)
Chooses whether rows slide sideways or columns slide up and down.
Declaration
public WaveEffect SetHorizontal(bool horizontal)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | horizontal | True for rows sliding sideways. |
Returns
| Type | Description |
|---|---|
| WaveEffect | This effect, for chaining. |
SetShape(int, float)
Sets the shape of the wave.
Declaration
public WaveEffect SetShape(int amplitude, float waveCount)
Parameters
| Type | Name | Description |
|---|---|---|
| int | amplitude | How far a row or column is displaced at the crest, in cells. |
| float | waveCount | How many complete waves span the region. |
Returns
| Type | Description |
|---|---|
| WaveEffect | This effect, for chaining. |