summaryrefslogtreecommitdiffstats
path: root/examples/images.lua
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2023-03-03 09:05:39 +0100
committerMinijackson <minijackson@riseup.net>2023-03-03 09:05:39 +0100
commitf0870438a80ab6641b83dd240dc6e15ece04de56 (patch)
tree7e227d998f138c928b8e652569a9052d91fbd973 /examples/images.lua
parentf0db30c92348b0a71633c25d25569c925d0c77b7 (diff)
downloaddiaphragm-f0870438a80ab6641b83dd240dc6e15ece04de56.tar.gz
diaphragm-f0870438a80ab6641b83dd240dc6e15ece04de56.zip
examples/images: initwip
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})