From 39f670f35cbb1f894034b96dcff7b21965da004a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=82=B4=EB=A0=A4=EC=A3=BC=EC=84=B8=EC=9A=94?= <46598063+qwreey75@users.noreply.github.com> Date: Sun, 12 Sep 2021 21:08:33 +0900 Subject: [PATCH] Added 'defaultProperties' arg on module:class.import --- src/class.lua | 4 ++-- test.lua | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/class.lua b/src/class.lua index 75ba118..177d127 100644 --- a/src/class.lua +++ b/src/class.lua @@ -41,8 +41,8 @@ function module.init(shared) end local make = new.make; - function new.import(ClassName) -- make new quad class object - local this = {}; + function new.import(ClassName,defaultProperties) -- make new quad class object + local this = defaultProperties or {}; setmetatable(this,{ __call = function (self,prop) if type(prop) == "string" then diff --git a/test.lua b/test.lua index acf6bda..2baccc7 100644 --- a/test.lua +++ b/test.lua @@ -8,9 +8,7 @@ local store = render.store; local frame = class "Frame"; local text = class.import "TextLabel"; -text.style = { - -}; +text.TextSize = ; mount(gui,frame "testFrame" { text "texts" {