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

io.read() between 2 x coordinates

Started by TheRockettek, 01 August 2016 - 02:43 PM
TheRockettek #1
Posted 01 August 2016 - 04:43 PM
For a program i am making a part which needs user input in a box but i cant find out a way to make it that read() only shows between the 2 x coordinates instead of doing the entire screen. Im quite stumped. Can anyone help? :)/>
Lupus590 #2
Posted 01 August 2016 - 08:17 PM
so you want an input box?
TheRockettek #3
Posted 01 August 2016 - 09:15 PM
Ya. Pretty much
KingofGamesYami #4
Posted 01 August 2016 - 09:57 PM
Step 1) make a window at those coordinates
Step 2) redirect
Step 3) reead()
TheRockettek #5
Posted 01 August 2016 - 10:08 PM
Except i want it like you type and once you click out the area it stops typing :/
(Like a normal input box)
Emma #6
Posted 02 August 2016 - 04:31 AM
Except i want it like you type and once you click out the area it stops typing :/
(Like a normal input box)

There is no built in implementation for this, you will have to write your own, or you can find someone else's. I have an implementation of this here: http://pastebin.com/D7TeDJJH, it would need a tiny bit of tweaking to let you click out of it but it shouldn't be too hard (Just add a mouse_click event listener).