# Module `Text`

Component to handle all GUI texts.

Druid text can adjust itself for text node size Text will never will be outside of his text size (even multiline)

## Functions

init(self, node[, value[, no_adjust]]) | Component init function
get_text_width(self[, text]) | Calculate text width with font with respect to trailing space
set_to(self, set_to) | Set text to text field
set_color(self, color) | Set color
set_alpha(self, alpha) | Set alpha
set_scale(self, scale) | Set scale
set_pivot(self, pivot) | Set text pivot.
is_multiline(self) | Return true, if text with line break

## Fields

on_set_text | On set text callback(self, text)
on_update_text_scale | On adjust text size callback(self, new_scale)
on_set_pivot | On change pivot callback(self, pivot)
node | Text node
pos | Current text position
start_scale | Initial text node scale
scale | Current text node scale
start_size | Initial text node size
text_area | Current text node available are
is_no_adjust | Current text size adjust settings

## Functions

init(self, node[, value[, no_adjust]])
  Component init function

  ### Parameters:

  - self Text
  - node node Gui text node
  - value string Initial text. Default value is node text from GUI scene. (optional)
  - no_adjust bool If true, text will be not auto-adjust size (optional)
get_text_width(self[, text])
  Calculate text width with font with respect to trailing space

  ### Parameters:

  - self Text
  - text string (optional)
set_to(self, set_to)
  Set text to text field

  ### Parameters:

  - self Text
  - set_to string Text for node
set_color(self, color)
  Set color

  ### Parameters:

  - self Text
  - color vector4 Color for node
set_alpha(self, alpha)
  Set alpha

  ### Parameters:

  - self Text
  - alpha number Alpha for node
set_scale(self, scale)
  Set scale

  ### Parameters:

  - self Text
  - scale vector3 Scale for node
set_pivot(self, pivot)
  Set text pivot. Text will re-anchor inside his text area

  ### Parameters:

  - self Text
  - pivot gui.pivot Gui pivot constant
is_multiline(self)
  Return true, if text with line break

  ### Parameters:

  - self Text

  ### Returns:

  bool Is text node with line break

## Fields

on_set_text
  On set text callback(self, text)
  - on_set_text druid_event
on_update_text_scale
  On adjust text size callback(self, new_scale)
  - on_update_text_scale druid_event
on_set_pivot
  On change pivot callback(self, pivot)
  - on_set_pivot druid_event
node
  Text node
  - node node
pos
  Current text position
  - pos vector3
start_scale
  Initial text node scale
  - start_scale vector3
scale
  Current text node scale
  - scale vector3
start_size
  Initial text node size
  - start_size vector3
text_area
  Current text node available are
  - text_area vector3
is_no_adjust
  Current text size adjust settings
  - is_no_adjust bool

generated by LDoc 1.4.6 Last updated 2020-10-12 00:44:30