use notan::draw::*;
use notan::prelude::*;
#[notan_main]
fn main() -> Result<(), String> {
notan::init().add_config(DrawConfig).draw(draw).build()
}
fn draw(gfx: &mut Graphics) {
let mut mask = gfx.create_draw();
mask.rect((180.0, 180.0), (440.0, 240.0));
let mut draw = gfx.create_draw();
draw.clear(Color::BLACK);
draw.mask(Some(&mask));
draw.triangle((400.0, 100.0), (100.0, 500.0), (700.0, 500.0))
.color(Color::RED);
draw.mask(None);
draw.triangle((400.0, 100.0), (100.0, 500.0), (700.0, 500.0))
.color(Color::YELLOW)
.scale(0.5, 0.5);
gfx.render(&draw);
}