#vga #figures

no-std vga-figures

Library for drawing various shapes

3 unstable releases

0.2.1 May 12, 2024
0.2.0 Jul 23, 2020
0.1.0 Jul 16, 2020

#120 in No standard library

25 downloads per month
Used in cipherdogs-logo-lib

GPL-3.0 license

15KB
94 lines

vga-figures

crates.io docs.rs

🎨 Library for drawing various shapes

Figures2D

use vga::colors::Color16;
use vga::writers::{Graphics640x480x16, GraphicsWriter};
use vga_figures::figures2d::Figures2D;

let mode = Graphics640x480x16::new();
mode.set_mode();
mode.clear_screen(Color16::Black);

let figures = Figures2D::new(mode);
figures.line(10, 10, 10, 60, Color16::White);
figures.rectangle(25, 10, 75, 60, Color16::White);
figures.ellipse(115, 35, 25, 25, Color16::White);

let arr = [150, 100, 200, 120, 240, 180, 210, 200, 150, 150, 100, 200];
figures.polygon(&arr, Color16::White);

figures.text(10, 80, "Test text", Color16::White);

lib.rs:

Library for drawing various shapes

Dependencies

~1.5MB
~22K SLoC