2021-02-09 04:50:39 +00:00
|
|
|
import pixie, chroma, vmath
|
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
|
|
|
|
2020-12-01 17:49:41 +00:00
|
|
|
image.fillPath(path, rgba(255, 0, 0, 255))
|
|
|
|
|
|
|
|
image.writeFile("examples/rounded_rectangle.png")
|