console.x read/write property

The console.x property gets or sets the current cursor column position.

Example

local console = require "console" console.clear() local message = "Hello World !" console.color = "lightyellow" console.y = math.floor(console.height/2) for x = 1,console.width-message:len() do console.x = x-1 console.write(string.rep(" ", message:len())) console.x = x console.write(message) sys.sleep(1) end