pixie/examples/rounded_rectangle.nim

17 lines
297 B
Nim
Raw Permalink Normal View History

2021-02-18 19:39:11 +00:00
import pixie
2020-12-01 17:49:41 +00:00
2021-01-29 20:17:24 +00:00
let image = newImage(200, 200)
2020-12-04 16:32:03 +00:00
image.fill(rgba(255, 255, 255, 255))
2020-12-01 17:49:41 +00:00
let ctx = newContext(image)
ctx.fillStyle = rgba(0, 255, 0, 255)
2020-12-01 17:49:41 +00:00
let
2021-02-18 22:23:54 +00:00
pos = vec2(50, 50)
wh = vec2(100, 100)
2020-12-04 17:33:58 +00:00
r = 25.0
2021-01-29 20:17:24 +00:00
ctx.fillRoundedRect(rect(pos, wh), r)
2021-02-18 22:30:47 +00:00
image.writeFile("examples/rounded_rectangle.png")