.. default-domain:: java .. highlight:: java .. package:: krpc.client.services.UI Text ==== .. type:: public class Text A text label. Added to a :type:`Canvas` or a :type:`Panel`. | Base class: :type:`Object` .. container:: inherited-members .. rubric:: Inherited Members * From :type:`Object`: :meth:`getRectTransform `, :meth:`getLayoutElement `, :meth:`getVisible `, :meth:`setVisible `, :meth:`remove ` .. method:: String getContent() .. method:: void setContent(String value) The text string .. method:: boolean getWordWrap() .. method:: void setWordWrap(boolean value) 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. .. method:: String getFont() .. method:: void setFont(String value) Name of the font .. note:: Empty if the game provided no font to draw the text with, in which case it is not drawn. See :meth:`Text.getAvailableFonts()` for the names that can be set. .. method:: java.util.List getAvailableFonts() A list of all available fonts. .. method:: int getSize() .. method:: void setSize(int value) Font size. .. method:: FontStyle getStyle() .. method:: void setStyle(FontStyle value) Font style. .. method:: StdLib.ColorRGBA getColor() .. method:: void setColor(StdLib.ColorRGBA value) The color the text is drawn in. .. method:: TextAnchor getAlignment() .. method:: void setAlignment(TextAnchor value) Alignment. .. method:: float getLineSpacing() .. method:: void setLineSpacing(float value) Line spacing. .. type:: public enum FontStyle Font style. .. field:: public FontStyle NORMAL Normal. .. field:: public FontStyle BOLD Bold. .. field:: public FontStyle ITALIC Italic. .. field:: public FontStyle BOLD_AND_ITALIC Bold and italic. .. type:: public enum TextAlignment Text alignment. .. field:: public TextAlignment LEFT Left aligned. .. field:: public TextAlignment RIGHT Right aligned. .. field:: public TextAlignment CENTER Center aligned. .. type:: public enum TextAnchor Text alignment. .. field:: public TextAnchor LOWER_CENTER Lower center. .. field:: public TextAnchor LOWER_LEFT Lower left. .. field:: public TextAnchor LOWER_RIGHT Lower right. .. field:: public TextAnchor MIDDLE_CENTER Middle center. .. field:: public TextAnchor MIDDLE_LEFT Middle left. .. field:: public TextAnchor MIDDLE_RIGHT Middle right. .. field:: public TextAnchor UPPER_CENTER Upper center. .. field:: public TextAnchor UPPER_LEFT Upper left. .. field:: public TextAnchor UPPER_RIGHT Upper right.