ISprites.d.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /**
  2. * Defines the basic options interface of a Sprite Frame Source Size.
  3. */
  4. export interface ISpriteJSONSpriteSourceSize {
  5. /**
  6. * number of the original width of the Frame
  7. */
  8. w: number;
  9. /**
  10. * number of the original height of the Frame
  11. */
  12. h: number;
  13. }
  14. /**
  15. * Defines the basic options interface of a Sprite Frame Data.
  16. */
  17. export interface ISpriteJSONSpriteFrameData {
  18. /**
  19. * number of the x offset of the Frame
  20. */
  21. x: number;
  22. /**
  23. * number of the y offset of the Frame
  24. */
  25. y: number;
  26. /**
  27. * number of the width of the Frame
  28. */
  29. w: number;
  30. /**
  31. * number of the height of the Frame
  32. */
  33. h: number;
  34. }
  35. /**
  36. * Defines the basic options interface of a JSON Sprite.
  37. */
  38. export interface ISpriteJSONSprite {
  39. /**
  40. * string name of the Frame
  41. */
  42. filename: string;
  43. /**
  44. * ISpriteJSONSpriteFrame basic object of the frame data
  45. */
  46. frame: ISpriteJSONSpriteFrameData;
  47. /**
  48. * boolean to flag is the frame was rotated.
  49. */
  50. rotated: boolean;
  51. /**
  52. * boolean to flag is the frame was trimmed.
  53. */
  54. trimmed: boolean;
  55. /**
  56. * ISpriteJSONSpriteFrame basic object of the source data
  57. */
  58. spriteSourceSize: ISpriteJSONSpriteFrameData;
  59. /**
  60. * ISpriteJSONSpriteFrame basic object of the source data
  61. */
  62. sourceSize: ISpriteJSONSpriteSourceSize;
  63. }
  64. /**
  65. * Defines the basic options interface of a JSON atlas.
  66. */
  67. export interface ISpriteJSONAtlas {
  68. /**
  69. * Array of objects that contain the frame data.
  70. */
  71. frames: Array<ISpriteJSONSprite>;
  72. /**
  73. * object basic object containing the sprite meta data.
  74. */
  75. meta?: object;
  76. }