v2 / vlib / gg / testdata / draw_elipses.vv
23 lines · 21 sloc · 813 bytes · 412c7b0368469a8c386ea45e0775abbe780a1929
Raw
1import gg
2
3const thickness = f32(5)
4
5gg.start(
6 window_title: 'Ellipses'
7 width: 600
8 height: 400
9 frame_fn: fn (mut ctx gg.Context) {
10 ctx.begin()
11 drot := f32(ctx.frame) / 60
12 ctx.draw_ellipse_filled(100, 100, 100, 50, gg.red)
13 ctx.draw_ellipse_empty(100, 100, 50, 25, gg.black)
14 ctx.draw_ellipse_filled_rotate(300, 100, 100, 50, -drot, gg.blue)
15 ctx.draw_ellipse_empty_rotate(300, 100, 50, 25, -drot, gg.black)
16 ctx.draw_ellipse_filled_rotate(500, 100, 100, 50, drot, gg.yellow)
17 ctx.draw_ellipse_empty_rotate(500, 100, 50, 25, drot, gg.black)
18 ctx.draw_ellipse_thick(100, 300, 100, 50, thickness, gg.green)
19 ctx.draw_ellipse_thick_rotate(300, 300, 100, 50, thickness, drot, gg.purple)
20 ctx.draw_ellipse_thick_rotate(500, 300, 100, 50, thickness, -drot, gg.indigo)
21 ctx.end()
22 }
23)
24