From 7dbc5594b05ec8acf6829ff43635602de2ca90e4 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sat, 11 Jun 2022 17:09:14 -0400 Subject: [PATCH] #63 div graphics element --- graphics/elements/div.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 graphics/elements/div.lua diff --git a/graphics/elements/div.lua b/graphics/elements/div.lua new file mode 100644 index 0000000..cb56aa0 --- /dev/null +++ b/graphics/elements/div.lua @@ -0,0 +1,21 @@ +-- Div (Division, like in HTML) Graphics Element + +local element = require("graphics.element") + +---@class div_args +---@field parent graphics_element +---@field x? integer 1 if omitted +---@field y? integer 1 if omitted +---@field width? integer parent width if omitted +---@field height? integer parent height if omitted +---@field gframe? graphics_frame frame instead of x/y/width/height +---@field fg_bg? cpair foreground/background colors + +-- new div element +---@param args div_args +local function div(args) + -- create new graphics element base object + return element.new(args).get() +end + +return div