using GlitchyEngine.Core; using GlitchyEngine.Math; using GlitchyEngine.Graphics; namespace GlitchyEngine.Graphics.Text; /// /// Renders text. /// public class TextRenderer : Component { /// /// Gets or sets whether the text is rich text.
/// If , the text will be parsed for rich text tags; if , the text will be rendered as plain text. ///
public bool IsRichText { get => ScriptGlue.TextRenderer_GetIsRichText(_uuid); set => ScriptGlue.TextRenderer_SetIsRichText(_uuid, value); } /// /// Gets or sets the text. /// public string Text { get { ScriptGlue.TextRenderer_GetText(_uuid, out string text); return text; } set => ScriptGlue.TextRenderer_SetText(_uuid, value); } public float FontSize { get { ScriptGlue.TextRenderer_GetFontSize(_uuid, out float size); return size; } set => ScriptGlue.TextRenderer_SetFontSize(_uuid, value); } /// /// The color that will be used to render the text. This color can be overridden by rich text tags. /// public ColorRGBA Color { get { ScriptGlue.TextRenderer_GetColor(_uuid, out ColorRGBA color); return color; } set => ScriptGlue.TextRenderer_SetColor(_uuid, value); } public HorizontalTextAlignment HorizontalAlignment { get { ScriptGlue.TextRenderer_GetHorizontalAlignment(_uuid, out HorizontalTextAlignment alignment); return alignment; } set => ScriptGlue.TextRenderer_SetHorizontalAlignment(_uuid, value); } // TODO: PreparedText component }