lib/minigl/forms.rb
def text=(value, trigger_changed = true)
      @text = value[0...@max_length]
      @nodes.clear; @nodes << @text_x
      x = @nodes[0]
      @text.chars.each { |char|
        x += @font.text_width(char) * @scale_x
        @nodes << x
      }
      @cur_node = @nodes.size - 1
      @anchor1 = nil
      @anchor2 = nil
      set_cursor_visible
      @on_text_changed.call @text, @params if trigger_changed && @on_text_changed
    end
def text=(value, trigger_changed = true)
      @text = value[0...@max_length]
      @nodes.clear; @nodes << @text_x
      x = @nodes[0]
      @text.chars.each { |char|
        x += @font.text_width(char) * @scale_x
        @nodes << x
      }
      @cur_node = @nodes.size - 1
      @anchor1 = nil
      @anchor2 = nil
      set_cursor_visible
      @on_text_changed.call @text, @params if trigger_changed && @on_text_changed
    end
Sets the text of the text field to the specified value.

 Parameters:
 [value] The new text to be set. If it's longer than the +max_length+
         parameter used in the constructor, it will be truncated to
         +max_length+ characters.