SpriteState.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. function SpriteState() {
  2. if(arguments[0] != "__skip_ptr__") {
  3. this.__ptr = Polycode.SpriteState()
  4. }
  5. }
  6. Duktape.fin(SpriteState.prototype, function (x) {
  7. if (x === SpriteState.prototype) {
  8. return;
  9. }
  10. Polycode.SpriteState__delete(x.__ptr)
  11. })
  12. SpriteState.prototype.setName = function(name) {
  13. Polycode.SpriteState_setName(this.__ptr, name)
  14. }
  15. SpriteState.prototype.getName = function() {
  16. return Polycode.SpriteState_getName(this.__ptr)
  17. }
  18. SpriteState.prototype.getNumFrameIDs = function() {
  19. return Polycode.SpriteState_getNumFrameIDs(this.__ptr)
  20. }
  21. SpriteState.prototype.getFrameIDAtIndex = function(index) {
  22. return Polycode.SpriteState_getFrameIDAtIndex(this.__ptr, index)
  23. }
  24. SpriteState.prototype.getMeshForFrameIndex = function(index) {
  25. var retVal = new Mesh("__skip_ptr__")
  26. retVal.__ptr = Polycode.SpriteState_getMeshForFrameIndex(this.__ptr, index)
  27. return retVal
  28. }
  29. SpriteState.prototype.insertFrame = function(index,frameID) {
  30. Polycode.SpriteState_insertFrame(this.__ptr, index, frameID)
  31. }
  32. SpriteState.prototype.removeFrameByIndex = function(frameIndex) {
  33. Polycode.SpriteState_removeFrameByIndex(this.__ptr, frameIndex)
  34. }
  35. SpriteState.prototype.clearFrames = function() {
  36. Polycode.SpriteState_clearFrames(this.__ptr)
  37. }
  38. SpriteState.prototype.setPixelsPerUnit = function(ppu) {
  39. Polycode.SpriteState_setPixelsPerUnit(this.__ptr, ppu)
  40. }
  41. SpriteState.prototype.getPixelsPerUnit = function() {
  42. return Polycode.SpriteState_getPixelsPerUnit(this.__ptr)
  43. }
  44. SpriteState.prototype.rebuildStateMeshes = function() {
  45. Polycode.SpriteState_rebuildStateMeshes(this.__ptr)
  46. }
  47. SpriteState.prototype.setStateFPS = function(fps) {
  48. Polycode.SpriteState_setStateFPS(this.__ptr, fps)
  49. }
  50. SpriteState.prototype.getStateFPS = function() {
  51. return Polycode.SpriteState_getStateFPS(this.__ptr)
  52. }
  53. SpriteState.prototype.getLargestFrameBoundingBox = function() {
  54. var retVal = new Vector3("__skip_ptr__")
  55. retVal.__ptr = Polycode.SpriteState_getLargestFrameBoundingBox(this.__ptr)
  56. return retVal
  57. }
  58. SpriteState.prototype.setBoundingBox = function(boundingBox) {
  59. Polycode.SpriteState_setBoundingBox(this.__ptr, boundingBox)
  60. }
  61. SpriteState.prototype.getBoundingBox = function() {
  62. var retVal = new Vector2("__skip_ptr__")
  63. retVal.__ptr = Polycode.SpriteState_getBoundingBox(this.__ptr)
  64. return retVal
  65. }
  66. SpriteState.prototype.getSpriteOffset = function() {
  67. var retVal = new Vector2("__skip_ptr__")
  68. retVal.__ptr = Polycode.SpriteState_getSpriteOffset(this.__ptr)
  69. return retVal
  70. }
  71. SpriteState.prototype.setSpriteOffset = function(offset) {
  72. Polycode.SpriteState_setSpriteOffset(this.__ptr, offset)
  73. }