~irimi1/nannou-experiments

ref: 8c7ca4f2ef18ed3a7c660793af2800f0ab51cfbd nannou-experiments/fiddling/unu/src/main.rs -rw-r--r-- 576 bytes
8c7ca4f2Manuel Groß unu: Make some basic shit with black bars on white 1 year, 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* https://guide.nannou.cc/tutorials/basics/draw-a-sketch.html */

use nannou::prelude::*;

fn main() {
    nannou::sketch(view).run();
}

fn view(app: &App, frame: Frame){
    // get canvas to draw on
    let draw = app.draw();

    draw.background().color(WHITE);

    for i in 0..20 {
        draw.rect()
            .x_y((-i as f32 * 100.0) + (1920.0 / 2.0), 0.0)
            .w_h(2.0 * (20.0 - i as f32), 500.0)
            .z_degrees(30.0 - (7.0 *i as f32))
            .color(BLACK);
    }

    // put everything on the frame
    draw.to_frame(app, &frame).unwrap();
}