How to control screen coordinates?

1

I need to develop a Lua program (desktop application) that manipulates screen coordinates, it does not have to be a graphical environment (GUI), but I need to be able to, for example, position in the coordinate (10, 10) - line 10 , column 10, and then display text, and then re-position in those coordinates to display other text. The only way is to use a graphical toolkit? Thank you.

    
asked by anonymous 02.07.2014 / 04:01

1 answer

3

If you want to move the cursor on a terminal screen, you can use escape sequences for terminals, such as lua-term / a>.

Your example would be:

term.cursor.goto(10, 10)
io.write("um texto")
...
term.cursor.goto(10, 10)
io.write("outro texto")

You do not even need to use a library: term.cursor.goto(10, 10) is equivalent to io.write("7[10;10H") . See also message .

For a list of the most common escape sequences, see for example link .

    
09.07.2014 / 03:44