Crates.io | waow |
lib.rs | waow |
version | 0.10.3 |
source | src |
created_at | 2024-03-14 22:33:04.294667 |
updated_at | 2024-03-19 21:34:07.470427 |
description | A begginer friendly creative coding library |
homepage | |
repository | |
max_upload_size | |
id | 1174221 |
size | 23,528 |
waow
is a creative coding library that is intended to be simple and beginner friendly.
Heres what you can do with waow:
Drawable
traitInput
moduleIn cargo.toml:
[dependencies]
waow="0.10.3"
Then in main.rs:
// import waow
use waow::*;
// create the window
fn main() {
// initialize the code for the library to run
let app = App::create();
// create the window and start the draw loop
create(
app,
CanvasConfiguration {
width: 400,
height: 400,
background_color: Color::from_rgba(0.0, 0.0, 0.0, 1.0),
window_name: String::from("waow!"),
},
);
}
// the struct that holds your code
struct App {}
// add a method for creating the app
impl App {
pub fn create() -> Self {
return Self {};
}
}
// implement the Run trait so your code can effect thr canvas
impl Run for App {
// ran before the first frame is drawn
fn start(&mut self, canvas: &mut Canvas) {
}
// ran every time a frame is drawn
fn draw(&mut self, canvas: &mut Canvas, input: &Input) {
}
}
For info on how to use all of the features, check out the examples, or read the docs