tegrine

Crates.iotegrine
lib.rstegrine
version0.1.3
created_at2025-09-03 08:30:38.200212+00
updated_at2025-09-03 09:14:56.473169+00
descriptionDraw in a Terminal -- Ordered with Instances -> Dots like 2D Vertex/Pixels
homepage
repository
max_upload_size
id1822165
size19,474
(daex3)

documentation

README

Example drawing a line

use anyhow::Result;
use tegrine::instances::{Tegrine, D2, Instance, Dot, RGBA};
use std::{thread::sleep, time::Duration};


fn main() -> Result<()> {
	let mut z = Tegrine::new()?;

	{
		let i = z.push_instance(Instance::default());

		z.x[i].push_dot(Dot::new_vertex(
			D2::new(z.ws.x / 2, z.ws.y / 2),
			RGBA::new(255, 0, 0, 255),
			vec![1]
		));

		z.x[i].push_dot(Dot::new(
			D2::new(
				(z.ws.x as f64 / 1.5) as isize,
				(z.ws.y as f64 / 1.3) as isize,
			),
			RGBA::new(255, 0, 0, 255)
		));
	}

	z.draw(&D2::new(0, 0))?;
	sleep(Duration::from_secs(6));

	Ok(())
}
Commit count: 0

cargo fmt