waow

Crates.iowaow
lib.rswaow
version0.10.3
sourcesrc
created_at2024-03-14 22:33:04.294667
updated_at2024-03-19 21:34:07.470427
descriptionA begginer friendly creative coding library
homepage
repository
max_upload_size
id1174221
size23,528
(samgcode)

documentation

README

waow

waow is a creative coding library that is intended to be simple and beginner friendly.

Heres what you can do with waow:

  • Draw simple shapes to the screen
    • currently: rectangle, circle, but more will be added soon
  • Draw an image (essentially an array of pixels)
  • Create custom shapes with the Drawable trait
  • Get user input using the Input module

Quick start

In 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

Commit count: 0

cargo fmt