.. default-domain:: cs .. highlight:: csharp .. namespace:: KRPC.Client.Services.UI Text ==== .. class:: Text A text label. Added to a :type:`Canvas` or a :type:`Panel`. .. property:: RectTransform RectTransform { get; } The rect transform for the UI object. :Game Scenes: All .. property:: LayoutElement LayoutElement { get; } How much space the UI object asks a layout for. :Game Scenes: All .. note:: Only has an effect when the object is in a panel that has a layout. A canvas is not inside a layout and does not have one. .. property:: bool Visible { get; set; } Whether the UI object is visible. :Game Scenes: All .. note:: This is the object's own setting, which is what it was last set to. An object is only drawn when everything it is inside is visible as well, so an interface can be built with its parts visible, inside a panel that is not, and shown all at once by making that panel visible. .. property:: string Content { get; set; } The text string :Game Scenes: All .. property:: bool WordWrap { get; set; } Whether the text wraps onto further lines when it is wider than the space it has. Text that does not wrap carries on past the edge, and its preferred size is that of a single line, so a changing value leaves a layout in place. :Game Scenes: All .. property:: string Font { get; set; } Name of the font :Game Scenes: All .. note:: Empty if the game provided no font to draw the text with, in which case it is not drawn. See :prop:`Text.AvailableFonts` for the names that can be set. .. property:: System.Collections.Generic.IList AvailableFonts { get; } A list of all available fonts. :Game Scenes: All .. property:: int Size { get; set; } Font size. :Game Scenes: All .. property:: FontStyle Style { get; set; } Font style. :Game Scenes: All .. property:: StdLib.ColorRGBA Color { get; set; } The color the text is drawn in. :Game Scenes: All .. property:: TextAnchor Alignment { get; set; } Alignment. :Game Scenes: All .. property:: float LineSpacing { get; set; } Line spacing. :Game Scenes: All .. function:: void Remove() Remove the UI object. :Game Scenes: All .. enum:: FontStyle Font style. .. enumerator:: Normal Normal. .. enumerator:: Bold Bold. .. enumerator:: Italic Italic. .. enumerator:: BoldAndItalic Bold and italic. .. enum:: TextAlignment Text alignment. .. enumerator:: Left Left aligned. .. enumerator:: Right Right aligned. .. enumerator:: Center Center aligned. .. enum:: TextAnchor Text alignment. .. enumerator:: LowerCenter Lower center. .. enumerator:: LowerLeft Lower left. .. enumerator:: LowerRight Lower right. .. enumerator:: MiddleCenter Middle center. .. enumerator:: MiddleLeft Middle left. .. enumerator:: MiddleRight Middle right. .. enumerator:: UpperCenter Upper center. .. enumerator:: UpperLeft Upper left. .. enumerator:: UpperRight Upper right.