termdraw

Crates.iotermdraw
lib.rstermdraw
version0.1.6
sourcesrc
created_at2024-01-19 00:15:09.374911
updated_at2024-01-20 23:00:07.687123
descriptionA crate, which allows you to draw in the terminal.
homepage
repositoryhttps://github.com/spiel0meister/termdraw
max_upload_size
id1104657
size20,194
spiel_meister (spiel0meister)

documentation

README

termdraw

A crate, which allows you to draw in the terminal.

Quick Start

You can find this crate on crates.io.

You can use cargo:

cargo add termdraw

Or include termdraw = "*" in the Cargo.toml file.

Exapmle

use crossterm::{
    cursor::SetCursorStyle,
    queue,
    style::Color::*,
    terminal::{Clear, ClearType},
};
use std::{
    io::{stdout, Result, Write},
    thread::sleep,
    time::Duration,
};

use termdraw::shape::{self, *};

fn main() -> Result<()> {
    let mut out = stdout();

    loop {
        queue!(out, Clear(ClearType::All))?;
        queue!(out, SetCursorStyle::SteadyBlock)?;

        draw_background!(out, Black);
        draw_custom_shape!(out, [0, 0, 10, 0, 5, 5], White, true);

        out.flush()?;

        sleep(Duration::from_millis(500));
    }
}
Commit count: 0

cargo fmt