Class: console

The console of luxinia is nothing more than a screen containing lot's of letters. Each letter has a color and a style value that can be set individually. The console has also a keyinput queue that represents the keys that the user has pressed since the last frame. This queue is only filled if the console is active.

Methods:

Method overview:


active ([boolean active])
returns: ([boolean active])
returns activestatus if no arguments given and sets activestatus if arg is boolean
clear ()
returns: ()
clears the console screen
get (int x,y)
returns: (char c, int r,g,b,style)
Returns character information at given x,y
height ()
returns: (int height)
returns height of console
popKey ()
returns: ([char key],[int keycode])
returns a key and its keycode, that was pressed or nil. tab,backspace and enter get converted to regular keycodes, all other special keys stay as original keycode
poperr ()
returns: ([string err])
returns (if available) a line that was printed to error stream. If you like to provide an mechanism that prints out information that comes from the Luxinia C core, you need to pop the messages from this queue.
popstd ()
returns: ([string err])
returns (if available) a line that was printed to standard stream. If you like to provide an mechanism that prints out information that comes from the Luxinia C core, you need to pop the messages from this queue.
pos ([int x,y])
returns: ([int x,y])
returns position or sets position
put (string text,[int style],[int r,g,b])
returns: ()
writes the string given by text to the console. Stylecodes are:
  1. 1: Bold
  2. 2: Italic
  3. 4: Underline
  4. 8: Strikeout
  5. 16: Smaller
If you want to combine the values, just make the sum of the styles you want to use(i.e. 2+4+16).
width ()
returns: (int width)
returns width of console