Skip to content

Library which gives a way to draw in the terminal.

Notifications You must be signed in to change notification settings

spiel0meister/termdraw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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));
    }
}

About

Library which gives a way to draw in the terminal.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages