pixie/examples/image_tiled.nim

19 lines
363 B
Nim
Raw Normal View History

2021-02-25 16:57:49 +00:00
import pixie
2021-02-25 18:05:46 +00:00
let image = newImage(200, 200)
2021-02-25 16:57:49 +00:00
image.fill(rgba(255, 255, 255, 255))
2021-08-06 19:38:03 +00:00
let path = newPath()
2021-02-25 16:57:49 +00:00
path.polygon(
vec2(100, 100),
70,
sides = 8
)
2022-02-14 04:02:37 +00:00
let paint = newPaint(TiledImagePaint)
paint.image = readImage("examples/data/mandrill.png")
2021-08-06 23:08:21 +00:00
paint.imageMat = scale(vec2(0.08, 0.08))
image.fillPath(path, paint)
2021-02-25 16:57:49 +00:00
image.writeFile("examples/image_tiled.png")