Skip to content

Class TerminalScreen3D

A terminal screen living in the scene: a mesh surface the camera can look at across the room or lean into. The pointer is a camera ray against the collider; hits map through the surface UV to cells, and a mouse over a uGUI element is left to the UI. An external ray (an XR controller, an in-game cursor) can drive it through PointFromRay, ButtonFromRay, and ScrollFromRay instead of the mouse. A renderer whose material has a _TerminalDisplay texture, such as one built around the Terminal Screen sub graph, keeps its materials and receives the display texture; otherwise the screen shows it unlit.

Declaration
[AddComponentMenu("Terminal/Terminal Screen (3D)")]
[RequireComponent(typeof(MeshRenderer), typeof(MeshFilter))]
[Icon("Packages/com.darkeffekt.terminal/Editor/Icons/Assets/TerminalScreen3D.png")]
public sealed class TerminalScreen3D : TerminalScreenBase

Inheritance: System.Object -> UnityEngine.Object -> UnityEngine.Component -> UnityEngine.Behaviour -> UnityEngine.MonoBehaviour -> DarkEffekt.Terminal.Unity.TerminalScreenBase

Keep the grid’s shape on this surface, letterboxed. Off stretches it to fill.

Declaration
public bool PreserveAspect { get; set; }

Pixels across the screen. Sets the session’s font size so its columns and rows fill this width; zero keeps the session’s own.

Declaration
public int Resolution { get; set; }

With a resolution set, the session’s rows follow its columns so the grid fills the screen. Change the column count with TerminalSession.SetSize; the rows given there are replaced.

Declaration
public bool FitRows { get; set; }

False while nothing can see this screen, which skips its effect pass.

Declaration
protected override bool IsShown { get; }

The screen’s width and height in world units: the part of the mesh its material’s screen rect covers, or the whole UV square. Zero when the mesh cannot be read.

Declaration
public Vector2 SurfaceSize { get; }

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.

Declaration
protected override float SurfaceAspect { get; }

Shows the styled display texture on the visual this presenter drives.

Declaration
protected override void PresentTexture(Texture texture)
Type Name
UnityEngine.Texture texture
Declaration
protected override void OnDestroy()
Declaration
protected override void LateUpdate()

Drives the screen from an arbitrary world ray. Returns true when the ray lands on the screen.

Declaration
public bool PointFromRay(Ray ray, out int col, out int row)

System.Boolean

Type Name
UnityEngine.Ray ray
System.Int32 col
System.Int32 row

Presses or releases a button at a world ray, for external pointers. Returns true when the ray lands on the screen.

Declaration
public bool ButtonFromRay(Ray ray, TermMouseButton button, bool pressed)

System.Boolean

Type Name
UnityEngine.Ray ray
DarkEffekt.Terminal.TermMouseButton button
System.Boolean pressed

Cracks the panel where a world ray lands, with a severity from 0 to 1. False when the ray misses the screen.

Declaration
public bool DamageFromRay(Ray ray, float severity = 0.5)

System.Boolean

Type Name
UnityEngine.Ray ray
System.Single severity

Cracks the panel at a world point on its surface, such as a collision contact. False when the point is not on the screen.

Declaration
public bool DamageAtPoint(Vector3 worldPoint, float severity = 0.5)

System.Boolean

Type Name
UnityEngine.Vector3 worldPoint
System.Single severity

Scrolls at a world ray, for external pointers: positive is up. Returns true when the ray lands on the screen.

Declaration
public bool ScrollFromRay(Ray ray, float delta)

System.Boolean

Type Name
UnityEngine.Ray ray
System.Single delta