Module termbox2_nif

Erlang NIF for termbox2.

Version: 0.2.0

Authors: DROO AMOR (drew@axol.io).

Description

Erlang NIF for termbox2. Provides low-level terminal UI functions for BEAM languages.

Function Index

tb_init/0Initializes the termbox library.
tb_shutdown/0The library must be finalized using the tb_shutdown() function.
tb_width/0Returns the size of the internal back buffer (which is the same as terminal's window size in columns.
tb_height/0Returns the size of the internal back buffer (which is the same as terminal's window size in rows.
tb_clear/0Clears the internal back buffer using TB_DEFAULT color.
tb_present/0Synchronizes the internal back buffer with the terminal by writing to the tty.
tb_set_cursor/2Sets the position of the cursor.
tb_hide_cursor/0Hides the cursor, not every tty supports this.
tb_set_cell/5Sets the individual position of the screen at x,y to character ch, with foreground color fg and bg color bg.
tb_peek_event/1Wait for an event up to timeout_ms milliseconds, returning event details in a tuple.
tb_poll_event/0Same as tb_peek_event except no timeout, probably going to beat up erlang scheduler, maybe ?.
tb_print/5Print the string at the X and y locations with fg and background colors set.
tb_set_input_mode/1Sets the termbox input mode.
tb_set_output_mode/1Sets the termbox output mode.
tb_set_clear_attrs/2Sets the default foreground and background attributes used by tb_clear().

Function Details

tb_init/0

tb_init() -> any()

Initializes the termbox library. This function should be called before any other functions.

tb_shutdown/0

tb_shutdown() -> any()

The library must be finalized using the tb_shutdown() function. Called only when no more tb_ functions are required.

tb_width/0

tb_width() -> any()

Returns the size of the internal back buffer (which is the same as terminal's window size in columns

tb_height/0

tb_height() -> any()

Returns the size of the internal back buffer (which is the same as terminal's window size in rows

tb_clear/0

tb_clear() -> any()

Clears the internal back buffer using TB_DEFAULT color.

tb_present/0

tb_present() -> any()

Synchronizes the internal back buffer with the terminal by writing to the tty.

tb_set_cursor/2

tb_set_cursor(X, Y) -> any()

Sets the position of the cursor. Upper-left character is (0, 0).

tb_hide_cursor/0

tb_hide_cursor() -> any()

Hides the cursor, not every tty supports this.

tb_set_cell/5

tb_set_cell(X, Y, Ch, Fg, Bg) -> any()

Sets the individual position of the screen at x,y to character ch, with foreground color fg and bg color bg.

tb_peek_event/1

tb_peek_event(Timeout) -> any()

Wait for an event up to timeout_ms milliseconds, returning event details in a tuple.

tb_poll_event/0

tb_poll_event() -> any()

Same as tb_peek_event except no timeout, probably going to beat up erlang scheduler, maybe ?

tb_print/5

tb_print(X, Y, Fg, Bg, Str) -> any()

Print the string at the X and y locations with fg and background colors set.

tb_set_input_mode/1

tb_set_input_mode(Mode) -> any()

Sets the termbox input mode.

tb_set_output_mode/1

tb_set_output_mode(Mode) -> any()

Sets the termbox output mode.

tb_set_clear_attrs/2

tb_set_clear_attrs(Fg, Bg) -> any()

Sets the default foreground and background attributes used by tb_clear().


Generated by EDoc