pixie/examples/rounded_rectangle.nim

19 lines
308 B
Nim
Raw 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
x = 50.0
y = 50.0
w = 100.0
h = 100.0
2020-12-04 17:33:58 +00:00
r = 25.0
2021-01-29 20:17:24 +00:00
var path: Path
2021-02-09 04:50:39 +00:00
path.roundedRect(vec2(x, y), vec2(w, h), r, r, r, r)
2021-01-29 20:17:24 +00:00
2021-02-14 04:45:27 +00:00
image.fillPath(path, rgba(0, 255, 0, 255))
2020-12-01 17:49:41 +00:00
image.writeFile("examples/rounded_rectangle.png")