modules/assets: add getDimensions() to tileset, sprite and animators

This commit is contained in:
Kazhnuz 2019-05-06 20:43:51 +02:00
parent 0ee3220559
commit 7bdcdc5bfa
3 changed files with 12 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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