Back to API Reference
Class

RevealModifier

Inherits:BaseModifier

Shows only the leading part of each covered range and hides the rest — the engine piece behind typewriter-style text reveal.

Remarks

Visibility is governed by the Front parameter together with Collapse: set the Front field, author it in markup (<reveal=fade,50%>), or own it per range. The first tag parameter selects the appearance effect by RevealHandlerEntry name (<reveal=fade>). Clusters are revealed in logical order, whole grapheme clusters at a time — along one shared text-order frontier, or independently per range when PerRange is on. A cluster covered by overlapping ranges belongs to the innermost one — it alone governs the cluster's visibility and appearance effect. Line breaks are never hidden, so the line structure stays stable while text reveals. Appearance is binary by default; add named entries or subscribe GlyphRevealing to animate it. A receding frontier animates too: the cluster keeps its place in the mesh — and, where its range collapses, in layout — until its hide effect finishes. Collapse is a parameter like the rest, so one modifier serves ranges that differ in it: <reveal=,4abs,line,true> clamps a body out of the layout while <reveal=fade,0> elsewhere merely holds text back from the mesh. A collapsing range is settled a pipeline stage earlier than a drawing one, so its frontier moves through a re-parse where the other moves on a mesh rebuild.
public IRevealHandlerProvider Provider{ get; set }

Source of named reveal handlers for <reveal=name> ranges; the entry with an empty name serves ranges that select no name.

public string HandlerName{ get; set }

Default RevealHandlerEntry name used by ranges whose tag carries no parameter; empty selects the provider's unnamed entry. A per-range value overrides it.

public UnitValue Front{ get; set }

Reveal frontier: a percentage of the frontier axis, or an absolute position in Units (fractional values blend the frontier unit; positions beyond the length show everything). In markup a bare number is the percentage — an absolute position carries the abs suffix, so four lines is 4abs and plain 4 is four percent of them. Addresses one shared text-order frontier, or each range independently when PerRange is on.

public TextUnit Unit{ get; set }

What one step of Front covers. Changing it rewrites an absolute Front to the number of new units the same text takes, so the revealed text stays put — two clusters become the one line holding them, and a front of two hundred clusters spanning five lines becomes five. A percentage needs no rewrite. A per-range value counts only where each range fills on its own: with PerRange off there is a single frontier axis, and one axis carries one numbering — the modifier's own.

public bool Collapse{ get; set }

When, hidden clusters are taken out of the layout and the text reflows (CSS display: none); when, they keep their space and are only not drawn (CSS visibility: hidden). Ranges may differ: one that collapses is decided a stage earlier than one that only stops drawing, so its frontier moves through a re-parse where the other moves on a mesh rebuild.

public string ReserveFor{ get; set }

Label of the range the last shown line keeps room for, so what follows the frontier lands beside it instead of below: the line gives its tail back — at a break opportunity, whole words — until the labelled range fits. Its room is measured, never declared, so the language, the font, a size or spacing effect on it change nothing here.

public PlaybackClock Clock{ get; set }

Time source appear/hide phases advance on. Manual advances only through AdvanceTime; a clock change mid-flight restarts running phases.

public bool PerRange{ get; set }

When, every range fills independently and simultaneously. When (the default), covered ranges reveal one after another in text order: Front addresses one shared frontier over the union of covered clusters (each counted once, nesting shares positions).

public TextRange VisibleRange{ get }

Codepoint span of the covered text the frontier currently shows, empty while it shows nothing. Reaches from the first shown cluster to the last, so a frontier over several ranges reports the extent it covers rather than each range's own share — ask VisibleRangeIn for one range's own. Line breaks, which no frontier hides, do not carry the span past what it reveals.

public bool IsClipping{ get }

Whether the frontier is holding any covered cluster back.

protected override void OnEnable()
protected override void OnDisable()
protected override void OnDestroy()
protected override void BeforeApply()
protected override void OnApply()
public TextRange VisibleRangeIn()

Codepoint span shown by the ranges lying inside span, empty while they show nothing — what VisibleRange answers for one part of a modifier whose ranges differ. Pair it with a labelled span to ask after the range an author named.

public void AdvanceTime()

Advances appear/hide phases by explicit seconds — the tick source for the Manual clock; other clocks ignore it.

public RevealGlyphHandler GlyphRevealing

Fires for every rendered glyph of a covered range during mesh build, carrying the glyph's reveal state — the receptor for custom appearance animation (fade, scale-in, drop-in, or anything else): mutate the current quad through generator. While subscribed, the frontier cluster renders with a fractional Progress instead of popping in whole. May run on a worker thread — no Unity API calls inside handlers.