Skip to content
Rémi Verschelde edited this page Feb 16, 2016 · 14 revisions

Important: This wiki is soon going to be taken down, as the official documentation of the Godot project is now on http://docs.godotengine.org.

LineEdit

####Inherits: Control ####Category: Core

Brief Description

Control that provides single line string editing.

Member Functions

Signals

Description

LineEdit provides a single line string editor, used for text fields.

Member Function Description

  • void clear ( )

Clear the LineEdit text.

  • void select_all ( )

Select the whole string.

  • void set_text ( String text )

Set the text in the LineEdit, clearing the existing one and the selection.

Return the text in the LineEdit.

  • void set_cursor_pos ( int pos )

Set the cursor position inside the LineEdit, causing it to scroll if needed.

  • int get_cursor_pos ( ) const

Return the cursor position inside the LineEdit.

  • void set_max_length ( int chars )

Set the maximum amount of characters the LineEdit can edit, and cropping existing text in case it exceeds that limit. Setting 0 removes the limit.

  • int get_max_length ( ) const

Return the maximum amount of characters the LineEdit can edit. If 0 is returned, no limit exists.

  • void append_at_cursor ( String text )

Append text at cursor, scrolling the LineEdit when needed.

  • void set_editable ( bool enabled )

Set the editable status of the LineEdit. When disabled, existing text can"apos;t be modified and new text can"apos;t be added.

  • bool is_editable ( ) const

Return the editable status of the LineEdit (see set_editable).

  • void set_secret ( bool enabled )

Set the secret status of the LineEdit. When enabled, every character is displayed as "*".

  • bool is_secret ( ) const

Return the secret status of the LineEdit (see set_secret).

Clone this wiki locally