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.
Shape defines the polymorphic interface that every Fazen2d drawable must satisfy. GraphicsRenderer::draw() accepts a Shape&, so any class deriving from Shape works transparently with the renderer — you can store heterogeneous primitives in a single container and draw them all through one uniform call.
Header
Shape.h is included transitively through any concrete shape header (Point.h, Line.h, etc.) and through the top-level Fazen.h umbrella header.
Interface
Pure Virtual Methods
| Method | Description |
|---|---|
draw() | Writes shape characters and color attributes into the ConsoleHandler back-buffer. Called once per frame by the render loop. |
translate(float dx, float dy) | Moves the shape by dx columns and dy rows. Implementations are responsible for bounds checking against ConsoleHandler::GetConsoleWidth() and ConsoleHandler::GetConsoleHeight(). |
Built-in Implementations
Point
Single character cell at a given (x, y) position with a chosen color and Unicode character.
Line
Straight line between two endpoints, rasterized with Bresenham’s algorithm.
Box
Solid filled rectangle defined by an origin, width, height, color, and fill character.
Circle
Filled circular region drawn using a per-cell distance formula over a bounding square.
Text
Wide-character string rendered into consecutive console cells at a given position.
Custom Shapes
Derive from
Shape to build your own drawable primitives that work seamlessly with the renderer.Custom Shape Example
Derive publicly fromShape, store your geometry as member data, and implement both pure virtuals. Use ConsoleHandler to write directly into the back-buffer.