Постоянные
Типы
Characters
(* One of Event.type constants (see above). *)
(* For mouse presses, releases and drags *)
(* For mouse presses, releases and drags *)
(* Size of screen in cells on resize *)
(* Size of screen in cells on resize *)
(* Mouse button that is pressed, 0 means release *)
(* Physical key code of the key pressed or released *)
(* The typed character on key press *)
(* Key modifiers set (see above) *)
Record that holds information on the event occurred
Переменные
TRUE on successful initialization, FALSE on error
Процедуры
Clears the internal back buffer with a grey foreground and a black background
Clears the internal back buffer with foreground fg
and background bg
Closes TermBox
Delay for ms
milliseconds
Fill a rectangular area of characters with ch
using the foreground (fg) and background (bg) colors. The top-left corner of the area is (x; y), width is w
and height is h
.
Synchronizes the internal back buffer with the terminal.
Nothing will change on the screen until Flush or Sync is called.
Given the (x; y) coordinate, returns data of the corresponding terminal cell.
Returns Graph.Window object of the terminal (only when Graph is used).
Returns TRUE if there are events in the events queue
Hides the text input cursor (moves it off the screen)
Hides the mouse cursor
Initializes TermBox. Sets Done to TRUE on success, FALSE otherwise.
Returns TRUE if fullscreen mode is currently used
Copies the next event in the queue to event
but does not remove it from the queue.
Writes at most limit
characters of s
in a line starting at position
(x; y) on to the terminal using the given foreground (fg) and background (bg) colors.
Sets background color bg
for the cell at position (x; y).
Fills the cell at (x; y) with character ch
and the given foreground (fg) and background (bg) colors.
Sets the character of the cell at (x; y).
Moves the text input cursor to cell (x; y).
Sets foreground color fg
for the cell at position (x; y).
Sets the font file for the terminal (if Graph is used)
Sets the terminal icon (if Graph is used)
Sets horizontal (x) and vertical (y) scale factors.
Call SetScale(2.0, 1.0) to two make pixels times wider.
Sets the title of the window
Sets zoom as an integer.
SetZoom(2) will make virtual pixels two times bigger in size.
Sets zoom as a real number.
Sets width and height of graphical window and settings flags (for Graph)
Shows the mouse cursor
Returns size of the terminal window in characters
Start TermBox timer. The timer event will be created every speed
fraction of a second.
Call StartTimer(1/30) for 30 timer events every second.
Switch to fullscreen mode
Switch to window mode
Sync comes handy when something causes desync between TermBox's understanding of a terminal buffer and the reality. Such as a third party process. Sync forces a complete resync between TermBox and the terminal, it may not be visually pretty though.
Waits until the next event, copies it in event
and removes it from the queue
Termbox is a module for creating cross-platform text-based interfaces