User manual
Instruction set
7
3.2. Graphic functions
Besides textual functionality, LCD-Term offers a set of sequences that can be used for
drawing. Simple forms such as lines, rectangles and circles can be filled with different
patterns, text can be positioned on a per pixel basis instead of a per character one, a
screen can be prepared in a back buffer page and being blit to the front buffer. Icons and
special symbols are supported through the GIF feature.
Most of the functions are not shown on screen directly but rendered into one of the two
back buffers. This allows to set a screen up without bothering the user with multiple
updates of the same region (e.g. when drawing something on top of an image). There is
a function controlling and forcing the screen update which can be called after rendering
the back buffer is finished.
Command Description Example LUA string
Graphic primitives
x Sets or clears a pixel at position [y; x].
The third parameter c decides wheter
the pixel is set (c > 0) or cleared (c =
0).
ESC[y;x;cx
ESC[10;40;1x
"\27[10;20;1x"
y Draw a line from [y0; x0] to [y1;
x1]. The last parameter p specifies
a repeating pattern where each bit
corresponds with a pixel. A set bit
results in a set pixel.
ESC[y0;x0;y1;x1;py
ESC[0;0;63;127;255y
"\27[63;0;0;127;85y"
v Draw a rectangle from [y0; x0] to [y1;
x1]. The last parameter p specifies a
repeating pattern to be used for the
rectangle's outlines.
ESC[y0;x0;y1;x1;pv
ESC[0;0;63;127;15v
"\27[63;0;0;
127;111v"
w Fill a rectangle from [y0; x0] to [y1;
x1]. The last parameter p (0-15) is the
number of one of sixteen fill pattern.
ESC[y0;x0;y1;x1;pw
ESC[0;0;63;127;7w
"\27[62;1;1;126;3w"
k Draw/fill a circle with center [y; x]
and radius r. Parameter fill selects
wheter p is a fill (fill = 1) or an
outline pattern.
ESC[y;x;r;fill;pk
ESC[32;64;20;1;7k
"\27[32;64;30;0;
111k"
Graphic cursor
G Set graphic cursor to pixel coordinates
[y; x]. GIFs and text functions as well
as printing strings work relative to
this position.
ESC[y;xG ESC[10;30G "\27[57;100G"
GIF support
Y Display GIF num at current graphic
cursor position.
ESC[numY ESC[1Y "\27[3Y"
Buffers and blitting
V Switch to buffer num. All further
drawing is done in the selected buffer.
ESC[numV ESC[0V "\27[1V"