summaryrefslogtreecommitdiffstats
path: root/examples/images.lua
diff options
context:
space:
mode:
Diffstat (limited to 'examples/images.lua')
-rw-r--r--examples/images.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/images.lua b/examples/images.lua
new file mode 100644
index 0000000..71ed636
--- /dev/null
+++ b/examples/images.lua
@@ -0,0 +1,22 @@
1package.cpath = package.cpath .. ";../target/debug/?.so"
2package.path = package.path .. ";../lua-bindings/?.lua"
3
4local dia = require("diaphragm")
5
6dia.draw({
7 draw = function(self)
8 local stack = dia.layout.vstack({
9 elements = {
10 dia.image.new({ path = "./res/drawing.svg", width = 100 }),
11 dia.image.new({ path = "./res/drawing.svg" }),
12 dia.image.new({ path = "./res/epnix-logo.png" }),
13 dia.image.new({ path = "./res/drawing.svg" }),
14 dia.image.new({ path = "./res/drawing.svg" }),
15 },
16 })
17 dia.constraint.same_width(stack.elements)
18 dia.constraint.inset(self, stack)
19 stack:draw()
20 end,
21 output = {},
22})