.. default-domain:: py .. highlight:: py .. currentmodule:: UI Text ==== .. class:: Text A text label. See :meth:`Panel.add_text`. .. attribute:: rect_transform The rect transform for the text. :Attribute: Read-only, cannot be set :rtype: :class:`RectTransform` .. attribute:: visible Whether the UI object is visible. :Attribute: Can be read or written :rtype: bool .. attribute:: content The text string :Attribute: Can be read or written :rtype: str .. attribute:: font Name of the font :Attribute: Can be read or written :rtype: str .. attribute:: available_fonts A list of all available fonts. :Attribute: Read-only, cannot be set :rtype: list(str) .. attribute:: size Font size. :Attribute: Can be read or written :rtype: int .. attribute:: style Font style. :Attribute: Can be read or written :rtype: :class:`FontStyle` .. attribute:: color Set the color :Attribute: Can be read or written :rtype: tuple(float, float, float) .. attribute:: alignment Alignment. :Attribute: Can be read or written :rtype: :class:`TextAnchor` .. attribute:: line_spacing Line spacing. :Attribute: Can be read or written :rtype: float .. method:: remove() Remove the UI object. .. class:: FontStyle Font style. .. data:: normal Normal. .. data:: bold Bold. .. data:: italic Italic. .. data:: bold_and_italic Bold and italic. .. class:: TextAlignment Text alignment. .. data:: left Left aligned. .. data:: right Right aligned. .. data:: center Center aligned. .. class:: TextAnchor Text alignment. .. data:: lower_center Lower center. .. data:: lower_left Lower left. .. data:: lower_right Lower right. .. data:: middle_center Middle center. .. data:: middle_left Middle left. .. data:: middle_right Middle right. .. data:: upper_center Upper center. .. data:: upper_left Upper left. .. data:: upper_right Upper right.