Posted 22 February 2013 - 04:25 AM
free text box feel free to use it in your ui api
Spoiler
function txtBox (XPos,YPos,length,isCensored)
if isCensored == true then cen = "*"
else cen = nil
end
term.setCursorPos (XPos,YPos)
term.setBackgroundColor (1)
for i = 1,length do
write " "
end
term.setTextColor (32768)
term.setCursorPos(XPos,YPos)
while true do
local event, arg, x,y = os.pullEvent("mouse_click")
if y == YPos and x >= XPos and x <= XPos + length then
local txtBox = read(cen)
term.setBackgroundColor (32768)
term.setTextColor (1)
return txtBox
end
end
end