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

1.2 KiB

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 Sets the input type
getInputType Returns the input type
setDefaultText Sets the default text
setInputLimit Sets a limit to the number of characters that can be entered
getInputLimit Returns the character limit
setOffset Changes the offset inside the input
getOffset Returns the input offset
setTextOffset Changes the cursor position
getTextOffset Returns the cursor position

Here's an example of how to create an Input object and set its properties:

Lua:

local main = basalt.createFrame()
local anInput = main:addInput()
anInput:setInputType("text")
anInput:setDefaultText("Username")
anInput:setInputLimit(20)

XML:

<input type="text" defaultText="Username" inputLimit="20" />