1
0

Added useful method for shader work.

This commit is contained in:
Jon Michael Aanes 2019-02-26 22:45:31 +01:00
parent acd14a510b
commit 7769d53040

View File

@ -62,6 +62,10 @@ function Sprite:draw(...)
return self:getImage()(...) return self:getImage()(...)
end end
function Sprite:getSheetDimensions()
return self.imagesheet.image:getDimensions()
end
setmetatable(Sprite, {__call = function(_, ...) return Sprite.new(...) end}) setmetatable(Sprite, {__call = function(_, ...) return Sprite.new(...) end})
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -121,6 +125,10 @@ function Animation:draw(...)
return self:getImage()(...) return self:getImage()(...)
end end
function Animation:getSheetDimensions()
return self.imagesheet.image:getDimensions()
end
setmetatable(Animation, {__call = function(_, ...) return Animation.new(...) end}) setmetatable(Animation, {__call = function(_, ...) return Animation.new(...) end})
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------