pixie/examples/square.nim

16 lines
265 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-02-18 19:55:26 +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(255, 0, 0, 255)
2021-02-18 19:55:26 +00:00
let
pos = vec2(50, 50)
wh = vec2(100, 100)
2021-01-29 20:17:24 +00:00
ctx.fillRect(rect(pos, wh))
2020-12-01 17:49:41 +00:00
image.writeFile("examples/square.png")