-
Notifications
You must be signed in to change notification settings - Fork 0
LineEdit
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.LineEdit |
| Namespace | Electron2D |
| Kind | class |
| Category | UI and Text |
Provides a single-line text editing control.
public class Electron2D.LineEdit : Electron2D.ControlProfile: Electron2D 0.1.0 2D
Status: Supported / Parity verified
Out of profile: no
Godot reference: LineEdit
Single-line text input with caret, max length, placeholder, secret drawing, editing keys and text changed/submitted/rejected signals.
LineEdit accepts focused keyboard text input, basic caret movement,
deletion and submit input. It emits text_changed,
text_submitted and text_change_rejected.
This type is not synchronized. Create and mutate line edits on the main scene thread.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.ControlElectron2D.InputEventKey
| Member | Kind | Summary |
|---|---|---|
CaretColumn |
Property | Gets or sets the caret column. |
Editable |
Property | Gets or sets whether user input can edit the text. |
HorizontalAlignment |
Property | Gets or sets the horizontal alignment used for drawing text. |
MaxLength |
Property | Gets or sets the maximum number of UTF-16 code units accepted by this control. |
PlaceholderText |
Property | Gets or sets the placeholder text drawn when Electron2D.LineEdit.Text is empty. |
Secret |
Property | Gets or sets whether text is drawn using Electron2D.LineEdit.SecretCharacter. |
SecretCharacter |
Property | Gets or sets the character string used when Electron2D.LineEdit.Secret is enabled. |
Text |
Property | Gets or sets the editable text. |
Electron2D.LineEdit() |
Constructor | Initializes a new instance of the Electron2D.LineEdit class. |
Clear() |
Method | Clears all text from this control. |
DeleteCharAtCaret() |
Method | Deletes the character before the caret. |
DeleteText(System.Int32, System.Int32) |
Method | Deletes text in the specified column range. |
InsertTextAtCaret(System.String) |
Method | Inserts text at the current caret column. |
_Draw() |
Method | Draws the text field background and current text. |
_GetMinimumSize() |
Method | Gets the minimum size requested by this line edit. |
_GuiInput(Electron2D.InputEvent) |
Method | Handles focused text input and editing keys. |
Kind: Property
public System.Int32 CaretColumn { get; set; }Gets or sets the caret column.
The preview control stores one caret and no selection range.
The caret position clamped to the range 0 through Electron2D.LineEdit.Text length.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.LineEdit.Text
Kind: Property
public System.Boolean Editable { get; set; }Gets or sets whether user input can edit the text.
Programmatic methods can still change text when this property is false.
true when user input can change text; otherwise, false.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.LineEdit._GuiInput(Electron2D.InputEvent)
Kind: Property
public Electron2D.HorizontalAlignment HorizontalAlignment { get; set; }Gets or sets the horizontal alignment used for drawing text.
Input editing still uses logical text order and a single caret.
The alignment used inside Electron2D.Control.Size.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.LineEdit.HorizontalAlignment
Kind: Property
public System.Int32 MaxLength { get; set; }Gets or sets the maximum number of UTF-16 code units accepted by this control.
Reducing the maximum length truncates existing text and clamps the caret.
0 for unlimited text, or a positive maximum length.
-
System.ArgumentOutOfRangeException: Thrown when the assigned value is negative.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.LineEdit.Text
Kind: Property
public System.String PlaceholderText { get; set; }Gets or sets the placeholder text drawn when Electron2D.LineEdit.Text is empty.
Assigning this property queues a redraw.
The placeholder text. The value is never null.
-
System.ArgumentNullException: Thrown when the assigned value isnull.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.LineEdit.Text
Kind: Property
public System.Boolean Secret { get; set; }Gets or sets whether text is drawn using Electron2D.LineEdit.SecretCharacter.
This property affects drawing only. The Electron2D.LineEdit.Text value remains unchanged.
true to hide the actual text while drawing; otherwise, false.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.LineEdit.SecretCharacter
Kind: Property
public System.String SecretCharacter { get; set; }Gets or sets the character string used when Electron2D.LineEdit.Secret is enabled.
The value is repeated once per UTF-16 code unit in the preview implementation.
A non-empty string used for each hidden text element.
-
System.ArgumentException: Thrown when the assigned value isnull, empty or whitespace.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.LineEdit.Secret
Kind: Property
public System.String Text { get; set; }Gets or sets the editable text.
Assigning text applies Electron2D.LineEdit.MaxLength and clamps
Electron2D.LineEdit.CaretColumn to the new text length.
The current text value. The value is never null.
-
System.ArgumentNullException: Thrown when the assigned value isnull.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.LineEdit
Kind: Constructor
public Electron2D.LineEdit()Initializes a new instance of the Electron2D.LineEdit class.
The constructor registers text signals and enables focus by default.
This constructor is not synchronized. Call it from the main scene thread.
This constructor is available since Electron2D 0.1.0 Preview.
Electron2D.LineEdit
Kind: Method
public System.Void Clear()()Clears all text from this control.
The caret moves to column zero and text_changed is emitted when
the text actually changes.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.LineEdit.Text
Kind: Method
public System.Void DeleteCharAtCaret()()Deletes the character before the caret.
Calling this method at column zero is a no-op.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.LineEdit.CaretColumn
Kind: Method
public System.Void DeleteText(System.Int32, System.Int32)(System.Int32 fromColumn, System.Int32 toColumn)Deletes text in the specified column range.
Columns are clamped to the current text range. Reversed ranges are normalized before deletion.
-
fromColumn: The first column to delete. -
toColumn: The column after the last deleted character.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.LineEdit.Text
Kind: Method
public System.Void InsertTextAtCaret(System.String)(System.String value)Inserts text at the current caret column.
The method applies Electron2D.LineEdit.MaxLength. Rejected overflow text is
emitted through text_change_rejected.
-
value: The text to insert.
-
System.ArgumentNullException: Thrown whenvalueisnull.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.LineEdit.CaretColumn
Kind: Method
public System.Void _Draw()()Draws the text field background and current text.
The preview implementation uses rectangle primitives and theme font overrides.
This callback is invoked on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.CanvasItem.DrawString(Electron2D.Font,Electron2D.Vector2,System.String,Electron2D.HorizontalAlignment,System.Single,System.Int32,System.Nullable{Electron2D.Color})
Kind: Method
public Electron2D.Vector2 _GetMinimumSize()()Gets the minimum size requested by this line edit.
If no font is available, the method returns 96x24.
A conservative text-field size based on theme font state.
This callback is invoked on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control.GetMinimumSize
Kind: Method
public System.Void _GuiInput(Electron2D.InputEvent)(Electron2D.InputEvent inputEvent)Handles focused text input and editing keys.
Unsupported input events are ignored.
-
inputEvent: The input event delivered by the viewport.
This callback is invoked on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Control._GuiInput(Electron2D.InputEvent)
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.