SkeletonAnimation.lua 1.6 KB

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