2 releases
0.0.2 | May 9, 2024 |
---|---|
0.0.1 | Apr 27, 2024 |
#504 in Graphics APIs
70 downloads per month
14KB
225 lines
README
[!IMPORTANT]
This project is currently under construction. Expect issues and bugs to arise. If this occurs, please submit a bug report in this github and I will try to attend it promptly.
Crate = https://crates.io/crates/trender
TODO:
- make readme
- documentation (Working on it)
Change log
0.0.2 - README updates, added to github wiki, playing around with the 3d renderer, not working how I want it to at the moment.
0.0.1 - Inital push to crates.io for testing. Was not made to be downloaded but thank you to the 200+ people who looked at Trender!
lib.rs
:
This is a simple(ish) graphics library that runs in the terminal. Draw a "real" pixel
Because the terminal primarily uses text, modifying the "character slot" (or whatever it is called) results in a vertical rectangle. I call this a real pixel.
To draw a blue real pixel: draw::real_pixel
This is the base of the whole graphics system for now. I will be working on a way to get more definition in the terminal. I am looking into custom characters.
Draw a square pixel on the terminal
The terminal uses rectangular "pixels" which results in the need to draw 2 rectangles side by side to create a square.
To make a custom RGB value, use Rgb(r,g,b)
for example:
draw::pixel(1,1, Rgb {255, 0, 0});
for a perfect RED
Fills row of terminal with a specific color
fill_row(5, Rgb { r: (255), g: (255), b: (255) });
Utilizing the [pixel][pixel] function to draw a row of pixels. Fills row of terminal with a specific color
fill_colum(5, Rgb { r: (255), g: (255), b: (255) });
Utilizing the [pixel][pixel] function to draw a colum of pixels. Fills the screen of the terminal with a specific color
fill_screen(Rgb { r: (255), g: (255), b: (255) });
Utilizing the [pixel][pixel] function to draw a colum of pixels. Fills the screen with random colors.
screen_test()
Fills row of terminal with random colors
fill_row(5);
Utilizing the [pixel][pixel] function to draw a row of pixels. clears the terminal
Call clear()
to wipe the terminal clear!
Maps out set values in a 2D space
Draws a 2d line on the terminal
This draws a path from 2 points utilizing the pixel function
d2_path(points: &[((1,0,1.0),(5.0,5.0)),((5,0,5.0),(2.0,5.0))])
Dependencies
~4–13MB
~168K SLoC