SkeletonAnimation.lua 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. class "SkeletonAnimation"
  2. function SkeletonAnimation:SkeletonAnimation(...)
  3. for k,v in pairs(arg) do
  4. if type(v) == "table" then
  5. if v.__ptr ~= nil then
  6. arg[k] = v.__ptr
  7. end
  8. end
  9. end
  10. if self.__ptr == nil and arg[1] ~= "__skip_ptr__" then
  11. self.__ptr = Polycore.SkeletonAnimation(unpack(arg))
  12. Polycore.__ptr_lookup[self.__ptr] = self
  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. return retVal
  21. end
  22. function SkeletonAnimation:Play(once)
  23. local retVal = Polycore.SkeletonAnimation_Play(self.__ptr, once)
  24. end
  25. function SkeletonAnimation:Stop()
  26. local retVal = Polycore.SkeletonAnimation_Stop(self.__ptr)
  27. end
  28. function SkeletonAnimation:Update()
  29. local retVal = Polycore.SkeletonAnimation_Update(self.__ptr)
  30. end
  31. function SkeletonAnimation:setSpeed(speed)
  32. local retVal = Polycore.SkeletonAnimation_setSpeed(self.__ptr, speed)
  33. end
  34. function SkeletonAnimation:__delete()
  35. Polycore.__ptr_lookup[self.__ptr] = nil
  36. Polycore.delete_SkeletonAnimation(self.__ptr)
  37. end