Crate buffer_graphics_lib
source · [−]Expand description
Buffer Graphics Lib
This is a simple graphics library for drawing to a buffer, mainly designed to be used with Rust Graphics Library or Pixels
It has basic shape drawing, bitmap text and image rendering.
Using the library is as simple as:
use buffer_graphics_lib::shapes::{DrawType, Shape};
let mut buffer = [0_u8; 800 * 600 * 4]; //800 x 600 RGBA
let mut graphics = Graphics::new(&mut buffer, 800, 600).unwrap();
graphics.draw_text("Some text", None, TextPos::Px(1, 1), TextSize::Normal, BLACK);
let shape = Rect::new((1,1),(15,16));
shape.render(&mut graphics, &DrawType::Fill(LIGHT_GRAY));