mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-18 16:04:22 +00:00
Template files are now expected to return a template table instead of calling loveframes.templates.Register
This commit is contained in:
parent
4692f1e6d8
commit
9977d8e106
3
init.lua
3
init.lua
@ -433,7 +433,8 @@ end
|
||||
-- loop through a list of all gui templates and require them
|
||||
for k, v in ipairs(templates) do
|
||||
if v.extension == "lua" then
|
||||
require(v.requirepath)
|
||||
local template = require(v.requirepath)
|
||||
loveframes.templates.Register(template)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1 +1 @@
|
||||
--[[------------------------------------------------
-- Love Frames - A GUI library for LOVE --
-- Copyright (c) 2012-2014 Kenny Shields --
--]]------------------------------------------------
--[[------------------------------------------------
-- note: This is the base template for all
Love Frames objects. You should not
edit or delete this template unless you
know what you are doing.
--]]------------------------------------------------
-- get the current require path
local path = string.sub(..., 1, string.len(...) - string.len(".templates.base"))
local loveframes = require(path .. ".libraries.common")
-- template table
local template = {}
-- template name
template.name = "Base"
-- template properties
template.properties = {}
template.properties["*"] =
{
state = "none",
x = 0,
y = 0,
width = 5,
height = 5,
staticx = 0,
staticy = 0,
draworder = 0,
collide = true,
internal = false,
visible = true,
hover = false,
alwaysupdate = false,
retainsize = false,
calledmousefunc = false,
skin = nil,
clickbounds = nil,
Draw = nil,
Update = nil,
OnMouseEnter = nil,
OnMouseExit = nil
}
-- register the template
loveframes.templates.Register(template)
|
||||
--[[------------------------------------------------
-- Love Frames - A GUI library for LOVE --
-- Copyright (c) 2012-2014 Kenny Shields --
--]]------------------------------------------------
--[[------------------------------------------------
-- note: This is the base template for all
Love Frames objects. You should not
edit or delete this template unless you
know what you are doing.
--]]------------------------------------------------
-- template table
local template = {}
-- template name
template.name = "Base"
-- template properties
template.properties = {}
template.properties["*"] =
{
state = "none",
x = 0,
y = 0,
width = 5,
height = 5,
staticx = 0,
staticy = 0,
draworder = 0,
collide = true,
internal = false,
visible = true,
hover = false,
alwaysupdate = false,
retainsize = false,
calledmousefunc = false,
skin = nil,
clickbounds = nil,
Draw = nil,
Update = nil,
OnMouseEnter = nil,
OnMouseExit = nil
}
return template
|
Loading…
Reference in New Issue
Block a user