summaryrefslogtreecommitdiff
path: root/examples/resources/lib/rectangle.lua
diff options
context:
space:
mode:
authorjussi2022-12-05 16:56:41 +0200
committerjussi2022-12-05 16:56:41 +0200
commitb3d2a9c0a2772cee0aeb94ffc1a7ad74b5286b6f (patch)
tree5ef56fafbf494767db3e3043de728e0c0ad4c384 /examples/resources/lib/rectangle.lua
parentbdbd475ae30b75aaad113f913ed9c70668b471b8 (diff)
downloadreilua-enhanced-b3d2a9c0a2772cee0aeb94ffc1a7ad74b5286b6f.tar.gz
reilua-enhanced-b3d2a9c0a2772cee0aeb94ffc1a7ad74b5286b6f.tar.bz2
reilua-enhanced-b3d2a9c0a2772cee0aeb94ffc1a7ad74b5286b6f.zip
Working basic elements.
Diffstat (limited to 'examples/resources/lib/rectangle.lua')
-rw-r--r--examples/resources/lib/rectangle.lua16
1 files changed, 8 insertions, 8 deletions
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 )