From e068c3f09c37984c8f08bb5335768dcf1fe8053a Mon Sep 17 00:00:00 2001 From: Sabine Lim Date: Tue, 16 May 2023 02:16:10 +1000 Subject: [PATCH] Add getters and setters to VisualObject --- Basalt/objects/VisualObject.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Basalt/objects/VisualObject.lua b/Basalt/objects/VisualObject.lua index 840cf2e..bac7ba7 100644 --- a/Basalt/objects/VisualObject.lua +++ b/Basalt/objects/VisualObject.lua @@ -138,10 +138,18 @@ return function(name, basalt) return x end, + setX = function(self, newX) + return self:setPosition(newX, y) + end, + getY = function(self) return y end, + setY = function(self, newY) + return self:setPosition(x, newY) + end, + getPosition = function(self) return x, y end, @@ -167,10 +175,18 @@ return function(name, basalt) return height end, + setHeight = function(self, newHeight) + return self:setSize(width, newHeight) + end, + getWidth = function(self) return width end, + setWidth = function(self, newWidth) + return self:setSize(newWidth, height) + end, + getSize = function(self) return width, height end,