Class ColorCycleEffect
Runs a region's text through a color gradient over time.
Inherited Members
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
public sealed class ColorCycleEffect : AmbientEffectBase, ITextEffect, IDisposable
Remarks
With a mask the color travels across the region rather than changing everywhere at once, which is what turns a gradient into a shimmer running along a title or a wave of color crossing a screen. Without one the whole region changes color together.
The gradient is sampled rather than blended with what is already there, so this replaces the text color outright. Use PulseEffect instead to keep the colors a screen was drawn in and only move their brightness.
Properties
CycleBackground
Gets or sets whether cell backgrounds are colored as well as the text.
Declaration
public bool CycleBackground { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Gradient
Gets or sets the gradient the text is colored from. With none set the effect does nothing, since there is no color to take.
Declaration
public ColorGradient Gradient { get; set; }
Property Value
| Type | Description |
|---|---|
| ColorGradient |
Methods
OnAmbientStart()
Called when the effect starts, after the region has been captured.
Declaration
protected override void OnAmbientStart()
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
SetCycleBackground(bool)
Chooses whether cell backgrounds are colored as well as the text.
Declaration
public ColorCycleEffect SetCycleBackground(bool cycleBackground)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | cycleBackground | True to color backgrounds too. |
Returns
| Type | Description |
|---|---|
| ColorCycleEffect | This effect, for chaining. |
SetGradient(ColorGradient)
Sets the gradient the text is colored from.
Declaration
public ColorCycleEffect SetGradient(ColorGradient gradient)
Parameters
| Type | Name | Description |
|---|---|---|
| ColorGradient | gradient | The gradient to sample. |
Returns
| Type | Description |
|---|---|
| ColorCycleEffect | This effect, for chaining. |
SetGradient(string)
Sets the gradient by name, from the shared color asset registry.
Declaration
public ColorCycleEffect SetGradient(string gradientName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | gradientName | Name of a registered gradient. |
Returns
| Type | Description |
|---|---|
| ColorCycleEffect | This effect, for chaining. |