Class DigitalRainEffect
Runs a column of falling characters down each column of the region, leaving the new screen behind as it passes.
Inherited Members
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
public sealed class DigitalRainEffect : TransitionEffectBase, ITextEffect, IDisposable
Remarks
Each column has a head that falls from the top, with a trail of characters behind it fading from the head color toward the content it is uncovering. Above the trail the new screen has arrived; below the head the old one is still showing.
Columns start at staggered moments but all finish together, so the effect always completes exactly when its duration says it will. That matters when it is one step of a sequence: a column left still falling would either be cut off or hold everything else up. CellDuration decides how much of the run a single column takes, and therefore how staggered the start of the rain is.
Properties
ChurnRate
Gets or sets how many times a second the rain characters are re-rolled.
Declaration
public float ChurnRate { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
HeadColor
Gets or sets the color of the leading character of each column, which is what makes the head read as the bright tip of the fall.
Declaration
public Color32 HeadColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color32 |
RainSet
Gets or sets the characters the rain is made of. Characters the font cannot draw are dropped when the effect starts.
Declaration
public string RainSet { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
TrailLength
Gets or sets how many cells of trail follow each head.
Declaration
public int TrailLength { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
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
OnTransitionStart()
Called when the effect starts, after both the starting and target states are ready.
Declaration
protected override void OnTransitionStart()
Overrides
SetChurnRate(float)
Sets how many times a second the rain characters are re-rolled.
Declaration
public DigitalRainEffect SetChurnRate(float churnRate)
Parameters
| Type | Name | Description |
|---|---|---|
| float | churnRate | Re-rolls per second. |
Returns
| Type | Description |
|---|---|
| DigitalRainEffect | This effect, for chaining. |
SetHeadColor(Color32)
Sets the color of the leading character of each column.
Declaration
public DigitalRainEffect SetHeadColor(Color32 color)
Parameters
| Type | Name | Description |
|---|---|---|
| Color32 | color | Color for the head of each fall. |
Returns
| Type | Description |
|---|---|
| DigitalRainEffect | This effect, for chaining. |
SetRainSet(string)
Sets the characters the rain is made of.
Declaration
public DigitalRainEffect SetRainSet(string rainSet)
Parameters
| Type | Name | Description |
|---|---|---|
| string | rainSet | The characters to fall. |
Returns
| Type | Description |
|---|---|
| DigitalRainEffect | This effect, for chaining. |
SetTrailLength(int)
Sets how many cells of trail follow each head.
Declaration
public DigitalRainEffect SetTrailLength(int trailLength)
Parameters
| Type | Name | Description |
|---|---|---|
| int | trailLength | Trail length in cells. |
Returns
| Type | Description |
|---|---|
| DigitalRainEffect | This effect, for chaining. |