SkeletonAnimation.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. class "SkeletonAnimation"
  2. function SkeletonAnimation:SkeletonAnimation(...)
  3. local arg = {...}
  4. for k,v in pairs(arg) do
  5. if type(v) == "table" then
  6. if v.__ptr ~= nil then
  7. arg[k] = v.__ptr
  8. end
  9. end
  10. end
  11. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  12. self.__ptr = Polycode.SkeletonAnimation(unpack(arg))
  13. end
  14. end
  15. function SkeletonAnimation:getName()
  16. local retVal = Polycode.SkeletonAnimation_getName(self.__ptr)
  17. return retVal
  18. end
  19. function SkeletonAnimation:Play(once)
  20. local retVal = Polycode.SkeletonAnimation_Play(self.__ptr, once)
  21. end
  22. function SkeletonAnimation:Stop()
  23. local retVal = Polycode.SkeletonAnimation_Stop(self.__ptr)
  24. end
  25. function SkeletonAnimation:Reset()
  26. local retVal = Polycode.SkeletonAnimation_Reset(self.__ptr)
  27. end
  28. function SkeletonAnimation:Update(elapsed)
  29. local retVal = Polycode.SkeletonAnimation_Update(self.__ptr, elapsed)
  30. end
  31. function SkeletonAnimation:setSpeed(speed)
  32. local retVal = Polycode.SkeletonAnimation_setSpeed(self.__ptr, speed)
  33. end
  34. function SkeletonAnimation:setWeight(newWeight)
  35. local retVal = Polycode.SkeletonAnimation_setWeight(self.__ptr, newWeight)
  36. end
  37. function SkeletonAnimation:getWeight()
  38. local retVal = Polycode.SkeletonAnimation_getWeight(self.__ptr)
  39. return retVal
  40. end
  41. function SkeletonAnimation:isPlaying()
  42. local retVal = Polycode.SkeletonAnimation_isPlaying(self.__ptr)
  43. return retVal
  44. end
  45. function SkeletonAnimation:__delete()
  46. if self then Polycode.delete_SkeletonAnimation(self.__ptr) end
  47. end