diff --git a/gamecore/modules/assets/animator.lua b/gamecore/modules/assets/animator.lua index b64c293..1498153 100644 --- a/gamecore/modules/assets/animator.lua +++ b/gamecore/modules/assets/animator.lua @@ -106,6 +106,10 @@ function Animator:animationExist(name) return (self.sprite.data.animations[self.currentAnimation] ~= nil) end +function Animator:getDimensions() + return self.sprite:getDimensions() +end + -- DRAW FUNCTIONS -- Draw animations using these functions diff --git a/gamecore/modules/assets/sprites.lua b/gamecore/modules/assets/sprites.lua index 1282363..ddf4f89 100644 --- a/gamecore/modules/assets/sprites.lua +++ b/gamecore/modules/assets/sprites.lua @@ -70,6 +70,10 @@ function Sprite:animationExist(name) return self.animator:animationExist(name) end +function Sprite:getDimensions() + return self.tileset:getDimensions() +end + -- DRAW FUNCTIONS -- Draw sprites using these functions diff --git a/gamecore/modules/assets/tileset.lua b/gamecore/modules/assets/tileset.lua index 9c83c4f..55d6643 100644 --- a/gamecore/modules/assets/tileset.lua +++ b/gamecore/modules/assets/tileset.lua @@ -86,6 +86,10 @@ function Tileset:getTile(n) return self.quads[n] end +function Tileset:getDimensions() + return self.width, self.height +end + -- DRAW FUNCTIONS -- Draw tileset using these functions