core/assets: add a function to know if an animation exists
This commit is contained in:
parent
f9b4adb3b7
commit
c738bb9bf9
|
@ -69,6 +69,10 @@ function Animator:getFrame()
|
|||
return self.frame
|
||||
end
|
||||
|
||||
function Animator:animationExist(name)
|
||||
return (self.sprite.data.animations[self.currentAnimation] ~= nil)
|
||||
end
|
||||
|
||||
function Animator:draw(x, y, r, sx, sy, ox, oy, kx, ky)
|
||||
self.sprite:drawFrame(self.frame, x, y, r, sx, sy, ox, oy, kx, ky)
|
||||
end
|
||||
|
|
|
@ -58,6 +58,10 @@ function Sprite:changeAnimation(name, restart)
|
|||
self.animator:changeAnimation(name, restart)
|
||||
end
|
||||
|
||||
function Sprite:animationExist(name)
|
||||
return self.animator:animationExist(name)
|
||||
end
|
||||
|
||||
function Sprite:drawAnimation(x, y, r, sx, sy, ox, oy, kx, ky)
|
||||
self.animator:draw(x, y, r, sx, sy, ox, oy, kx, ky)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue