Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 1.22 KB

File metadata and controls

33 lines (26 loc) · 1.22 KB

Input objects allow you to create a field where the user can enter text.

Input objects are derived from Object, VisualObject, and ChangeableObject. Input objects have the following additional 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" />