Class FlickerEffect
Dips a region's brightness at irregular intervals, the way a tired display does.
Inherited Members
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
public sealed class FlickerEffect : AmbientEffectBase, ITextEffect, IDisposable
Remarks
Unlike a pulse, which breathes evenly, a flicker is meant to be unpredictable: mostly steady, with occasional dips of varying depth. That is what reads as failing hardware rather than as an animation.
The whole region dims together by default, since a real display flickers as one panel. Turning on per-cell flicker scatters the dips across individual cells instead, which reads as interference rather than as a dying tube.
Properties
Chance
Gets or sets how likely any given moment is to be a dip rather than steady, from 0 to 1. Low values leave the display mostly stable with occasional faults, which is what reads as a flicker.
Declaration
public float Chance { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
MinimumBrightness
Gets or sets the brightness at the bottom of the deepest dip, where 1 is no dip at all.
Declaration
public float MinimumBrightness { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
PerCell
Gets or sets whether each cell flickers on its own rather than the region flickering as one panel.
Declaration
public bool PerCell { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Rate
Gets or sets how many times a second a new brightness is chosen.
Declaration
public float Rate { 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
SetPerCell(bool)
Chooses whether each cell flickers on its own.
Declaration
public FlickerEffect SetPerCell(bool perCell)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | perCell | True to flicker cells individually. |
Returns
| Type | Description |
|---|---|
| FlickerEffect | This effect, for chaining. |
SetRate(float)
Sets how many times a second a new brightness is chosen.
Declaration
public FlickerEffect SetRate(float rate)
Parameters
| Type | Name | Description |
|---|---|---|
| float | rate | Choices per second. |
Returns
| Type | Description |
|---|---|
| FlickerEffect | This effect, for chaining. |
SetSeverity(float, float)
Sets how often the display dips and how far.
Declaration
public FlickerEffect SetSeverity(float chance, float minimumBrightness)
Parameters
| Type | Name | Description |
|---|---|---|
| float | chance | Chance from 0 to 1 that a given moment is a dip. |
| float | minimumBrightness | Brightness at the bottom of the deepest dip. |
Returns
| Type | Description |
|---|---|
| FlickerEffect | This effect, for chaining. |