SkeletonAnimation.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. function SkeletonAnimation(name,duration) {
  2. if(arguments[0] != "__skip_ptr__") {
  3. this.__ptr = Polycode.SkeletonAnimation(name,duration)
  4. }
  5. }
  6. Duktape.fin(SkeletonAnimation.prototype, function (x) {
  7. if (x === SkeletonAnimation.prototype) {
  8. return;
  9. }
  10. Polycode.SkeletonAnimation__delete(x.__ptr)
  11. })
  12. SkeletonAnimation.prototype.getName = function() {
  13. return Polycode.SkeletonAnimation_getName(this.__ptr)
  14. }
  15. SkeletonAnimation.prototype.Play = function(once) {
  16. Polycode.SkeletonAnimation_Play(this.__ptr, once)
  17. }
  18. SkeletonAnimation.prototype.Stop = function() {
  19. Polycode.SkeletonAnimation_Stop(this.__ptr)
  20. }
  21. SkeletonAnimation.prototype.Reset = function() {
  22. Polycode.SkeletonAnimation_Reset(this.__ptr)
  23. }
  24. SkeletonAnimation.prototype.Update = function(elapsed) {
  25. Polycode.SkeletonAnimation_Update(this.__ptr, elapsed)
  26. }
  27. SkeletonAnimation.prototype.setSpeed = function(speed) {
  28. Polycode.SkeletonAnimation_setSpeed(this.__ptr, speed)
  29. }
  30. SkeletonAnimation.prototype.setWeight = function(newWeight) {
  31. Polycode.SkeletonAnimation_setWeight(this.__ptr, newWeight)
  32. }
  33. SkeletonAnimation.prototype.getWeight = function() {
  34. return Polycode.SkeletonAnimation_getWeight(this.__ptr)
  35. }
  36. SkeletonAnimation.prototype.isPlaying = function() {
  37. return Polycode.SkeletonAnimation_isPlaying(this.__ptr)
  38. }