Skip to content
Version 2.11.0
↓ Get the launcher

SpriteElement record

Sub-rect of a packed atlas PNG — the DrawTextureWithTexCoords analog. Atlas is the whole packed sheet (loaded once, mipmap-smoothed); Uv is the normalized sub-rect to show (x,y,w,h in 0..1, origin BOTTOM-left per Unity texture space); Width/Height are the on-screen pixel size. Use for icon atlases (e.g. a stat-icon sheet) where ImageElement’s whole-PNG display can’t pick one glyph. Atlas is poll-friendly (re-read each build). UvFunc (optional) makes the sub-rect DYNAMIC — re-pulled on the window refresh so one pooled/recycled slot can show a different atlas cell as its backing data changes (e.g. a stat-icon keyed to the attribute the row currently represents). When null, Uv is static (set once at build) — use that for a fixed icon (e.g. a gear).

public record SpriteElement : IEquatable<HudElement>
name description
SpriteElement(…) Sub-rect of a packed atlas PNG — the DrawTextureWithTexCoords analog. Atlas is the whole packed sheet (loaded once, mipmap-smoothed); Uv is the normalized sub-rect to show (x,y,w,h in 0..1, origin BOTTOM-left per Unity texture space); Width/Height are the on-screen pixel size. Use for icon atlases (e.g. a stat-icon sheet) where ImageElement’s whole-PNG display can’t pick one glyph. Atlas is poll-friendly (re-read each build). UvFunc (optional) makes the sub-rect DYNAMIC — re-pulled on the window refresh so one pooled/recycled slot can show a different atlas cell as its backing data changes (e.g. a stat-icon keyed to the attribute the row currently represents). When null, Uv is static (set once at build) — use that for a fixed icon (e.g. a gear).
Atlas { get; set; }
Height { get; set; }
Uv { get; set; }
UvFunc { get; set; }
Width { get; set; }