vga-figures

Crates.iovga-figures
lib.rsvga-figures
version0.2.1
sourcesrc
created_at2020-07-16 15:35:45.994122
updated_at2024-05-12 05:04:06.297878
descriptionLibrary for drawing various shapes
homepagehttps://github.com/deadblackclover/vga-figures
repositoryhttps://github.com/deadblackclover/vga-figures
max_upload_size
id265788
size40,862
DEADBLACKCLOVER (deadblackclover)

documentation

README

vga-figures

crates.io docs.rs

:art: 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);
Commit count: 25

cargo fmt