Added 'defaultProperties' arg on module:class.import
This commit is contained in:
parent
2cc19c094b
commit
39f670f35c
2 changed files with 3 additions and 5 deletions
|
|
@ -41,8 +41,8 @@ function module.init(shared)
|
||||||
end
|
end
|
||||||
local make = new.make;
|
local make = new.make;
|
||||||
|
|
||||||
function new.import(ClassName) -- make new quad class object
|
function new.import(ClassName,defaultProperties) -- make new quad class object
|
||||||
local this = {};
|
local this = defaultProperties or {};
|
||||||
setmetatable(this,{
|
setmetatable(this,{
|
||||||
__call = function (self,prop)
|
__call = function (self,prop)
|
||||||
if type(prop) == "string" then
|
if type(prop) == "string" then
|
||||||
|
|
|
||||||
4
test.lua
4
test.lua
|
|
@ -8,9 +8,7 @@ local store = render.store;
|
||||||
|
|
||||||
local frame = class "Frame";
|
local frame = class "Frame";
|
||||||
local text = class.import "TextLabel";
|
local text = class.import "TextLabel";
|
||||||
text.style = {
|
text.TextSize = ;
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
mount(gui,frame "testFrame" {
|
mount(gui,frame "testFrame" {
|
||||||
text "texts" {
|
text "texts" {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue