import{_ as e,a as r,b as o,ag as d}from"./chunks/framework.BcrMLAmg.js";const h=JSON.parse('{"title":"Input","description":"","frontmatter":{},"headers":[],"relativePath":"references/elements/Input.md","filePath":"references/elements/Input.md","lastUpdated":1757844696000}'),a={name:"references/elements/Input.md"};function n(i,t,s,l,u,c){return o(),r("div",null,t[0]||(t[0]=[d('
This is the input class. It provides a text input field that can handle user input with various features likecursor movement, text manipulation, placeholder text, and input validation.
Extends: VisualElement
| Property | Type | Default | Description |
|---|---|---|---|
| text | string | - | The current text content of the input |
| cursorPos | number | 1 | The current cursor position in the text |
| viewOffset | number | 0 | The horizontal scroll offset for viewing long text |
| placeholder | string | ... | Text to display when input is empty |
| placeholderColor | color | gray | Color of the placeholder text |
| focusedBackground | color | blue | Background color when input is focused |
| focusedForeground | color | white | Foreground color when input is focused |
| cursorColor | number | nil | Color of the cursor |
| replaceChar | string | nil | Character to replace the input with (for password fields) |
| Method | Returns | Description |
|---|---|---|
| Input:setCursor | - | Sets the cursor position and color |
| Input:updateViewport | Input | Updates the input's viewport |
Sets the cursor position and color
x number The x position of the cursory number The y position of the cursorblink boolean Whether the cursor should blinkcolor number The color of the cursorUpdates the input's viewport
Input self The updated instance