From 7769d530406720c2cbe4cf8cf91400fd80b6cf1a Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Tue, 26 Feb 2019 22:45:31 +0100 Subject: [PATCH] Added useful method for shader work. --- spritesheet.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spritesheet.lua b/spritesheet.lua index df00509..37e8948 100644 --- a/spritesheet.lua +++ b/spritesheet.lua @@ -62,6 +62,10 @@ function Sprite:draw(...) return self:getImage()(...) end +function Sprite:getSheetDimensions() + return self.imagesheet.image:getDimensions() +end + setmetatable(Sprite, {__call = function(_, ...) return Sprite.new(...) end}) -------------------------------------------------------------------------------- @@ -121,6 +125,10 @@ function Animation:draw(...) return self:getImage()(...) end +function Animation:getSheetDimensions() + return self.imagesheet.image:getDimensions() +end + setmetatable(Animation, {__call = function(_, ...) return Animation.new(...) end}) --------------------------------------------------------------------------------