Documentation Index
Fetch the complete documentation index at: https://mintlify.com/adi3120/Fazen2d/llms.txt
Use this file to discover all available pages before exploring further.
Line connects two console cell positions with a straight run of characters, computed using Bresenham’s line algorithm. The algorithm selects the integer cell closest to the ideal line path at each step, producing crisp, gap-free diagonals and perfect horizontals or verticals without floating-point per-pixel math. Internally, Line::draw() creates temporary Point objects for each rasterized cell and delegates to Point::draw(), so Point’s safe-margin bounds check applies to every cell along the line.
Header
Constructor
Column position of the first endpoint.
Row position of the first endpoint.
Column position of the second endpoint.
Row position of the second endpoint.
A
ConsoleColor enum value applied to every cell along the line (e.g. blueF, redF).Unicode code point written into each cell. Defaults to
0x2588 (█). Any valid wchar_t-range value is accepted.Methods
| Method | Returns | Description |
|---|---|---|
draw() | void | Rasterizes the line from (x1, y1) to (x2, y2) using Bresenham’s algorithm, placing a Point at each computed cell into the back-buffer. |
translate(float dx, float dy) | void | Shifts both endpoints by dx/dy. The move is applied only if all four resulting coordinates remain within console bounds and are non-negative. |
setX1(float) / getX1() | void / float | First endpoint X. |
setY1(float) / getY1() | void / float | First endpoint Y. |
setX2(float) / getX2() | void / float | Second endpoint X. |
setY2(float) / getY2() | void / float | Second endpoint Y. |
setColor(short) / getColor() | void / float | Color attribute applied to every cell. |
setCharacter(short) / getCharacter() | void / float | Unicode character code written at every cell. |
Example
Bresenham’s algorithm operates on integer cell positions internally. Sub-cell float values stored in the endpoints are truncated on each
draw() call. This means fractional positions accumulate correctly for smooth translate()-driven animation, but the rendered position only changes when the truncated integer advances to the next cell.