From aa54b9714ed93949d3e2c4c948b2dc26fe58c7b1 Mon Sep 17 00:00:00 2001 From: Paul Liverman III Date: Thu, 11 May 2017 14:44:54 -0700 Subject: [PATCH] placeholders for new element types --- elements/button.lua | 49 +++++++++++++++++++++++++++++++++++++++ elements/button.moon | 9 +++++++ elements/dynamicGrid.lua | 49 +++++++++++++++++++++++++++++++++++++++ elements/dynamicGrid.moon | 9 +++++++ elements/grid.lua | 49 +++++++++++++++++++++++++++++++++++++++ elements/grid.moon | 9 +++++++ elements/scrollbox.lua | 49 +++++++++++++++++++++++++++++++++++++++ elements/scrollbox.moon | 9 +++++++ 8 files changed, 232 insertions(+) create mode 100644 elements/button.lua create mode 100644 elements/button.moon create mode 100644 elements/dynamicGrid.lua create mode 100644 elements/dynamicGrid.moon create mode 100644 elements/grid.lua create mode 100644 elements/grid.moon create mode 100644 elements/scrollbox.lua create mode 100644 elements/scrollbox.moon diff --git a/elements/button.lua b/elements/button.lua new file mode 100644 index 0000000..2cdf58c --- /dev/null +++ b/elements/button.lua @@ -0,0 +1,49 @@ +local graphics +graphics = love.graphics +local element = require(tostring((...):sub(1, -7)) .. "/element") +local button +do + local _class_0 + local _parent_0 = element + local _base_0 = { } + _base_0.__index = _base_0 + setmetatable(_base_0, _parent_0.__base) + _class_0 = setmetatable({ + __init = function(self, parent, data) + if data == nil then + data = { } + end + self.parent, self.data = parent, data + _class_0.__parent.__init(self, self.parent, self.data) + if self.data.type == "element" then + self.data.type = "button" + end + end, + __base = _base_0, + __name = "button", + __parent = _parent_0 + }, { + __index = function(cls, name) + local val = rawget(_base_0, name) + if val == nil then + local parent = rawget(cls, "__parent") + if parent then + return parent[name] + end + else + return val + end + end, + __call = function(cls, ...) + local _self_0 = setmetatable({}, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + if _parent_0.__inherited then + _parent_0.__inherited(_parent_0, _class_0) + end + button = _class_0 + return _class_0 +end diff --git a/elements/button.moon b/elements/button.moon new file mode 100644 index 0000000..4eb375d --- /dev/null +++ b/elements/button.moon @@ -0,0 +1,9 @@ +import graphics from love + +element = require "#{(...)\sub 1, -7}/element" + +class button extends element + new: (@parent, @data={}) => + super @parent, @data + + @data.type = "button" if @data.type == "element" diff --git a/elements/dynamicGrid.lua b/elements/dynamicGrid.lua new file mode 100644 index 0000000..50e4974 --- /dev/null +++ b/elements/dynamicGrid.lua @@ -0,0 +1,49 @@ +local graphics +graphics = love.graphics +local element = require(tostring((...):sub(1, -12)) .. "/element") +local dynamicGrid +do + local _class_0 + local _parent_0 = element + local _base_0 = { } + _base_0.__index = _base_0 + setmetatable(_base_0, _parent_0.__base) + _class_0 = setmetatable({ + __init = function(self, parent, data) + if data == nil then + data = { } + end + self.parent, self.data = parent, data + _class_0.__parent.__init(self, self.parent, self.data) + if self.data.type == "element" then + self.data.type = "dynamicGrid" + end + end, + __base = _base_0, + __name = "dynamicGrid", + __parent = _parent_0 + }, { + __index = function(cls, name) + local val = rawget(_base_0, name) + if val == nil then + local parent = rawget(cls, "__parent") + if parent then + return parent[name] + end + else + return val + end + end, + __call = function(cls, ...) + local _self_0 = setmetatable({}, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + if _parent_0.__inherited then + _parent_0.__inherited(_parent_0, _class_0) + end + dynamicGrid = _class_0 + return _class_0 +end diff --git a/elements/dynamicGrid.moon b/elements/dynamicGrid.moon new file mode 100644 index 0000000..4fbc71a --- /dev/null +++ b/elements/dynamicGrid.moon @@ -0,0 +1,9 @@ +import graphics from love + +element = require "#{(...)\sub 1, -12}/element" + +class dynamicGrid extends element + new: (@parent, @data={}) => + super @parent, @data + + @data.type = "dynamicGrid" if @data.type == "element" diff --git a/elements/grid.lua b/elements/grid.lua new file mode 100644 index 0000000..704e069 --- /dev/null +++ b/elements/grid.lua @@ -0,0 +1,49 @@ +local graphics +graphics = love.graphics +local element = require(tostring((...):sub(1, -5)) .. "/element") +local grid +do + local _class_0 + local _parent_0 = element + local _base_0 = { } + _base_0.__index = _base_0 + setmetatable(_base_0, _parent_0.__base) + _class_0 = setmetatable({ + __init = function(self, parent, data) + if data == nil then + data = { } + end + self.parent, self.data = parent, data + _class_0.__parent.__init(self, self.parent, self.data) + if self.data.type == "element" then + self.data.type = "grid" + end + end, + __base = _base_0, + __name = "grid", + __parent = _parent_0 + }, { + __index = function(cls, name) + local val = rawget(_base_0, name) + if val == nil then + local parent = rawget(cls, "__parent") + if parent then + return parent[name] + end + else + return val + end + end, + __call = function(cls, ...) + local _self_0 = setmetatable({}, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + if _parent_0.__inherited then + _parent_0.__inherited(_parent_0, _class_0) + end + grid = _class_0 + return _class_0 +end diff --git a/elements/grid.moon b/elements/grid.moon new file mode 100644 index 0000000..5f5d5c3 --- /dev/null +++ b/elements/grid.moon @@ -0,0 +1,9 @@ +import graphics from love + +element = require "#{(...)\sub 1, -5}/element" + +class grid extends element + new: (@parent, @data={}) => + super @parent, @data + + @data.type = "grid" if @data.type == "element" diff --git a/elements/scrollbox.lua b/elements/scrollbox.lua new file mode 100644 index 0000000..e9f86d2 --- /dev/null +++ b/elements/scrollbox.lua @@ -0,0 +1,49 @@ +local graphics +graphics = love.graphics +local element = require(tostring((...):sub(1, -10)) .. "/element") +local scrollbox +do + local _class_0 + local _parent_0 = element + local _base_0 = { } + _base_0.__index = _base_0 + setmetatable(_base_0, _parent_0.__base) + _class_0 = setmetatable({ + __init = function(self, parent, data) + if data == nil then + data = { } + end + self.parent, self.data = parent, data + _class_0.__parent.__init(self, self.parent, self.data) + if self.data.type == "element" then + self.data.type = "scrollbox" + end + end, + __base = _base_0, + __name = "scrollbox", + __parent = _parent_0 + }, { + __index = function(cls, name) + local val = rawget(_base_0, name) + if val == nil then + local parent = rawget(cls, "__parent") + if parent then + return parent[name] + end + else + return val + end + end, + __call = function(cls, ...) + local _self_0 = setmetatable({}, _base_0) + cls.__init(_self_0, ...) + return _self_0 + end + }) + _base_0.__class = _class_0 + if _parent_0.__inherited then + _parent_0.__inherited(_parent_0, _class_0) + end + scrollbox = _class_0 + return _class_0 +end diff --git a/elements/scrollbox.moon b/elements/scrollbox.moon new file mode 100644 index 0000000..428b35e --- /dev/null +++ b/elements/scrollbox.moon @@ -0,0 +1,9 @@ +import graphics from love + +element = require "#{(...)\sub 1, -10}/element" + +class scrollbox extends element + new: (@parent, @data={}) => + super @parent, @data + + @data.type = "scrollbox" if @data.type == "element"