Tween.lua 949 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. require "Polycode/EventDispatcher"
  2. class "Tween" (EventDispatcher)
  3. function Tween:Tween(target, easeType, startVal, _endVal, time, _repeat)
  4. if self.__ptr == nil then
  5. self.__ptr = Polycore.Tween(target, easeType, startVal, _endVal, time, _repeat)
  6. end
  7. end
  8. function Tween:handleEvent(event)
  9. return Polycore.Tween_handleEvent(self.__ptr, event.__ptr)
  10. end
  11. function Tween:interpolateTween()
  12. return Polycore.Tween_interpolateTween(self.__ptr)
  13. end
  14. function Tween:updateCustomTween()
  15. return Polycore.Tween_updateCustomTween(self.__ptr)
  16. end
  17. function Tween:doOnComplete()
  18. return Polycore.Tween_doOnComplete(self.__ptr)
  19. end
  20. function Tween:Pause(pauseVal)
  21. return Polycore.Tween_Pause(self.__ptr, pauseVal)
  22. end
  23. function Tween:Reset()
  24. return Polycore.Tween_Reset(self.__ptr)
  25. end
  26. function Tween:isComplete()
  27. return Polycore.Tween_isComplete(self.__ptr)
  28. end
  29. function Tween:setSpeed(speed)
  30. return Polycore.Tween_setSpeed(self.__ptr, speed)
  31. end