feat(actors): listen to animationEnded callback from sprite clones
Fixes #38
This commit is contained in:
parent
76fb15f862
commit
e6f0315a8c
1 changed files with 5 additions and 0 deletions
|
@ -378,6 +378,7 @@ end
|
|||
function BaseActor:cloneSprite()
|
||||
if self.sprite.name ~= nil then
|
||||
self.sprite.clone = self.assets.sprites[self.sprite.name]:clone()
|
||||
self.sprite.clone:setCallbackTarget(self)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -389,6 +390,10 @@ function BaseActor:changeAnimation(animation, restart)
|
|||
end
|
||||
end
|
||||
|
||||
function BaseActor:animationEnded(animation)
|
||||
-- Empty placeholder function
|
||||
end
|
||||
|
||||
function BaseActor:setCustomSpeed(customSpeed)
|
||||
if (self.sprite.clone == nil) then
|
||||
self.assets.sprites[self.sprite.name]:setCustomSpeed(customSpeed)
|
||||
|
|
Loading…
Reference in a new issue