From f0870438a80ab6641b83dd240dc6e15ece04de56 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Fri, 3 Mar 2023 09:05:39 +0100 Subject: examples/images: init --- examples/images.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 examples/images.lua (limited to 'examples/images.lua') 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 @@ +package.cpath = package.cpath .. ";../target/debug/?.so" +package.path = package.path .. ";../lua-bindings/?.lua" + +local dia = require("diaphragm") + +dia.draw({ + draw = function(self) + local stack = dia.layout.vstack({ + elements = { + dia.image.new({ path = "./res/drawing.svg", width = 100 }), + dia.image.new({ path = "./res/drawing.svg" }), + dia.image.new({ path = "./res/epnix-logo.png" }), + dia.image.new({ path = "./res/drawing.svg" }), + dia.image.new({ path = "./res/drawing.svg" }), + }, + }) + dia.constraint.same_width(stack.elements) + dia.constraint.inset(self, stack) + stack:draw() + end, + output = {}, +}) -- cgit v1.2.3