Back to API Reference
Class
SpriteModifier
sealed
Embeds Sprite assets inline with text as glyphs of the text mesh. The set of named sprites available to <sprite=name> tags is supplied by an ISpriteProvider.
Remarks
Tag syntax: <sprite=name[,colorArg][,aspect][,size][,offset][,advance][,lineHeightAbove][,lineHeightBelow][,pivot][,rotation]>. The optional second positional argument controls the rendered color of this occurrence: omitted — use the keyed override when present, otherwise the provider entry's own Color. i — inherit the host UniText component's
color. Equivalent to CSS currentColor. #RGB/#RRGGBB/#RRGGBBAA or a named color (red, blue, …) — explicit per-occurrence override. Examples: <sprite=heart>, <sprite=heart,i>, <sprite=heart,#FF0000>. aspect (true/false) and the shared presentation overrides (size, bearing offset, advance, line space above/below — em units; pivot — normalized; rotation — degrees) resolve through the override hierarchy, weakest → strongest: provider entry → keyed override → default parameters → tag attribute. Every sprite is a glyph of the process-wide SpriteFont: it takes its place in the layer stack, renders in world-space text, and receives the layer effects (shadow, glow, stroke, …) whose colour-glyph policy applies to it. It draws from its own texture at native resolution — one sub-mesh per distinct texture, so the sprites of one atlas share a draw call — and a tightly packed sprite draws by its own outline mesh. The sprite name resolves through Provider; a matching entry in Overrides changes only its presentation. Built-in providers: InlineSpriteProvider (default — inline list on the modifier), AssetSpriteProvider (shared UniTextSprites asset). For dynamic catalogs — input-prompt icon services, localisation, item icons — implement ISpriteProvider directly and raise its Changed event when the resolution result changes.public ISpriteProvider Provider{ get; set }Source of named inline sprites.
protected INamedCatalog<InlineSprite> Catalog{ get }Resolves the occurrence's glyph and box: the sprite keeps its aspect inside the box, centred, or stretches to fill it; the offsets land in the shaping slot, the scales in the placement. The glyph is requested with the silhouette field any effect asked for on this cluster — the only atlas work a sprite ever needs.
