SpriteDraw
namespace Griff.Scenes;
public struct SpriteDrawOne quad to draw: a unit quad (-0.5..0.5) placed in the world by World, which already includes the sprite’s size and flips. For text, Text is set, the quad is one line high, and the renderer widens it to the rasterized text’s aspect ratio (and shifts it for Align).
Properties
Section titled “Properties”public TextAlign Align { get; init; }For text: where the quad sits relative to the origin. The renderer shifts it once it knows the width.
Background
Section titled “Background”public Color Background { get; init; }For text: the color of a box fitted behind its lines by the renderer, which knows how wide they are; transparent draws none (see Background).
public ClipArea? Clip { get; init; }A part of the world it’s cut to: nothing of it is drawn outside it (a child of a Layout with Clip). Null draws it all.
Entity
Section titled “Entity”public Entity Entity { get; init; }public Color Flash { get; init; }A color painted over the quad (keeping its shape), with alpha saying how much; see Flash.
public string? Font { get; init; }For text: the font (see Font), or null for the built-in one.
HoleRadius
Section titled “HoleRadius”public float HoleRadius { get; init; }When more than 0, the quad is drawn in Tint everywhere except a round hole in its middle this big (as a fraction of the quad’s half-width), with no image: the iris of a scene change.
public string? Image { get; init; }Padding
Section titled “Padding”public float Padding { get; init; }For text with a Background: how far the box reaches past the lines, in lines (the quad’s own units: a Padding over its size).
Source
Section titled “Source”public Vector4 Source { get; init; }Part of the image to draw, (u, v, width, height) in 0–1 image space. The whole image by default.
public string? Text { get; init; }public Color Tint { get; init; }public int Typed { get; init; }For text: how many of its characters are drawn, from the start (a typewriter’s); the rest are laid out but not drawn, so the drawn words stay where the whole text puts them. 0 draws them all.
VerticalAlign
Section titled “VerticalAlign”public TextVerticalAlign VerticalAlign { get; init; }For text: where its lines sit up and down relative to the origin (see VerticalAlign).
public Matrix4x4 World { get; init; }WrapWidth
Section titled “WrapWidth”public float WrapWidth { get; init; }For text: the width its lines are broken between words to fit, in lines (the quad’s own units: a WrapWidth over its size); 0 breaks them only at new lines.
Methods
Section titled “Methods”Deconstruct
Section titled “Deconstruct”public void Deconstruct(out Matrix4x4 World, out string? Image, out Color Tint, out Entity Entity, out string? Text)Equals
Section titled “Equals”public override bool Equals(object obj)Equals
Section titled “Equals”public bool Equals(SpriteDraw other)GetHashCode
Section titled “GetHashCode”public override int GetHashCode()ToString
Section titled “ToString”public override string ToString()