SpriteState.js 2.3 KB

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