placeholders for new element types

This commit is contained in:
Paul Liverman III 2017-05-11 14:44:54 -07:00
parent 8182d904db
commit aa54b9714e
8 changed files with 232 additions and 0 deletions

49
elements/button.lua Normal file
View File

@ -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

9
elements/button.moon Normal file
View File

@ -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"

49
elements/dynamicGrid.lua Normal file
View File

@ -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

View File

@ -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"

49
elements/grid.lua Normal file
View File

@ -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

9
elements/grid.moon Normal file
View File

@ -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"

49
elements/scrollbox.lua Normal file
View File

@ -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

9
elements/scrollbox.moon Normal file
View File

@ -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"