MenuItems
LineEdit.swift:69enum MenuItemsenum MenuItemsimport SwiftGodotFramework to write Godot Game Extensions using the Swift Programming Language.
class LineEditAn input field for single-line text.
case cutCuts (copies and clears) the selected text.
case copyCopies the selected text.
case pastePastes the clipboard text over the selected text (or at the caret’s position).
case clearErases the whole LineEdit text.
case selectAllSelects the whole LineEdit text.
case undoUndoes the previous action.
case redoReverse the last undo action.
case submenuTextDirID of “Text Writing Direction” submenu.
case dirInheritedSets text direction to inherited.
case dirAutoSets text direction to automatic.
case dirLtrSets text direction to left-to-right.
case dirRtlSets text direction to right-to-left.
case displayUccToggles control character display.
case submenuInsertUccID of “Insert Control Character” submenu.
case insertLrmInserts left-to-right mark (LRM) character.
case insertRlmInserts right-to-left mark (RLM) character.
case insertLreInserts start of left-to-right embedding (LRE) character.
case insertRleInserts start of right-to-left embedding (RLE) character.
case insertLroInserts start of left-to-right override (LRO) character.
case insertRloInserts start of right-to-left override (RLO) character.
case insertPdfInserts pop direction formatting (PDF) character.
case insertAlmInserts Arabic letter mark (ALM) character.
case insertLriInserts left-to-right isolate (LRI) character.
case insertRliInserts right-to-left isolate (RLI) character.
case insertFsiInserts first strong isolate (FSI) character.
case insertPdiInserts pop direction isolate (PDI) character.
case insertZwjInserts zero width joiner (ZWJ) character.
case insertZwnjInserts zero width non-joiner (ZWNJ) character.
case insertWjInserts word joiner (WJ) character.
case insertShyInserts soft hyphen (SHY) character.
case maxRepresents the size of the MenuItems enum.
override class var godotClassName: StringName { get }final var alignment: HorizontalAlignment { get set }Text alignment as defined in the HorizontalAlignment enum.
final var caretBlink: Bool { get set }If true, makes the caret blink.
final var caretBlinkInterval: Double { get set }The interval at which the caret blinks (in seconds).
final var caretColumn: Int32 { get set }The caret’s column position inside the LineEdit. When set, the text may scroll to accommodate it.
final var caretForceDisplayed: Bool { get set }If true, the LineEdit will always show the caret, even if focus is lost.
final var caretMidGrapheme: Bool { get set }Allow moving caret, selecting and removing the individual composite character components.
final var clearButtonEnabled: Bool { get set }If true, the LineEdit will show a clear button if text is not empty, which can be used to clear the text quickly.
final var contextMenuEnabled: Bool { get set }If true, the context menu will appear when right-clicked.
final var deselectOnFocusLossEnabled: Bool { get set }If true, the selected text will be deselected when focus is lost.
final var dragAndDropSelectionEnabled: Bool { get set }If true, allow drag and drop of selected text.
final var drawControlChars: Bool { get set }If true, control characters are displayed.
final var editable: Bool { get set }If false, existing text cannot be modified and new text cannot be added.
final var expandToTextLength: Bool { get set }If true, the LineEdit width will increase to stay longer than the text. It will not compress if the text is shortened.
final var flat: Bool { get set }If true, the LineEdit doesn’t display decoration.
final var language: String { get set }Language code used for line-breaking and text shaping algorithms. If left empty, current locale is used instead.
final var maxLength: Int32 { get set }Maximum number of characters that can be entered inside the LineEdit. If 0, there is no limit.
final var middleMousePasteEnabled: Bool { get set }If false, using middle mouse button to paste clipboard will be disabled.
final var placeholderText: String { get set }Text shown when the LineEdit is empty. It is not the LineEdit’s default value (see text).
final var rightIcon: Texture2D? { get set }Sets the icon that will appear in the right end of the LineEdit if there’s no text, or always, if clearButtonEnabled is set to false.
final var secret: Bool { get set }If true, every character is replaced with the secret character (see secretCharacter).
final var secretCharacter: String { get set }The character to use to mask secret input. Only a single character can be used as the secret character. If it is longer than one character, only the first one will be used. If it is empty, a space will be used instead.
final var selectAllOnFocus: Bool { get set }If true, the LineEdit will select the whole text when it gains focus.
final var selectingEnabled: Bool { get set }If false, it’s impossible to select the text using mouse nor keyboard.
final var shortcutKeysEnabled: Bool { get set }If false, using shortcuts will be disabled.
final var structuredTextBidiOverride: TextServer.StructuredTextParser { get set }Set BiDi algorithm override for the structured text.
final var structuredTextBidiOverrideOptions: GArray { get set }Set additional options for BiDi override.
final var text: String { get set }String value of the LineEdit.
var textChangeRejected: Signal2 { get }Emitted when appending text that overflows the maxLength. The appended text is truncated to fit maxLength, and the part that couldn’t fit is passed as the rejectedSubstring argument.
var textChanged: Signal1 { get }Emitted when the text changes.
final var textDirection: Control.TextDirection { get set }Base text writing direction.
var textSubmitted: Signal3 { get }Emitted when the user presses enter on the LineEdit.
final var virtualKeyboardEnabled: Bool { get set }If true, the native virtual keyboard is shown when focused on platforms that support it.
final var virtualKeyboardType: LineEdit.VirtualKeyboardType { get set }Specifies the type of virtual keyboard to show.
final func clear() Erases the LineEdit’s text.
final func deleteCharAtCaret() Deletes one character at the caret’s current position (equivalent to pressing [kbd]Delete[/kbd]).
final func deleteText(fromColumn: Int32, toColumn: Int32) Deletes a section of the text going from position fromColumn to toColumn. Both parameters should be within the text’s length.
final func deselect() Clears the current selection.
final func getMenu() -> PopupMenu? Returns the PopupMenu of this LineEdit. By default, this menu is displayed when right-clicking on the LineEdit.
final func getScrollOffset() -> Double Returns the scroll offset due to caretColumn, as a number of characters.
final func getSelectedText() -> String Returns the text inside the selection.
final func getSelectionFromColumn() -> Int32 Returns the selection begin column.
final func getSelectionToColumn() -> Int32 Returns the selection end column.
final func hasSelection() -> Bool Returns true if the user has selected text.
final func insertTextAtCaret(text: String) Inserts text at the caret. If the resulting value is longer than maxLength, nothing happens.
final func isMenuVisible() -> Bool Returns whether the menu is visible. Use this instead of get_menu().visible to improve performance (so the creation of the menu is avoided).
final func menuOption(_ option: Int32) Executes a given action as defined in the MenuItems enum.
final func select(from: Int32 = 0, to: Int32 = -1) Selects characters inside LineEdit between from and to. By default, from is at the beginning and to at the end.
final func selectAll() Selects the whole String.
class Signal1Signal support.
class Signal2Signal support.
class Signal3Signal support.
enum VirtualKeyboardTypeprotocol CaseIterableA type that provides a collection of all of its values.
protocol CustomDebugStringConvertibleA type with a customized textual representation suitable for debugging purposes.
protocol EquatableA type that can be compared for value equality.
protocol Hashable : EquatableA type that can be hashed into a Hasher to produce an integer hash value.
protocol RawRepresentable<RawValue>A type that can be converted to and from an associated raw value.
init?(rawValue: Int64) var debugDescription: String { get }A textual representation of this instance, suitable for debugging
var hashValue: Int { get }static func != (lhs: Self, rhs: Self) -> Bool Returns a Boolean value indicating whether two values are not equal.
func hash(into hasher: inout Hasher)