Class FadeEffect
Fades a region's existing content in from a flat color, or out to one.
Inherited Members
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
public sealed class FadeEffect : TextEffectBase, ITextEffect, IDisposable
Remarks
The region is captured as it looks when the effect starts, and that capture is the finished state of a fade in or the starting state of a fade out. Draw the content first, then play the effect over it.
Only colors change, never characters, so the text stays legible throughout rather than appearing out of nothing. Give the effect a mask to make the fade sweep, scatter or bloom across the region instead of happening everywhere at once.
Properties
EdgeColor
Gets or sets the color the content fades from, or fades toward when fading out. Usually the background the text sits on.
Declaration
public Color32 EdgeColor { get; set; }
Property Value
| Type | Description |
|---|---|
| Color32 |
FadeBackground
Gets or sets whether cell backgrounds fade too. Turn this off to fade only the text and leave panels and fills sitting where they are.
Declaration
public bool FadeBackground { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
FadeOut
Gets or sets whether the effect fades out rather than in.
Declaration
public bool FadeOut { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
OnEffectFinish(bool)
Called when the effect finishes, whether it completed, was skipped or was stopped.
Declaration
protected override void OnEffectFinish(bool completed)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | completed | True when the effect reached its final state. |
Overrides
Remarks
The default implementation does nothing. Override it to restore state an effect borrowed, which is what a corrupting effect needs so the grid is not left damaged.
OnEffectRelease()
Called when the effect is disposed. Return anything rented from the context here.
Declaration
protected override void OnEffectRelease()
Overrides
OnEffectStart()
Called when the effect starts, after the region is resolved and before any tick. Capture whatever the effect needs from the grid here.
Declaration
protected override void OnEffectStart()
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
SetEdgeColor(Color32)
Sets the color the content fades from, or toward when fading out.
Declaration
public FadeEffect SetEdgeColor(Color32 color)
Parameters
| Type | Name | Description |
|---|---|---|
| Color32 | color | The color to fade from or toward. |
Returns
| Type | Description |
|---|---|
| FadeEffect | This effect, for chaining. |
SetFadeBackground(bool)
Chooses whether cell backgrounds fade along with the text.
Declaration
public FadeEffect SetFadeBackground(bool fadeBackground)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | fadeBackground | True to fade backgrounds too. |
Returns
| Type | Description |
|---|---|
| FadeEffect | This effect, for chaining. |
SetFadeOut(bool)
Chooses whether the effect fades out rather than in.
Declaration
public FadeEffect SetFadeOut(bool fadeOut)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | fadeOut | True to fade out. |
Returns
| Type | Description |
|---|---|
| FadeEffect | This effect, for chaining. |