1.4 KiB
1.4 KiB
TextBox : VisualElement
A multi-line text editor component with cursor support and text manipulation features
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| lines | table | {} | Array of text lines |
| cursorX | number | 1 | Cursor X position |
| cursorY | number | 1 | Cursor Y position (line number) |
| scrollX | number | 0 | Horizontal scroll offset |
| scrollY | number | 0 | Vertical scroll offset |
| editable | boolean | true | Whether text can be edited |
| syntaxPatterns | table | {} | Syntax highlighting patterns |
Functions
| Method | Returns | Description |
|---|---|---|
| TextBox.new | - | |
| TextBox:addSyntaxPattern | - | |
| TextBox:char | - | |
| TextBox:getText | - | |
| TextBox:init | - | |
| TextBox:key | - | |
| TextBox:mouse_click | - | |
| TextBox:mouse_scroll | - | |
| TextBox:render | - | |
| TextBox:setText | - | |
| TextBox:updateViewport | - |
TextBox.new()
TextBox:addSyntaxPattern(pattern, color)
Adds a new syntax highlighting pattern
Parameters
patternstringThe regex pattern to matchcolorcolorThe color to apply