modules/assets: add getDimensions() to tileset, sprite and animators
This commit is contained in:
parent
0ee3220559
commit
7bdcdc5bfa
3 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue