SpriteState.js 2.4 KB

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