Skip to content

TextDecalSurface

public class TextDecalSurface

The writable text of an author-placed decal: a chip’s part number, a capacitor’s value, a range legend on a switch. Component logic reaches it as Rendering.<Name>.TextDecal.Text.

This is what lets a part’s markings tell the truth about the part. A capacitor whose value is a property can print that value on its own body; a rotary switch can label the position it is in; a resistor can show its own decade. Without it the silkscreen is a lie the moment a user edits a property.

COMPONENT-AGNOSTIC, like every other primitive here: it sets a string on a mesh. It knows nothing about capacitors, and there is deliberately no formatting help: a part that wants “100 µF” composes that string in its own logic, because the day this grew a FormatCapacitance() is the day the logic layer started knowing what a capacitor is.

Writing the SAME string is free: the setter drops it before touching the mesh. That matters because the natural way to use this is to assign it unconditionally every Update(), and re-tessellating glyphs sixty times a second for a value that has not changed would show up as a pinned GPU under render-on-demand.

Every mesh has one, but it is live only on a mesh that really is a decal: ask a plain mesh for its Text and you get “” back, and writing to it does nothing. Every mesh offers the same members, so turning a mesh into a decal (or back) never breaks code that already uses it.

public bool IsTextDecal { get; }

True when this mesh really is a text decal and Text will do something.

public string Text { get; set; }

The characters the decal draws. Reads “” and ignores writes on a mesh that is not a decal; a null write is taken as “”. Writing the same string again costs nothing, so assigning it every frame is fine. Main thread (Update, Initialize or OnPropertyUpdated), not PhysicsUpdate.

Generated from the CRUMB source, commit fcec660d, 2026-10-29.