diff --git a/gamecore/modules/assets/animator.lua b/gamecore/modules/assets/animator.lua index 53da4e4..b9d7a0f 100644 --- a/gamecore/modules/assets/animator.lua +++ b/gamecore/modules/assets/animator.lua @@ -120,6 +120,20 @@ function Animator:getDimensions() return self.sprite:getDimensions() end +-- CALLBACK FUNCTIONS +-- Handle getting a calback from the animation system + +function Animator:setCallbackTarget(callbackTarget) + self.callbackTarget = callbackTarget +end + +function Animator:sendCallback() + if (self.callbackTarget ~= nil) then + if (self.callbackTarget.animationEnded ~= nil) then + self.callbackTarget:animationEnded(self.currentAnimation) + end + end +end -- DRAW FUNCTIONS -- Draw animations using these functions