Text inputs for Toribash
Title says it all. This little script is probably something that should be part of an SDK for useful things.
Text box inputs, useful they are.
How to use:
dofile("textinput.lua")
x = new_textbox1(1,1,25,function (a) echo(string.reverse(a)) end)
That's a simple way to make one. Piece by piece:
dofile("textinput.lua")
Enables these commands by executing the script.
x
The controller of the textbox.
(1,1
The position of the textbox.
,25
The maximum amount of characters it can hold.
,function (a) echo(string.reverse(a)) end)
The function called when enter is hit, where a is the inputted string.
Oh! And some developer! Please make it so that returning non-zero to stop a key from being processed works!
Last edited by suomynona; Sep 23, 2007 at 10:00 PM.