SkeletonAnimation.lua 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 = Polycore.SkeletonAnimation(unpack(arg))
  13. end
  14. end
  15. function SkeletonAnimation:addBoneTrack(boneTrack)
  16. local retVal = Polycore.SkeletonAnimation_addBoneTrack(self.__ptr, boneTrack.__ptr)
  17. end
  18. function SkeletonAnimation:getName()
  19. local retVal = Polycore.SkeletonAnimation_getName(self.__ptr)
  20. if retVal == nil then return nil end
  21. local __c = _G["String"]("__skip_ptr__")
  22. __c.__ptr = retVal
  23. return __c
  24. end
  25. function SkeletonAnimation:Play(once)
  26. local retVal = Polycore.SkeletonAnimation_Play(self.__ptr, once)
  27. end
  28. function SkeletonAnimation:Stop()
  29. local retVal = Polycore.SkeletonAnimation_Stop(self.__ptr)
  30. end
  31. function SkeletonAnimation:Reset()
  32. local retVal = Polycore.SkeletonAnimation_Reset(self.__ptr)
  33. end
  34. function SkeletonAnimation:Update()
  35. local retVal = Polycore.SkeletonAnimation_Update(self.__ptr)
  36. end
  37. function SkeletonAnimation:setSpeed(speed)
  38. local retVal = Polycore.SkeletonAnimation_setSpeed(self.__ptr, speed)
  39. end
  40. function SkeletonAnimation:setWeight(newWeight)
  41. local retVal = Polycore.SkeletonAnimation_setWeight(self.__ptr, newWeight)
  42. end
  43. function SkeletonAnimation:getWeight()
  44. local retVal = Polycore.SkeletonAnimation_getWeight(self.__ptr)
  45. return retVal
  46. end
  47. function SkeletonAnimation:isPlaying()
  48. local retVal = Polycore.SkeletonAnimation_isPlaying(self.__ptr)
  49. return retVal
  50. end
  51. function SkeletonAnimation:__delete()
  52. if self then Polycore.delete_SkeletonAnimation(self.__ptr) end
  53. end