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.
The Graphics struct needs a mutable slice to work on and so mostly likely you'll need to create the struct and pass in the buffer from the rendering library every frame.
Usage
Cargo
In your Cargo.toml file add
= "0.1.0"
Code
This bit of boilerplate/framework must be used inside your code to use this library:
let mut buffer: = ; //800 x 600 RGBA
let mut graphics = new?;
Drawing is then quite simple:
graphics.draw_text;
graphics.draw_image;
graphics.draw_rect;
Features
Both are enabled by default
image_loading
Load files as Images
Code
let image = load_image?;
graphics.draw_image;
serde_derive
Adds derive Serialize and Deserialize for Rect