import "io/console/buffer";
ScreenBuffer provides an off-screen buffer for easy drawing of characters and the associated attributes. It is then possible to put the content to the console in an optimized manner.
The buffer is by default transparent (when the character is '\00'
).
The buffer can be shared between tasks, the drawing state is not shared.
+------------+ /-----------\ ┌────────────┐ ╔════════════╗
| SIMPLE_BOX | | BEVEL_BOX | │ SINGLE_BOX │ ║ DOUBLE_BOX ║
+------------+ \-----------/ └────────────┘ ╚════════════╝
static function create(width: Integer, height: Integer): ScreenBuffer
function get_view(): ScreenBuffer
function get_view(x: Integer, y: Integer, width: Integer, height: Integer): ScreenBuffer
function get_width(): Integer
function get_height(): Integer
function reset()
function push()
function pop()
function clip(x: Integer, y: Integer, width: Integer, height: Integer)
function translate(dx: Integer, dy: Integer)
function put_char(x: Integer, y: Integer, background: Integer, foreground: Integer, char: Integer)
function put_text(x: Integer, y: Integer, background: Integer, foreground: Integer, text: String)
function put_text(x: Integer, y: Integer, background: Integer, foreground: Integer, text: String, off: Integer, len: Integer)
function fill(background: Integer, foreground: Integer, char: Integer)
function fill(x: Integer, y: Integer, width: Integer, height: Integer, background: Integer, foreground: Integer, char: Integer)
function draw_box(x: Integer, y: Integer, width: Integer, height: Integer, background: Integer, foreground: Integer, box_chars: String)
function draw_buffer(x: Integer, y: Integer, buf: ScreenBuffer)
function draw_buffer(dest_x: Integer, dest_y: Integer, src_x: Integer, src_y: Integer, width: Integer, height: Integer, buf: ScreenBuffer)
function update_console()
function update_console(x: Integer, y: Integer)
function update_console(dest_x: Integer, dest_y: Integer, src_x: Integer, src_y: Integer, width: Integer, height: Integer)