From b3d2a9c0a2772cee0aeb94ffc1a7ad74b5286b6f Mon Sep 17 00:00:00 2001 From: jussi Date: Mon, 5 Dec 2022 16:56:41 +0200 Subject: Working basic elements. --- examples/resources/lib/rectangle.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'examples/resources/lib/rectangle.lua') diff --git a/examples/resources/lib/rectangle.lua b/examples/resources/lib/rectangle.lua index 236c432..2f9ad6c 100644 --- a/examples/resources/lib/rectangle.lua +++ b/examples/resources/lib/rectangle.lua @@ -49,14 +49,14 @@ function Rectangle:new( x, y, width, height ) x, y, width, height = 0, 0, 0, 0 end - local o = { - x = x, - y = y, - width = width, - height = height, - } - setmetatable( o, Rectangle.meta ) - return o + local object = setmetatable( {}, Rectangle.meta ) + + object.x = x + object.y = y + object.width = width + object.height = height + + return object end function Rectangle:set( x, y, width, height ) -- cgit v1.2.3