196 void Shadow(
int column,
int row,
int width,
int height);
The cells of the screen and the place of the text cursor.
Definition textgrid.h:99
void Shadow(int column, int row, int width, int height)
Darken the cells one row below and two columns right of a box, as the shadow of a dialog of the QBASI...
const TextCell & At(int column, int row) const
void Box(int column, int row, int width, int height, CgaColor foreground, CgaColor background, bool doubled)
Draw the frame of a box with the lines of code page 437 and fill its inside.
std::optional< std::array< int, 2 > > cursor
The cell the text cursor blinks in, or none when it does not show.
Definition textgrid.h:199
void Write(int column, int row, std::u32string_view text, CgaColor foreground, CgaColor background, int width=-1)
Write text along a row, a cell for each code point, cut at width cells.
void Fill(int column, int row, int width, int height, std::uint8_t glyph, CgaColor foreground, CgaColor background)
Fill a rectangle of cells with one character in two colours.
TextCell & At(int column, int row)
void WriteUtf8(int column, int row, std::string_view text, CgaColor foreground, CgaColor background, int width=-1)
Write UTF-8 text along a row, as Write() writes code points.
Definition assetimport.h:11
constexpr int CELL_WIDTH
The width of a cell in pixels.
Definition textgrid.h:24
CgaColor
The 16 colours of CGA, by their number.
Definition textgrid.h:30
@ Cyan
Definition textgrid.h:34
@ White
Definition textgrid.h:46
@ LightBlue
Definition textgrid.h:40
@ Yellow
Definition textgrid.h:45
@ LightGreen
Definition textgrid.h:41
@ DarkGray
Definition textgrid.h:39
@ Blue
Definition textgrid.h:32
@ Magenta
Definition textgrid.h:36
@ LightCyan
Definition textgrid.h:42
@ Green
Definition textgrid.h:33
@ Black
Definition textgrid.h:31
@ Brown
Definition textgrid.h:37
@ Red
Definition textgrid.h:35
@ LightMagenta
Definition textgrid.h:44
@ LightRed
Definition textgrid.h:43
@ LightGray
Definition textgrid.h:38
constexpr int CELL_HEIGHT
The height of a cell in pixels.
Definition textgrid.h:27
std::u32string DecodeUtf8(std::string_view text)
constexpr int GRID_ROWS
The rows of the grid.
Definition textgrid.h:21
constexpr std::array< std::array< std::uint8_t, 3 >, 16 > CGA_PALETTE
The red, green, and blue of each colour of CGA, by its number.
Definition textgrid.h:50
constexpr int GRID_COLUMNS
The columns of the grid.
Definition textgrid.h:18
constexpr std::uint8_t REPLACEMENT_GLYPH
The glyph drawn for a character code page 437 does not have.
Definition textgrid.h:70
std::string EncodeUtf8(std::u32string_view text)
std::uint8_t Cp437FromCodepoint(char32_t codepoint)
A cell of the grid.
Definition textgrid.h:73
bool underline
Definition textgrid.h:77
CgaColor foreground
Definition textgrid.h:75
std::uint8_t glyph
Definition textgrid.h:74
CgaColor background
Definition textgrid.h:76