From 02edc4fc079c69bca4c9a6385fcaf55b1b7d375c Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sat, 28 Aug 2021 15:48:09 +0200 Subject: [PATCH] feat(rect): add getDimensions --- sonic-radiance.love/birb/classes/2D/rect.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sonic-radiance.love/birb/classes/2D/rect.lua b/sonic-radiance.love/birb/classes/2D/rect.lua index 81f2849..75e46f0 100644 --- a/sonic-radiance.love/birb/classes/2D/rect.lua +++ b/sonic-radiance.love/birb/classes/2D/rect.lua @@ -67,6 +67,10 @@ function Rect:getRelativeCoordinate(dx, dy) return dx - self.x, dy - self.y end +function Rect:getDimensions() + return self.w, self.h +end + function Rect:drawBox() utils.graphics.box(self.x, self.y, self.w, self.h) end