Drawing
#
mutable char
| : CamomileLibrary.UChar.t | ; | (* | The unicode character. | *) |
#
mutable bold
| : bool | ; | (* | Whether the character is in bold or not. | *) |
#
mutable underline
| : bool | ; | (* | Whether the character is underlined or not. | *) |
#
mutable blink
| : bool | ; | (* | Whether the character is blinking or not. | *) |
#
mutable reverse
| : bool | ; | (* | Whether the character is in reverse video mode or not. | *) |
#
mutable foreground
| : LTerm_style.color | ; | (* | The foreground color. | *) |
#
mutable background
| : LTerm_style.color | ; | (* | The background color. | *) |
Type of a point in a matrix of styled characters.
Type of a matrix of points. The matrix is indexed by lines
then columns, i.e. to access the point at line l
and column
c
in matrix m
you should use m.(l).(c)
.
matrix size
creates a matrix of the given size containing only
blank characters.
set_style point style
sets fields of point
according to
fields of style
. For example:
set_style point { LTerm_style.none with LTerm_style.bold = Some true }
will have the following effect:
point.bold <- true
Type of contexts. A context is used for drawing.
context m s
creates a context from a matrix m
of size
s
. It raises Invalid_argument
if s
is not the size of
m
.
Exception raised when trying to access a point that is outside the bounds of a context.
sub ctx rect
creates a sub-context from the given context. It
raises Out_of_bounds if the rectangle is not contained in the
given context.
clear ctx
clears the given context. It resets all styles to
their default and sets characters to spaces.
fill ctx ch
fills the given context with ch
.
fill_style style
fills the given context with style
.
point ctx row column
returns the point at given position in
ctx
. It raises Out_of_bounds if the coordinates are outside
the given context.
draw_char ctx row column ?style ch
sets the character at given
coordinates to ch
. It does nothing if the given coordinates
are outside the bounds of the context.
draw_string ctx row column ?style str
draws the given string
at given coordinates. This does not affect styles. str
may
contains newlines.
draw_styled ctx row column ?style text
draws the given styled
text at given coordinates.
Draws a string with the given alignment.
Draws a styled string with the given aglienment.
#
top
| : connection | ; | |||
#
bottom
| : connection | ; | |||
#
left
| : connection | ; | |||
#
right
| : connection | ; |
Type of a piece, given by its four connection.
Draws a piece. It may modify pieces around it.
draw_hline ctx row column length connection
draws an
horizontal line.
draw_hline ctx row column length connection
draws a vertical
line.
Draws a rectangle.