Files
Basalt/docs/objects/Input.md
Robert Jelic bb1b1beb79 Basalt 1.7 Update
- New Objects (Flexbox, Graph, Treeview)
- Pluginsystem to add/remove functionality
- Reworked the entire Object system, instead of one big Object Class we have multiple classes: Object, VisualObject, ChangeableObject
- Instead of one big Frame Class we have multiple Frame Classes: BaseFrame, Frame, MovableFrame, ScrollableFrame, MonitorFrame, Flexbox
- Removed the Animation Object, and added a animation plugin instead
- Removed the Graphic Object and merged it's functionality with the image object
- Updated currently existing objects
2023-04-30 17:05:34 +02:00

34 lines
1.2 KiB
Markdown

Input objects allow you to create a field where the user can enter text.
In addition to the Object and VisualObject methods, Input objects have the following methods:
| | |
|---|---|
|[setInputType](objects/Input/setInputType.md)|Sets the input type
|[getInputType](objects/Input/getInputType.md)|Returns the input type
|[setDefaultText](objects/Input/setDefaultText.md)|Sets the default text
|[setInputLimit](objects/Input/setInputLimit.md)|Sets a limit to the number of characters that can be entered
|[getInputLimit](objects/Input/getInputLimit.md)|Returns the character limit
|[setOffset](objects/Input/setOffset.md)|Changes the offset inside the input
|[getOffset](objects/Input/getOffset.md)|Returns the input offset
|[setTextOffset](objects/Input/setTextOffset.md)|Changes the cursor position
|[getTextOffset](objects/Input/getTextOffset.md)|Returns the cursor position
Here's an example of how to create an Input object and set its properties:
Lua:
```lua
local main = basalt.createFrame()
local anInput = main:addInput()
anInput:setInputType("text")
anInput:setDefaultText("Username")
anInput:setInputLimit(20)
```
XML:
```xml
<input type="text" defaultText="Username" inputLimit="20" />
```