Class TerminalScreenBase
Shared presenter behavior: runs the session’s texture through the screen shader with this screen’s screen type, maps pointer UVs to cells through the same warp the shader uses, and turns pointer activity into mouse reports or selection. The effect pass runs only when its result would change: a new grid frame, a screen type edit, a resize, an animated screen type, or a run-time behavior in motion. Those behaviors are per screen: power, vertical hold, the signal with its cues, and panel damage. They change the display only; the session and its grid carry on underneath, and the pointer maps as on an undisturbed picture. A screen that is off takes no pointer input.
Assembly: DarkEffekt.Terminal
Section titled “Assembly: DarkEffekt.Terminal”public abstract class TerminalScreenBase : MonoBehaviourInheritance: System.Object -> UnityEngine.Object -> UnityEngine.Component -> UnityEngine.Behaviour -> UnityEngine.MonoBehaviour
Derived:
DarkEffekt.Terminal.Unity.TerminalScreen3D, DarkEffekt.Terminal.Unity.TerminalScreenUGUI
Properties
Section titled “Properties”Session
Section titled “Session”public TerminalSession Session { get; set; }ScreenType
Section titled “ScreenType”How this screen shows the session. Null is a sharp flat copy.
public TerminalScreenType ScreenType { get; set; }PointerIndicatorStyle
Section titled “PointerIndicatorStyle”public PointerIndicator PointerIndicatorStyle { get; set; }IsPoweredOn
Section titled “IsPoweredOn”True when the screen is on or switching on.
public bool IsPoweredOn { get; }PowerState
Section titled “PowerState”Where the screen is between on and off.
public ScreenPowerState PowerState { get; }HasVerticalHold
Section titled “HasVerticalHold”False while the picture rolls, is held out of frame, or is rolling back into lock.
public bool HasVerticalHold { get; }VerticalRollSpeed
Section titled “VerticalRollSpeed”How fast the picture rolls, in pictures a second; positive is upward. Zero in lock.
public float VerticalRollSpeed { get; }Signal
Section titled “Signal”The signal this screen receives, kept until set again: its
interference and scrambling. DarkEffekt.Terminal.Unity.SignalCondition.Noisy(float)
and DarkEffekt.Terminal.Unity.SignalCondition.Scrambled(System.Single%2cSystem.Single) build the usual ones.
Cues play over it and leave it alone.
public SignalCondition Signal { get; set; }The cues playing over the signal, oldest first.
public IReadOnlyList<SignalCue> Cues { get; }SignalSeed
Section titled “SignalSeed”Picks this screen’s interference and crack patterns. The same seed, calls, and times draw the same frames.
public int SignalSeed { get; set; }IsGlitching
Section titled “IsGlitching”True during a Glitch burst.
public bool IsGlitching { get; }IsDamaged
Section titled “IsDamaged”True while the panel shows any damage.
public bool IsDamaged { get; }Display
Section titled “Display”The state of the display itself: the impacts on its panel, oldest first. Save it, and give each impact back to Damage to restore the picture.
public DisplayCondition Display { get; }DisplayTexture
Section titled “DisplayTexture”The styled image this screen shows, for materials or scripts of your own. Null until the first frame; a new texture after a resize.
public Texture DisplayTexture { get; }CrackTexture
Section titled “CrackTexture”The panel’s cracks as a map over the display, for a material of your own: the lit edge in r, the shaded edge in g, and the glass normal in ba. The Terminal Screen sub graph turns it into a normal and a smoothness. Null while the panel is whole.
public Texture CrackTexture { get; }DamageTexture
Section titled “DamageTexture”The panel’s damage as a map over the display: the stuck lines’ color in rgb and the dead share in a. Null while the panel is whole.
public Texture DamageTexture { get; }IsShown
Section titled “IsShown”False while nothing can see this screen, which skips its effect pass.
protected virtual bool IsShown { get; }SurfaceAspect
Section titled “SurfaceAspect”The width over height of the surface this screen covers. A positive value letterboxes the grid to keep its shape; zero stretches it to fill.
protected virtual float SurfaceAspect { get; }Fields
Section titled “Fields”session
Section titled “session”[Tooltip("The session this screen shows and sends its pointer input to.")][SerializeField]protected TerminalSession sessionscreenType
Section titled “screenType”[Tooltip("How this screen shows the session: filtering and the display effect. Empty is a sharp flat copy.")][SerializeField]protected TerminalScreenType screenTypepointerIndicator
Section titled “pointerIndicator”[Tooltip("What the terminal draws at the hovered cell. None draws nothing and only routes the input, for setups where a reticle or the OS cursor is already visible.")][SerializeField]protected PointerIndicator pointerIndicatorMaxImpacts
Section titled “MaxImpacts”The most impacts a screen shows. One more replaces the oldest.
public const int MaxImpacts = 4Methods
Section titled “Methods”PointerExit()
Section titled “PointerExit()”Called by the concrete screens when the pointer leaves the surface.
protected void PointerExit()PowerOn(bool)
Section titled “PowerOn(bool)”Switches the screen on, with the screen type’s power style and duration. Instant cuts straight to the picture, as does a screen with no screen type.
public void PowerOn(bool instant = false)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Boolean |
instant |
PowerOff(bool)
Section titled “PowerOff(bool)”Switches the screen off, with the screen type’s power style and duration. The screen stays dark until PowerOn, and takes no pointer input. The session keeps running and keeps the keyboard.
public void PowerOff(bool instant = false)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Boolean |
instant |
PowerCycle(float)
Section titled “PowerCycle(float)”Switches the screen off and back on: off with its transition, dark for a moment, then on with its transition. PowerChanged reports both ends. A PowerOn or PowerOff call in between replaces it.
public void PowerCycle(float darkSeconds = 0.5)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Single |
darkSeconds |
LoseVerticalHold(float)
Section titled “LoseVerticalHold(float)”Lets the picture roll at speed, in pictures a second, with the blanking bar between frames. Positive rolls upward, negative downward, and zero holds the picture where it is.
public void LoseVerticalHold(float speed = 0.6)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Single |
speed |
RecoverVerticalHold(float)
Section titled “RecoverVerticalHold(float)”Brings the picture back into lock. Zero seconds snaps it; more lets it roll on to the next frame and settle over that time.
public void RecoverVerticalHold(float seconds = 0)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Single |
seconds |
RollOnce(float, bool)
Section titled “RollOnce(float, bool)”Rolls the picture through one frame over seconds, then locks again.
public void RollOnce(float seconds = 0.5, bool downward = false)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Single |
seconds |
System.Boolean |
downward |
Play(SignalCue)
Section titled “Play(SignalCue)”Plays a cue over the signal: its condition at its envelope’s level, blended as it says, until its release ends or DarkEffekt.Terminal.Unity.TerminalScreenBase.Stop(DarkEffekt.Terminal.Unity.SignalCue) starts the release early. Returns the cue.
public SignalCue Play(SignalCue cue)Returns
Section titled “Returns”DarkEffekt.Terminal.Unity.SignalCue
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.Unity.SignalCue | cue |
Stop(SignalCue)
Section titled “Stop(SignalCue)”Starts a cue’s release now. A cue that has ended, or whose release has begun, is left alone.
public void Stop(SignalCue cue)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.Unity.SignalCue | cue |
StopCues()
Section titled “StopCues()”Starts every cue’s release now.
public void StopCues()Receive(SignalCondition, float)
Section titled “Receive(SignalCondition, float)”Receives a condition in place of the signal for a number of seconds, as a cue that replaces it, then returns to the signal as set. Zero or less seconds sets the signal itself instead.
public SignalCue Receive(SignalCondition condition, float seconds)Returns
Section titled “Returns”DarkEffekt.Terminal.Unity.SignalCue
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.Unity.SignalCondition | condition |
System.Single |
seconds |
ResetBehaviors()
Section titled “ResetBehaviors()”Puts the screen right at once: switched on, the picture locked, no interference, any glitch over, and the damage repaired.
public void ResetBehaviors()Glitch(float, float)
Section titled “Glitch(float, float)”A burst of tearing, jitter, static, and color trouble for duration seconds, at a strength from 0 to 1, over the signal: a cue of DarkEffekt.Terminal.Unity.SignalCondition.Burst(float).
public void Glitch(float duration = 0.3, float strength = 0.8)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Single |
duration |
System.Single |
strength |
Damage(Vector2, float)
Section titled “Damage(Vector2, float)”Cracks the panel at a UV on the screen, the kind UvToCell takes, with a severity from 0 to 1. The damage stays until Repair. The crack pattern comes from the position and SignalSeed; the impact returned holds everything that draws it.
public ScreenImpact Damage(Vector2 uv, float severity = 0.5)Returns
Section titled “Returns”DarkEffekt.Terminal.Unity.ScreenImpact
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
UnityEngine.Vector2 |
uv |
System.Single |
severity |
Damage(ScreenImpact)
Section titled “Damage(ScreenImpact)”Adds an impact as given, such as one saved from Impacts.
public void Damage(ScreenImpact impact)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.Unity.ScreenImpact | impact |
DamageCell(int, int, float)
Section titled “DamageCell(int, int, float)”Cracks the panel at the middle of a cell. False when the session is not ready or the cell is off the grid.
public bool DamageCell(int col, int row, float severity = 0.5)Returns
Section titled “Returns”System.Boolean
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Int32 |
col |
System.Int32 |
row |
System.Single |
severity |
Repair()
Section titled “Repair()”Clears every impact.
public void Repair()LateUpdate()
Section titled “LateUpdate()”protected virtual void LateUpdate()DisplayTextureSize(Texture, TerminalScreenType, int, out bool)
Section titled “DisplayTextureSize(Texture, TerminalScreenType, int, out bool)”The size of the display texture this presenter shows, and whether it
carries mipmaps. The default suits a surface seen at any distance
and angle: see DarkEffekt.Terminal.Unity.TerminalScreenBase.SupersampledSize(UnityEngine.Texture%2cDarkEffekt.Terminal.Unity.TerminalScreenType%2cSystem.Int32%2cSystem.Boolean%40).
protected virtual Vector2Int DisplayTextureSize(Texture grid, TerminalScreenType type, int cellHeight, out bool mipmaps)Returns
Section titled “Returns”UnityEngine.Vector2Int
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
UnityEngine.Texture |
grid |
| DarkEffekt.Terminal.Unity.TerminalScreenType | type |
System.Int32 |
cellHeight |
System.Boolean |
mipmaps |
SupersampledSize(Texture, TerminalScreenType, int, out bool)
Section titled “SupersampledSize(Texture, TerminalScreenType, int, out bool)”A display texture size for a surface with no fixed size on screen. A Point screen type gets the grid’s own size, texel for texel. A smooth one gets mipmaps, and when it bends the image or draws line patterns, a whole multiple of the grid large enough that a scanline covers four pixels.
protected static Vector2Int SupersampledSize(Texture grid, TerminalScreenType type, int cellHeight, out bool mipmaps)Returns
Section titled “Returns”UnityEngine.Vector2Int
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
UnityEngine.Texture |
grid |
| DarkEffekt.Terminal.Unity.TerminalScreenType | type |
System.Int32 |
cellHeight |
System.Boolean |
mipmaps |
PresentTexture(Texture)
Section titled “PresentTexture(Texture)”Shows the styled display texture on the visual this presenter drives.
protected abstract void PresentTexture(Texture texture)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
UnityEngine.Texture |
texture |
WarpUv(Vector2)
Section titled “WarpUv(Vector2)”Mirrors the barrel warp in TerminalScreen.shader, so a pointer on the curved image lands on the cell it appears to touch. A roll, interference, and damage leave the mapping alone.
public Vector2 WarpUv(Vector2 uv)Returns
Section titled “Returns”UnityEngine.Vector2
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
UnityEngine.Vector2 |
uv |
UvToCell(Vector2, out int, out int)
Section titled “UvToCell(Vector2, out int, out int)”UV (0,0 bottom left) to cell coordinates. False when off the screen, on the border around the grid, or while the screen is switched off.
public bool UvToCell(Vector2 uv, out int col, out int row)Returns
Section titled “Returns”System.Boolean
Parameters
Section titled “Parameters”| Type | Name |
|---|---|
UnityEngine.Vector2 |
uv |
System.Int32 |
col |
System.Int32 |
row |
KeyboardModifiers()
Section titled “KeyboardModifiers()”protected static TermModifiers KeyboardModifiers()Returns
Section titled “Returns”DarkEffekt.Terminal.TermModifiers
PointerDown(TermMouseButton, Vector2)
Section titled “PointerDown(TermMouseButton, Vector2)”protected void PointerDown(TermMouseButton button, Vector2 uv)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.TermMouseButton | button |
UnityEngine.Vector2 |
uv |
PointerUp(TermMouseButton, Vector2)
Section titled “PointerUp(TermMouseButton, Vector2)”protected void PointerUp(TermMouseButton button, Vector2 uv)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
| DarkEffekt.Terminal.TermMouseButton | button |
UnityEngine.Vector2 |
uv |
PointerMove(Vector2)
Section titled “PointerMove(Vector2)”protected void PointerMove(Vector2 uv)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
UnityEngine.Vector2 |
uv |
PointerScroll(float, Vector2)
Section titled “PointerScroll(float, Vector2)”protected void PointerScroll(float delta, Vector2 uv)Parameters
Section titled “Parameters”| Type | Name |
|---|---|
System.Single |
delta |
UnityEngine.Vector2 |
uv |
OnDisable()
Section titled “OnDisable()”protected virtual void OnDisable()OnDestroy()
Section titled “OnDestroy()”protected virtual void OnDestroy()Events
Section titled “Events”PowerChanged
Section titled “PowerChanged”Raised when the screen reaches on (true) or off (false), at the end of its transition.
public event Action<bool> PowerChangedEvent Type
Section titled “Event Type”System.Action<System.Boolean>
VerticalHoldRecovered
Section titled “VerticalHoldRecovered”Raised when the picture comes back into lock, after RecoverVerticalHold or RollOnce.
public event Action VerticalHoldRecoveredEvent Type
Section titled “Event Type”System.Action
GlitchEnded
Section titled “GlitchEnded”Raised when a Glitch burst ends.
public event Action GlitchEndedEvent Type
Section titled “Event Type”System.Action