2021-02-18 19:39:11 +00:00
|
|
|
import pixie
|
2021-02-14 04:45:27 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
trees = readImage("examples/data/trees.png")
|
|
|
|
image = newImage(200, 200)
|
|
|
|
|
|
|
|
image.fill(rgba(255, 255, 255, 255))
|
|
|
|
|
|
|
|
var p: Path
|
2021-02-14 18:27:32 +00:00
|
|
|
p.polygon(100, 100, 70, sides = 8)
|
2021-02-14 04:45:27 +00:00
|
|
|
p.closePath()
|
|
|
|
|
|
|
|
var polyImage = newImage(200, 200)
|
|
|
|
polyImage.fillPath(p, rgba(255, 255, 255, 255))
|
|
|
|
|
|
|
|
image.draw(polyImage.shadow(
|
|
|
|
offset = vec2(2, 2),
|
|
|
|
spread = 2,
|
|
|
|
blur = 10,
|
|
|
|
color = rgba(0, 0, 0, 200)
|
|
|
|
))
|
|
|
|
image.draw(polyImage)
|
|
|
|
|
|
|
|
image.writeFile("examples/shadow.png")
|