Crates.io | vga-figures |
lib.rs | vga-figures |
version | 0.2.1 |
source | src |
created_at | 2020-07-16 15:35:45.994122 |
updated_at | 2024-05-12 05:04:06.297878 |
description | Library for drawing various shapes |
homepage | https://github.com/deadblackclover/vga-figures |
repository | https://github.com/deadblackclover/vga-figures |
max_upload_size | |
id | 265788 |
size | 40,862 |
:art: Library for drawing various shapes
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);