1.9 KiB
1.9 KiB
Textfields are objects, where the user can write something on multiple lines. it act's like the default edit script (without coloring)
Remember textfield inherits from Object
getLines
Returns all lines
Returns:
tablelines
Usage:
- Prints all lines
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aTextfield = mainFrame:addTextfield("myFirstTextfield"):show()
basalt.debug(aTextfield:getLines())
getLine
Returns the line on index position
Parameteres:
numberindex
Returns:
stringline
Usage:
- Prints one line
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aTextfield = mainFrame:addTextfield("myFirstTextfield"):show()
basalt.debug(aTextfield:getLine(1))
editLine
Edits the line on index position
Parameteres:
numberindexstringtext
Returns:
objectThe object in use
Usage:
- Edits the line
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aTextfield = mainFrame:addTextfield("myFirstTextfield"):show()
basalt.debug(aTextfield:editLine(1, "Hello!"))
addLine
Adds a line on index position
Parameteres:
numberindexstringtext
Returns:
objectThe object in use
Usage:
- Adds a line
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aTextfield = mainFrame:addTextfield("myFirstTextfield"):show()
basalt.debug(aTextfield:addLine(1, "Hello!"))
removeLine
Removes the line on index position
Parameteres:
numberindexstringtext
Returns:
objectThe object in use
Usage:
- Removes a line
local mainFrame = basalt.createFrame("myFirstFrame"):show()
local aTextfield = mainFrame:addTextfield("myFirstTextfield"):show()
basalt.debug(aTextfield:removeLine())
getTextCursor
Gets text cursor position
Returns:
numberx positionnumbery position