Back to Projects

Alphabet Drawer

C# Console

A lightweight C# library for procedurally rendering ASCII art text. It uses a coordinate-based painting system to draw scalable, grid-aligned characters directly to the console buffer.

Integration

The library is a single static class. To use it, simply copy the `Alphabet.cs` file into your C# Console Application project.

Project Structure
  • MyConsoleApp/
  • ├── Program.cs
  • └── Alphabet.cs <-- Add this file

Core Concept

Unlike standard `Console.WriteLine`, this library does not print text line-by-line. Instead, it acts like a painter.

  • It uses Console.SetCursorPosition(x, y) to jump to specific coordinates.
  • Each letter is a 7x7 matrix of pixels.
  • You pass a "Column Index" to place letters side-by-side.

Drawing Single Letters

Call the static method corresponding to the letter you want to draw. Pass an integer `0` to draw it at the start of the line.

static void Main(string[] args) { // Draw 'A' at the first position (Index 0) Alphabet.A(0); // Draw 'B' at the second position (Index 1) Alphabet.B(1); Console.ReadKey(); }
Note: Index `1` automatically calculates the pixel offset (1 * 7 pixels = X position 7).

Drawing Words

To draw a word, simply increment the index for each subsequent letter. The library handles the spacing automatically.

Example: "HELLO"
Alphabet.H(0); Alphabet.E(1); Alphabet.L(2); Alphabet.L(3); Alphabet.O(4);

Advanced Positioning

You can control the vertical position using the static property Alphabet._row. This allows you to draw text on different lines.

// Line 1: "HI" Alphabet._row = 0; // Top of screen Alphabet.H(0); Alphabet.I(1); // Line 2: "BYE" (Move down by 8 pixels) Alphabet._row = 8; Alphabet.B(0); Alphabet.Y(1); Alphabet.E(2);

API Reference

Member Description
Alphabet._row int Sets the vertical starting Y-coordinate for all subsequent calls. Default is 0.
Alphabet.A(int col) Draws letter 'A'. col determines the X offset (col * 7).
Alphabet.B(int col) Draws letter 'B'.
... Methods for C through Y...
Alphabet.Z(int col) Draws letter 'Z'.