Skip to main content

Class YauiText

A text element, generated by the Advanced Text Generator (shaping, OS font fallback, line breaking rules and rich text) and drawn as SDF glyphs by the uber shader. Its size is measured by the layout unless set. Child elements are ignored.

Assembly: Yaui.dll​
View Source​
Declaration
public class YauiText : YauiElement

Inheritance: System.Object -> Yaui.YauiElement

Properties​

Text​

View Source​
Declaration
public string Text { get; set; }

Font​

View Source​
Declaration
public Font Font { get; set; }

FontSize​

View Source​
Declaration
public float FontSize { get; set; }

Color​

The default color. Rich text tags can override it.

View Source​
Declaration
public Color Color { get; set; }

Align​

View Source​
Declaration
public TextAlign Align { get; set; }

VerticalAlign​

View Source​
Declaration
public VerticalAlign VerticalAlign { get; set; }

WordWrap​

View Source​
Declaration
public bool WordWrap { get; set; }

SpriteAsset​

View Source​
Declaration
public SpriteAsset SpriteAsset { get; set; }

RichText​

View Source​
Declaration
public bool RichText { get; set; }

Overflow​

View Source​
Declaration
public TextOverflow Overflow { get; set; }

OutlineWidth​

View Source​
Declaration
public float OutlineWidth { get; set; }

OutlineColor​

View Source​
Declaration
public Color OutlineColor { get; set; }

ShadowColor​

View Source​
Declaration
public Color ShadowColor { get; set; }

ShadowOffset​

View Source​
Declaration
public Vector2 ShadowOffset { get; set; }

ShadowBlur​

View Source​
Declaration
public float ShadowBlur { get; set; }

AcceptsChildren​

Whether child elements are laid out and drawn. Elements that measure their content (Yaui.YauiElement.MeasuresContent) never have children.

View Source​
Declaration
protected override bool AcceptsChildren { get; }

HasVisibleContent​

Whether the element draws content besides its box: it is then hittable. Call Yaui.YauiElement.SyncHittable() when the value changes.

View Source​
Declaration
protected override bool HasVisibleContent { get; }

Methods​

OnValidate()​

View Source​
Declaration
protected override void OnValidate()

OnDidApplyAnimationProperties()​

View Source​
Declaration
protected override void OnDidApplyAnimationProperties()

OnRegistered()​

Called after the element got its slots in a panel (when enabled, or moved to another panel): write the content here. Content written before is gone.

View Source​
Declaration
protected override void OnRegistered()

OnUnregistering()​

Called before the element releases its slots, including its content. The stores may already be shut down (domain reload).

View Source​
Declaration
protected override void OnUnregistering()

OnLayoutApplied()​

Main thread, once a frame right before rendering: the layout of this element changed (Yaui.YauiElement.LayoutRect, Yaui.YauiElement.ContentBox). Content written here is drawn in this frame.

View Source​
Declaration
protected override void OnLayoutApplied()