SpriteFrame.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. function SpriteFrame() {
  2. if(arguments[0] != "__skip_ptr__") {
  3. this.__ptr = Polycode.SpriteFrame()
  4. }
  5. Object.defineProperties(this, {
  6. 'coordinates': { enumerable: true, configurable: true, get: SpriteFrame.prototype.__get_coordinates, set: SpriteFrame.prototype.__set_coordinates},
  7. 'anchorPoint': { enumerable: true, configurable: true, get: SpriteFrame.prototype.__get_anchorPoint, set: SpriteFrame.prototype.__set_anchorPoint},
  8. 'frameID': { enumerable: true, configurable: true, get: SpriteFrame.prototype.__get_frameID, set: SpriteFrame.prototype.__set_frameID}
  9. })
  10. }
  11. SpriteFrame.prototype.__get_coordinates = function() {
  12. var retVal = new Rectangle("__skip_ptr__")
  13. retVal.__ptr = Polycode.SpriteFrame__get_coordinates(this.__ptr)
  14. return retVal
  15. }
  16. SpriteFrame.prototype.__set_coordinates = function(val) {
  17. Polycode.SpriteFrame__set_coordinates(this.__ptr, val.__ptr)
  18. }
  19. SpriteFrame.prototype.__get_anchorPoint = function() {
  20. var retVal = new Vector2("__skip_ptr__")
  21. retVal.__ptr = Polycode.SpriteFrame__get_anchorPoint(this.__ptr)
  22. return retVal
  23. }
  24. SpriteFrame.prototype.__set_anchorPoint = function(val) {
  25. Polycode.SpriteFrame__set_anchorPoint(this.__ptr, val.__ptr)
  26. }
  27. SpriteFrame.prototype.__get_frameID = function() {
  28. return Polycode.SpriteFrame__get_frameID(this.__ptr)
  29. }
  30. SpriteFrame.prototype.__set_frameID = function(val) {
  31. Polycode.SpriteFrame__set_frameID(this.__ptr, val)
  32. }
  33. Duktape.fin(SpriteFrame.prototype, function (x) {
  34. if (x === SpriteFrame.prototype) {
  35. return;
  36. }
  37. Polycode.SpriteFrame__delete(x.__ptr)
  38. })