This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
diegodan1893's profile picture

Help with login screen gui.

Started by diegodan1893, 14 July 2012 - 02:19 PM
diegodan1893 #1
Posted 14 July 2012 - 04:19 PM
I'm doing a login screen (temporally very similar to MysticOS) but when the user writes a character in the user or password it deletes all the line.

This is how it is before write:

Spoiler

And this is after write (it happens even with only one character)
Spoiler

I tried with io.read() and read() but it's the same.
How can I fix it?

Sorry for my bad English.
MysticT #2
Posted 14 July 2012 - 06:30 PM
The problem is that read() deletes the line from the cursor position to the end each time it redraws, so you'll have to make your own function to read.
Take a look at the read function in bios.lua (inside .minecraft/mods/ComputerCraft/lua) to see how it works.
diegodan1893 #3
Posted 15 July 2012 - 11:46 AM
The problem is that read() deletes the line from the cursor position to the end each time it redraws, so you'll have to make your own function to read. Take a look at the read function in bios.lua (inside .minecraft/mods/ComputerCraft/lua) to see how it works.

Thanks, I make a new api with the new read() function and it works.