@vpmedia/phaser 1.30.0 → 1.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/README.md +1 -1
  2. package/package.json +10 -11
  3. package/src/index.js +33 -33
  4. package/src/phaser/core/animation.js +5 -5
  5. package/src/phaser/core/animation_manager.js +6 -6
  6. package/src/phaser/core/animation_parser.js +7 -7
  7. package/src/phaser/core/cache.js +9 -9
  8. package/src/phaser/core/device_util.js +1 -1
  9. package/src/phaser/core/dom.js +2 -2
  10. package/src/phaser/core/event_manager.js +2 -2
  11. package/src/phaser/core/factory.js +9 -9
  12. package/src/phaser/core/frame.js +3 -3
  13. package/src/phaser/core/frame_data.js +8 -8
  14. package/src/phaser/core/frame_util.js +2 -2
  15. package/src/phaser/core/game.js +20 -20
  16. package/src/phaser/core/input.js +16 -16
  17. package/src/phaser/core/input_handler.js +21 -21
  18. package/src/phaser/core/input_mouse.js +1 -1
  19. package/src/phaser/core/input_mspointer.js +1 -1
  20. package/src/phaser/core/input_pointer.js +9 -9
  21. package/src/phaser/core/input_touch.js +1 -1
  22. package/src/phaser/core/loader.js +11 -11
  23. package/src/phaser/core/loader_parser.js +6 -6
  24. package/src/phaser/core/raf.js +1 -1
  25. package/src/phaser/core/scale_manager.js +7 -7
  26. package/src/phaser/core/scene_manager.js +2 -2
  27. package/src/phaser/core/signal.js +3 -3
  28. package/src/phaser/core/signal_binding.js +2 -2
  29. package/src/phaser/core/sound.js +2 -2
  30. package/src/phaser/core/sound_manager.js +5 -5
  31. package/src/phaser/core/sound_sprite.js +3 -3
  32. package/src/phaser/core/stage.js +6 -6
  33. package/src/phaser/core/time.js +2 -2
  34. package/src/phaser/core/timer.js +3 -3
  35. package/src/phaser/core/timer_event.js +1 -1
  36. package/src/phaser/core/tween.js +8 -8
  37. package/src/phaser/core/tween_data.js +3 -3
  38. package/src/phaser/core/tween_manager.js +26 -26
  39. package/src/phaser/core/world.js +2 -2
  40. package/src/phaser/display/bitmap_text.js +5 -5
  41. package/src/phaser/display/button.js +6 -6
  42. package/src/phaser/display/canvas/buffer.js +1 -1
  43. package/src/phaser/display/canvas/graphics.js +1 -1
  44. package/src/phaser/display/canvas/masker.js +2 -2
  45. package/src/phaser/display/canvas/renderer.js +21 -21
  46. package/src/phaser/display/canvas/tinter.js +3 -3
  47. package/src/phaser/display/canvas/util.js +1 -1
  48. package/src/phaser/display/display_object.js +9 -9
  49. package/src/phaser/display/graphics.js +24 -24
  50. package/src/phaser/display/graphics_data.js +1 -1
  51. package/src/phaser/display/graphics_data_util.js +2 -2
  52. package/src/phaser/display/group.js +5 -5
  53. package/src/phaser/display/image.js +13 -13
  54. package/src/phaser/display/sprite_batch.js +2 -2
  55. package/src/phaser/display/sprite_util.js +14 -14
  56. package/src/phaser/display/text.js +11 -11
  57. package/src/phaser/display/webgl/base_texture.js +1 -1
  58. package/src/phaser/display/webgl/earcut.js +1 -1
  59. package/src/phaser/display/webgl/fast_sprite_batch.js +1 -1
  60. package/src/phaser/display/webgl/filter_texture.js +1 -1
  61. package/src/phaser/display/webgl/graphics.js +6 -6
  62. package/src/phaser/display/webgl/mask_manager.js +1 -1
  63. package/src/phaser/display/webgl/render_texture.js +8 -8
  64. package/src/phaser/display/webgl/renderer.js +30 -30
  65. package/src/phaser/display/webgl/shader/complex.js +2 -2
  66. package/src/phaser/display/webgl/shader/fast.js +2 -2
  67. package/src/phaser/display/webgl/shader/normal.js +3 -3
  68. package/src/phaser/display/webgl/shader/primitive.js +2 -2
  69. package/src/phaser/display/webgl/shader/strip.js +2 -2
  70. package/src/phaser/display/webgl/shader_manager.js +5 -5
  71. package/src/phaser/display/webgl/sprite_batch.js +5 -5
  72. package/src/phaser/display/webgl/stencil_manager.js +7 -7
  73. package/src/phaser/display/webgl/texture.js +2 -2
  74. package/src/phaser/display/webgl/texture_util.js +2 -2
  75. package/src/phaser/geom/circle.js +5 -5
  76. package/src/phaser/geom/ellipse.js +4 -4
  77. package/src/phaser/geom/line.js +5 -5
  78. package/src/phaser/geom/matrix.js +3 -3
  79. package/src/phaser/geom/point.js +2 -2
  80. package/src/phaser/geom/polygon.js +3 -3
  81. package/src/phaser/geom/rectangle.js +3 -3
  82. package/src/phaser/geom/rounded_rectangle.js +2 -2
  83. package/src/phaser/geom/util/circle.js +3 -3
  84. package/src/phaser/geom/util/line.js +3 -3
  85. package/src/phaser/geom/util/matrix.js +1 -1
  86. package/src/phaser/geom/util/point.js +1 -1
  87. package/src/phaser/geom/util/polygon.js +1 -1
  88. package/src/phaser/geom/util/rectangle.js +3 -3
  89. package/src/phaser/geom/util/rounded_rectangle.js +1 -1
  90. package/types/index.d.ts +33 -33
  91. package/types/index.d.ts.map +1 -1
  92. package/types/phaser/core/animation.d.ts +11 -11
  93. package/types/phaser/core/animation.d.ts.map +1 -1
  94. package/types/phaser/core/animation_manager.d.ts +12 -12
  95. package/types/phaser/core/animation_manager.d.ts.map +1 -1
  96. package/types/phaser/core/animation_parser.d.ts +4 -4
  97. package/types/phaser/core/animation_parser.d.ts.map +1 -1
  98. package/types/phaser/core/cache.d.ts +9 -9
  99. package/types/phaser/core/cache.d.ts.map +1 -1
  100. package/types/phaser/core/device_util.d.ts +1 -1
  101. package/types/phaser/core/device_util.d.ts.map +1 -1
  102. package/types/phaser/core/dom.d.ts +3 -3
  103. package/types/phaser/core/dom.d.ts.map +1 -1
  104. package/types/phaser/core/event_manager.d.ts +4 -4
  105. package/types/phaser/core/event_manager.d.ts.map +1 -1
  106. package/types/phaser/core/factory.d.ts +9 -9
  107. package/types/phaser/core/factory.d.ts.map +1 -1
  108. package/types/phaser/core/frame.d.ts +1 -1
  109. package/types/phaser/core/frame.d.ts.map +1 -1
  110. package/types/phaser/core/frame_data.d.ts +12 -12
  111. package/types/phaser/core/frame_data.d.ts.map +1 -1
  112. package/types/phaser/core/frame_util.d.ts +2 -2
  113. package/types/phaser/core/frame_util.d.ts.map +1 -1
  114. package/types/phaser/core/game.d.ts +16 -16
  115. package/types/phaser/core/game.d.ts.map +1 -1
  116. package/types/phaser/core/input.d.ts +15 -15
  117. package/types/phaser/core/input.d.ts.map +1 -1
  118. package/types/phaser/core/input_handler.d.ts +36 -36
  119. package/types/phaser/core/input_handler.d.ts.map +1 -1
  120. package/types/phaser/core/input_mouse.d.ts +5 -5
  121. package/types/phaser/core/input_mouse.d.ts.map +1 -1
  122. package/types/phaser/core/input_mspointer.d.ts +5 -5
  123. package/types/phaser/core/input_mspointer.d.ts.map +1 -1
  124. package/types/phaser/core/input_pointer.d.ts +7 -7
  125. package/types/phaser/core/input_pointer.d.ts.map +1 -1
  126. package/types/phaser/core/input_touch.d.ts +4 -4
  127. package/types/phaser/core/input_touch.d.ts.map +1 -1
  128. package/types/phaser/core/loader.d.ts +9 -9
  129. package/types/phaser/core/loader.d.ts.map +1 -1
  130. package/types/phaser/core/loader_parser.d.ts +8 -8
  131. package/types/phaser/core/loader_parser.d.ts.map +1 -1
  132. package/types/phaser/core/raf.d.ts +3 -3
  133. package/types/phaser/core/raf.d.ts.map +1 -1
  134. package/types/phaser/core/scale_manager.d.ts +7 -7
  135. package/types/phaser/core/scale_manager.d.ts.map +1 -1
  136. package/types/phaser/core/scene_manager.d.ts +4 -4
  137. package/types/phaser/core/scene_manager.d.ts.map +1 -1
  138. package/types/phaser/core/signal.d.ts +1 -1
  139. package/types/phaser/core/signal.d.ts.map +1 -1
  140. package/types/phaser/core/signal_binding.d.ts +5 -5
  141. package/types/phaser/core/signal_binding.d.ts.map +1 -1
  142. package/types/phaser/core/sound.d.ts +5 -5
  143. package/types/phaser/core/sound.d.ts.map +1 -1
  144. package/types/phaser/core/sound_manager.d.ts +7 -7
  145. package/types/phaser/core/sound_manager.d.ts.map +1 -1
  146. package/types/phaser/core/sound_sprite.d.ts +7 -7
  147. package/types/phaser/core/sound_sprite.d.ts.map +1 -1
  148. package/types/phaser/core/stage.d.ts +4 -4
  149. package/types/phaser/core/stage.d.ts.map +1 -1
  150. package/types/phaser/core/time.d.ts +4 -4
  151. package/types/phaser/core/time.d.ts.map +1 -1
  152. package/types/phaser/core/timer.d.ts +5 -5
  153. package/types/phaser/core/timer.d.ts.map +1 -1
  154. package/types/phaser/core/timer_event.d.ts +3 -3
  155. package/types/phaser/core/timer_event.d.ts.map +1 -1
  156. package/types/phaser/core/tween.d.ts +9 -9
  157. package/types/phaser/core/tween.d.ts.map +1 -1
  158. package/types/phaser/core/tween_data.d.ts +5 -5
  159. package/types/phaser/core/tween_data.d.ts.map +1 -1
  160. package/types/phaser/core/tween_manager.d.ts +35 -35
  161. package/types/phaser/core/tween_manager.d.ts.map +1 -1
  162. package/types/phaser/core/world.d.ts +3 -3
  163. package/types/phaser/core/world.d.ts.map +1 -1
  164. package/types/phaser/display/bitmap_text.d.ts +5 -5
  165. package/types/phaser/display/bitmap_text.d.ts.map +1 -1
  166. package/types/phaser/display/button.d.ts +5 -5
  167. package/types/phaser/display/button.d.ts.map +1 -1
  168. package/types/phaser/display/canvas/renderer.d.ts +8 -8
  169. package/types/phaser/display/canvas/renderer.d.ts.map +1 -1
  170. package/types/phaser/display/display_object.d.ts +7 -7
  171. package/types/phaser/display/display_object.d.ts.map +1 -1
  172. package/types/phaser/display/graphics.d.ts +10 -10
  173. package/types/phaser/display/graphics.d.ts.map +1 -1
  174. package/types/phaser/display/graphics_data_util.d.ts +1 -1
  175. package/types/phaser/display/graphics_data_util.d.ts.map +1 -1
  176. package/types/phaser/display/group.d.ts +6 -6
  177. package/types/phaser/display/group.d.ts.map +1 -1
  178. package/types/phaser/display/image.d.ts +17 -17
  179. package/types/phaser/display/image.d.ts.map +1 -1
  180. package/types/phaser/display/sprite_batch.d.ts +4 -4
  181. package/types/phaser/display/sprite_batch.d.ts.map +1 -1
  182. package/types/phaser/display/sprite_util.d.ts +15 -15
  183. package/types/phaser/display/sprite_util.d.ts.map +1 -1
  184. package/types/phaser/display/text.d.ts +5 -5
  185. package/types/phaser/display/text.d.ts.map +1 -1
  186. package/types/phaser/display/webgl/fast_sprite_batch.d.ts +2 -2
  187. package/types/phaser/display/webgl/fast_sprite_batch.d.ts.map +1 -1
  188. package/types/phaser/display/webgl/graphics.d.ts +1 -1
  189. package/types/phaser/display/webgl/graphics.d.ts.map +1 -1
  190. package/types/phaser/display/webgl/render_texture.d.ts +7 -7
  191. package/types/phaser/display/webgl/render_texture.d.ts.map +1 -1
  192. package/types/phaser/display/webgl/renderer.d.ts +15 -15
  193. package/types/phaser/display/webgl/renderer.d.ts.map +1 -1
  194. package/types/phaser/display/webgl/shader_manager.d.ts +5 -5
  195. package/types/phaser/display/webgl/shader_manager.d.ts.map +1 -1
  196. package/types/phaser/display/webgl/sprite_batch.d.ts +6 -6
  197. package/types/phaser/display/webgl/sprite_batch.d.ts.map +1 -1
  198. package/types/phaser/display/webgl/stencil_manager.d.ts +9 -9
  199. package/types/phaser/display/webgl/stencil_manager.d.ts.map +1 -1
  200. package/types/phaser/display/webgl/texture.d.ts +4 -4
  201. package/types/phaser/display/webgl/texture.d.ts.map +1 -1
  202. package/types/phaser/geom/circle.d.ts +2 -2
  203. package/types/phaser/geom/circle.d.ts.map +1 -1
  204. package/types/phaser/geom/ellipse.d.ts +2 -2
  205. package/types/phaser/geom/ellipse.d.ts.map +1 -1
  206. package/types/phaser/geom/line.d.ts +1 -1
  207. package/types/phaser/geom/line.d.ts.map +1 -1
  208. package/types/phaser/geom/matrix.d.ts +1 -1
  209. package/types/phaser/geom/matrix.d.ts.map +1 -1
  210. package/types/phaser/geom/rectangle.d.ts +1 -1
  211. package/types/phaser/geom/rectangle.d.ts.map +1 -1
  212. package/types/phaser/geom/util/circle.d.ts +2 -2
  213. package/types/phaser/geom/util/circle.d.ts.map +1 -1
  214. package/types/phaser/geom/util/line.d.ts +2 -2
  215. package/types/phaser/geom/util/line.d.ts.map +1 -1
  216. package/types/phaser/geom/util/matrix.d.ts +1 -1
  217. package/types/phaser/geom/util/matrix.d.ts.map +1 -1
  218. package/types/phaser/geom/util/point.d.ts +1 -1
  219. package/types/phaser/geom/util/point.d.ts.map +1 -1
  220. package/types/phaser/geom/util/polygon.d.ts +1 -1
  221. package/types/phaser/geom/util/polygon.d.ts.map +1 -1
  222. package/types/phaser/geom/util/rectangle.d.ts +2 -2
  223. package/types/phaser/geom/util/rectangle.d.ts.map +1 -1
  224. package/types/phaser/geom/util/rounded_rectangle.d.ts +1 -1
  225. package/types/phaser/geom/util/rounded_rectangle.d.ts.map +1 -1
@@ -1,8 +1,8 @@
1
- import { GraphicsData } from './graphics_data';
2
- import { Point } from '../../geom/point';
3
- import { GEOM_CIRCLE, GEOM_ELLIPSE, GEOM_POLYGON, GEOM_RECTANGLE, GEOM_ROUNDED_RECTANGLE } from '../../core/const';
4
- import { hex2rgb } from '../../util/math';
5
- import { triangulate } from './earcut';
1
+ import { GraphicsData } from './graphics_data.js';
2
+ import { Point } from '../../geom/point.js';
3
+ import { GEOM_CIRCLE, GEOM_ELLIPSE, GEOM_POLYGON, GEOM_RECTANGLE, GEOM_ROUNDED_RECTANGLE } from '../../core/const.js';
4
+ import { hex2rgb } from '../../util/math.js';
5
+ import { triangulate } from './earcut.js';
6
6
 
7
7
  /**
8
8
  * TBD.
@@ -314,7 +314,7 @@ export function buildRoundedRectangle(graphicsData, webGLData) {
314
314
  recPoints.push(x, y + radius);
315
315
  recPoints = recPoints.concat(quadraticBezierCurve(x, y + height - radius, x, y + height, x + radius, y + height));
316
316
  recPoints = recPoints.concat(
317
- quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius)
317
+ quadraticBezierCurve(x + width - radius, y + height, x + width, y + height, x + width, y + height - radius),
318
318
  );
319
319
  recPoints = recPoints.concat(quadraticBezierCurve(x + width, y + radius, x + width, y, x + width - radius, y));
320
320
  recPoints = recPoints.concat(quadraticBezierCurve(x + radius, y, x, y, x, y + radius));
@@ -1,4 +1,4 @@
1
- import { updateGraphics } from './graphics';
1
+ import { updateGraphics } from './graphics.js';
2
2
 
3
3
  /**
4
4
  * TBD.
@@ -1,17 +1,17 @@
1
- import { Rectangle } from '../../geom/rectangle';
2
- import { Point } from '../../geom/point';
3
- import { Texture } from './texture';
4
- import { BaseTexture } from './base_texture';
5
- import { FilterTexture } from './filter_texture';
6
- import { CanvasBuffer } from '../canvas/buffer';
7
- import { RENDER_WEBGL } from '../../core/const';
1
+ import { Rectangle } from '../../geom/rectangle.js';
2
+ import { Point } from '../../geom/point.js';
3
+ import { Texture } from './texture.js';
4
+ import { BaseTexture } from './base_texture.js';
5
+ import { FilterTexture } from './filter_texture.js';
6
+ import { CanvasBuffer } from '../canvas/buffer.js';
7
+ import { RENDER_WEBGL } from '../../core/const.js';
8
8
 
9
9
  export class RenderTexture extends Texture {
10
10
  /**
11
11
  * TBD.
12
12
  * @param {number} width - TBD.
13
13
  * @param {number} height - TBD.
14
- * @param {import('./renderer').WebGLRenderer|import('../canvas/renderer').CanvasRenderer} renderer - TBD.
14
+ * @param {import('./renderer.js').WebGLRenderer|import('../canvas/renderer.js').CanvasRenderer} renderer - TBD.
15
15
  * @param {number} scaleMode - TBD.
16
16
  * @param {number} resolution - TBD.
17
17
  */
@@ -1,38 +1,38 @@
1
1
  import {
2
- RENDER_WEBGL,
3
- SCALE_LINEAR,
4
- BLEND_NORMAL,
5
2
  BLEND_ADD,
6
- BLEND_MULTIPLY,
7
- BLEND_SCREEN,
8
- BLEND_OVERLAY,
9
- BLEND_DARKEN,
10
- BLEND_LIGHTEN,
11
- BLEND_COLOR_DODGE,
3
+ BLEND_COLOR,
12
4
  BLEND_COLOR_BURN,
13
- BLEND_HARD_LIGHT,
14
- BLEND_SOFT_LIGHT,
5
+ BLEND_COLOR_DODGE,
6
+ BLEND_DARKEN,
15
7
  BLEND_DIFFERENCE,
16
8
  BLEND_EXCLUSION,
9
+ BLEND_HARD_LIGHT,
17
10
  BLEND_HUE,
18
- BLEND_SATURATION,
19
- BLEND_COLOR,
11
+ BLEND_LIGHTEN,
20
12
  BLEND_LUMINOSITY,
21
- } from '../../core/const';
22
- import { remove } from '../canvas/pool';
23
- import { isPowerOfTwo } from '../../util/math';
24
- import { Point } from '../../geom/point';
25
- import { WebGLShaderManager } from './shader_manager';
26
- import { WebGLSpriteBatch } from './sprite_batch';
27
- import * as WebGLMaskManager from './mask_manager';
28
- import { WebGLFilterManager } from './filter_manager';
29
- import { WebGLStencilManager } from './stencil_manager';
30
- import { WebGLBlendModeManager } from './blend_manager';
13
+ BLEND_MULTIPLY,
14
+ BLEND_NORMAL,
15
+ BLEND_OVERLAY,
16
+ BLEND_SATURATION,
17
+ BLEND_SCREEN,
18
+ BLEND_SOFT_LIGHT,
19
+ RENDER_WEBGL,
20
+ SCALE_LINEAR,
21
+ } from '../../core/const.js';
22
+ import { Point } from '../../geom/point.js';
23
+ import { isPowerOfTwo } from '../../util/math.js';
24
+ import { remove } from '../canvas/pool.js';
25
+ import { WebGLBlendModeManager } from './blend_manager.js';
26
+ import { WebGLFilterManager } from './filter_manager.js';
27
+ import * as WebGLMaskManager from './mask_manager.js';
28
+ import { WebGLShaderManager } from './shader_manager.js';
29
+ import { WebGLSpriteBatch } from './sprite_batch.js';
30
+ import { WebGLStencilManager } from './stencil_manager.js';
31
31
 
32
32
  export class WebGLRenderer {
33
33
  /**
34
34
  * TBD.
35
- * @param {import('../../core/game').Game} game - TBD.
35
+ * @param {import('../../core/game.js').Game} game - TBD.
36
36
  */
37
37
  constructor(game) {
38
38
  this.type = RENDER_WEBGL;
@@ -153,7 +153,7 @@ export class WebGLRenderer {
153
153
 
154
154
  /**
155
155
  * TBD.
156
- * @param {import('../../core/stage').Stage} stage - TBD.
156
+ * @param {import('../../core/stage.js').Stage} stage - TBD.
157
157
  */
158
158
  render(stage) {
159
159
  if (this.contextLost) {
@@ -175,10 +175,10 @@ export class WebGLRenderer {
175
175
 
176
176
  /**
177
177
  * TBD.
178
- * @param {import('../../display/display_object').DisplayObject} displayObject - TBD.
178
+ * @param {import('../../display/display_object.js').DisplayObject} displayObject - TBD.
179
179
  * @param {Point} projection - TBD.
180
180
  * @param {object} buffer - TBD.
181
- * @param {import('../../geom/matrix').Matrix} matrix - TBD.
181
+ * @param {import('../../geom/matrix.js').Matrix} matrix - TBD.
182
182
  */
183
183
  renderDisplayObject(displayObject, projection, buffer, matrix) {
184
184
  this.renderSession.blendModeManager.setBlendMode(BLEND_NORMAL);
@@ -221,7 +221,7 @@ export class WebGLRenderer {
221
221
 
222
222
  /**
223
223
  * TBD.
224
- * @param {import('./base_texture').BaseTexture} texture - TBD.
224
+ * @param {import('./base_texture.js').BaseTexture} texture - TBD.
225
225
  * @returns {boolean} TBD.
226
226
  */
227
227
  updateTexture(texture) {
@@ -240,14 +240,14 @@ export class WebGLRenderer {
240
240
  gl.texParameteri(
241
241
  gl.TEXTURE_2D,
242
242
  gl.TEXTURE_MIN_FILTER,
243
- texture.scaleMode === SCALE_LINEAR ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST
243
+ texture.scaleMode === SCALE_LINEAR ? gl.LINEAR_MIPMAP_LINEAR : gl.NEAREST_MIPMAP_NEAREST,
244
244
  );
245
245
  gl.generateMipmap(gl.TEXTURE_2D);
246
246
  } else {
247
247
  gl.texParameteri(
248
248
  gl.TEXTURE_2D,
249
249
  gl.TEXTURE_MIN_FILTER,
250
- texture.scaleMode === SCALE_LINEAR ? gl.LINEAR : gl.NEAREST
250
+ texture.scaleMode === SCALE_LINEAR ? gl.LINEAR : gl.NEAREST,
251
251
  );
252
252
  }
253
253
  if (!texture._powerOf2) {
@@ -1,5 +1,5 @@
1
- import { generateShaderID } from '../../../util/math';
2
- import { compileProgram } from '../util';
1
+ import { generateShaderID } from '../../../util/math.js';
2
+ import { compileProgram } from '../util.js';
3
3
 
4
4
  // the next one is used for rendering triangle strips
5
5
 
@@ -1,5 +1,5 @@
1
- import { generateShaderID } from '../../../util/math';
2
- import { compileProgram } from '../util';
1
+ import { generateShaderID } from '../../../util/math.js';
2
+ import { compileProgram } from '../util.js';
3
3
 
4
4
  // this shader is used for the fast sprite rendering
5
5
 
@@ -1,5 +1,5 @@
1
- import { generateShaderID } from '../../../util/math';
2
- import { compileProgram } from '../util';
1
+ import { generateShaderID } from '../../../util/math.js';
2
+ import { compileProgram } from '../util.js';
3
3
 
4
4
  const defaultVertexSrc = [
5
5
  'attribute vec2 aVertexPosition;',
@@ -211,7 +211,7 @@ export class NormalShader {
211
211
  uniform.value.x,
212
212
  uniform.value.y,
213
213
  uniform.value.z,
214
- uniform.value.w
214
+ uniform.value.w,
215
215
  );
216
216
  } else if (uniform.type === 'sampler2D') {
217
217
  if (uniform._init) {
@@ -1,5 +1,5 @@
1
- import { generateShaderID } from '../../../util/math';
2
- import { compileProgram } from '../util';
1
+ import { generateShaderID } from '../../../util/math.js';
2
+ import { compileProgram } from '../util.js';
3
3
 
4
4
  // the next one is used for rendering primitives
5
5
 
@@ -1,5 +1,5 @@
1
- import { generateShaderID } from '../../../util/math';
2
- import { compileProgram } from '../util';
1
+ import { generateShaderID } from '../../../util/math.js';
2
+ import { compileProgram } from '../util.js';
3
3
 
4
4
  // the next one is used for rendering triangle strips
5
5
 
@@ -1,8 +1,8 @@
1
- import { PrimitiveShader } from './shader/primitive';
2
- import { ComplexPrimitiveShader } from './shader/complex';
3
- import { NormalShader } from './shader/normal';
4
- import { FastShader } from './shader/fast';
5
- import { StripShader } from './shader/strip';
1
+ import { PrimitiveShader } from './shader/primitive.js';
2
+ import { ComplexPrimitiveShader } from './shader/complex.js';
3
+ import { NormalShader } from './shader/normal.js';
4
+ import { FastShader } from './shader/fast.js';
5
+ import { StripShader } from './shader/strip.js';
6
6
 
7
7
  export class WebGLShaderManager {
8
8
  /**
@@ -1,5 +1,5 @@
1
- import { AbstractFilter } from './abstract_filter';
2
- import { NormalShader } from './shader/normal';
1
+ import { AbstractFilter } from './abstract_filter.js';
2
+ import { NormalShader } from './shader/normal.js';
3
3
 
4
4
  export class WebGLSpriteBatch {
5
5
  /**
@@ -86,8 +86,8 @@ export class WebGLSpriteBatch {
86
86
 
87
87
  /**
88
88
  * TBD.
89
- * @param {import('../../display/image').Image} sprite - TBD.
90
- * @param {import('../../geom/matrix').Matrix} matrix - TBD.
89
+ * @param {import('../../display/image.js').Image} sprite - TBD.
90
+ * @param {import('../../geom/matrix.js').Matrix} matrix - TBD.
91
91
  */
92
92
  render(sprite, matrix) {
93
93
  const texture = sprite.texture;
@@ -294,7 +294,7 @@ export class WebGLSpriteBatch {
294
294
 
295
295
  /**
296
296
  * TBD.
297
- * @param {import('./base_texture').BaseTexture} texture - TBD.
297
+ * @param {import('./base_texture.js').BaseTexture} texture - TBD.
298
298
  * @param {number} size - TBD.
299
299
  * @param {number} startIndex - TBD.
300
300
  */
@@ -1,4 +1,4 @@
1
- import { hex2rgb } from '../../util/math';
1
+ import { hex2rgb } from '../../util/math.js';
2
2
 
3
3
  export class WebGLStencilManager {
4
4
  /**
@@ -28,8 +28,8 @@ export class WebGLStencilManager {
28
28
 
29
29
  /**
30
30
  * TBD.
31
- * @param {import('../graphics').Graphics} graphics - TBD.
32
- * @param {import('./graphics_data').GraphicsData} webGLData - TBD.
31
+ * @param {import('../graphics.js').Graphics} graphics - TBD.
32
+ * @param {import('./graphics_data.js').GraphicsData} webGLData - TBD.
33
33
  * @param {object} renderSession - TBD.
34
34
  */
35
35
  pushStencil(graphics, webGLData, renderSession) {
@@ -86,8 +86,8 @@ export class WebGLStencilManager {
86
86
 
87
87
  /**
88
88
  * TBD.
89
- * @param {import('../graphics').Graphics} graphics - TBD.
90
- * @param {import('./graphics_data').GraphicsData} webGLData - TBD.
89
+ * @param {import('../graphics.js').Graphics} graphics - TBD.
90
+ * @param {import('./graphics_data.js').GraphicsData} webGLData - TBD.
91
91
  * @param {object} renderSession - TBD.
92
92
  */
93
93
  bindGraphics(graphics, webGLData, renderSession) {
@@ -133,8 +133,8 @@ export class WebGLStencilManager {
133
133
 
134
134
  /**
135
135
  * TBD.
136
- * @param {import('../graphics').Graphics} graphics - TBD.
137
- * @param {import('./graphics_data').GraphicsData} webGLData - TBD.
136
+ * @param {import('../graphics.js').Graphics} graphics - TBD.
137
+ * @param {import('./graphics_data.js').GraphicsData} webGLData - TBD.
138
138
  * @param {object} renderSession - TBD.
139
139
  */
140
140
  popStencil(graphics, webGLData, renderSession) {
@@ -1,4 +1,4 @@
1
- import { Rectangle } from '../../geom/rectangle';
1
+ import { Rectangle } from '../../geom/rectangle.js';
2
2
 
3
3
  export class TextureUvs {
4
4
  /**
@@ -19,7 +19,7 @@ export class TextureUvs {
19
19
  export class Texture {
20
20
  /**
21
21
  * TBD.
22
- * @param {import('./base_texture').BaseTexture} baseTexture - TBD.
22
+ * @param {import('./base_texture.js').BaseTexture} baseTexture - TBD.
23
23
  * @param {Rectangle} frame - TBD.
24
24
  * @param {Rectangle} crop - TBD.
25
25
  * @param {Rectangle} trim - TBD.
@@ -1,5 +1,5 @@
1
- import { BaseTexture } from './base_texture';
2
- import { Texture } from './texture';
1
+ import { BaseTexture } from './base_texture.js';
2
+ import { Texture } from './texture.js';
3
3
 
4
4
  /**
5
5
  * TBD.
@@ -1,8 +1,8 @@
1
- import { Point } from './point';
2
- import { Rectangle } from './rectangle';
3
- import { distance } from '../util/math';
4
- import { clone, contains, circumferencePoint } from './util/circle';
5
- import { GEOM_CIRCLE } from '../core/const';
1
+ import { Point } from './point.js';
2
+ import { Rectangle } from './rectangle.js';
3
+ import { distance } from '../util/math.js';
4
+ import { clone, contains, circumferencePoint } from './util/circle.js';
5
+ import { GEOM_CIRCLE } from '../core/const.js';
6
6
 
7
7
  export class Circle {
8
8
  /**
@@ -1,7 +1,7 @@
1
- import { Point } from './point';
2
- import { Rectangle } from './rectangle';
3
- import { contains } from './util/ellipse';
4
- import { GEOM_ELLIPSE } from '../core/const';
1
+ import { Point } from './point.js';
2
+ import { Rectangle } from './rectangle.js';
3
+ import { contains } from './util/ellipse.js';
4
+ import { GEOM_ELLIPSE } from '../core/const.js';
5
5
 
6
6
  export class Ellipse {
7
7
  /**
@@ -1,7 +1,7 @@
1
- import { Point } from './point';
2
- import { clone, intersectsPoints, reflect } from './util/line';
3
- import { wrap } from '../util/math';
4
- import { GEOM_LINE } from '../core/const';
1
+ import { Point } from './point.js';
2
+ import { clone, intersectsPoints, reflect } from './util/line.js';
3
+ import { wrap } from '../util/math.js';
4
+ import { GEOM_LINE } from '../core/const.js';
5
5
 
6
6
  export class Line {
7
7
  /**
@@ -221,7 +221,7 @@ export class Line {
221
221
  get length() {
222
222
  return Math.sqrt(
223
223
  (this.end.x - this.start.x) * (this.end.x - this.start.x) +
224
- (this.end.y - this.start.y) * (this.end.y - this.start.y)
224
+ (this.end.y - this.start.y) * (this.end.y - this.start.y),
225
225
  );
226
226
  }
227
227
 
@@ -1,6 +1,6 @@
1
- import { Point } from './point';
2
- import { clone } from './util/matrix';
3
- import { GEOM_MATRIX } from '../core/const';
1
+ import { Point } from './point.js';
2
+ import { clone } from './util/matrix.js';
3
+ import { GEOM_MATRIX } from '../core/const.js';
4
4
 
5
5
  export class Matrix {
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { distance, rotate, clone } from './util/point';
2
- import { GEOM_POINT } from '../core/const';
1
+ import { distance, rotate, clone } from './util/point.js';
2
+ import { GEOM_POINT } from '../core/const.js';
3
3
 
4
4
  export class Point {
5
5
  /**
@@ -1,6 +1,6 @@
1
- import { Point } from './point';
2
- import { clone } from './util/polygon';
3
- import { GEOM_POLYGON } from '../core/const';
1
+ import { Point } from './point.js';
2
+ import { clone } from './util/polygon.js';
3
+ import { GEOM_POLYGON } from '../core/const.js';
4
4
 
5
5
  export class Polygon {
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { Point } from './point';
1
+ import { Point } from './point.js';
2
2
  import {
3
3
  inflate,
4
4
  size,
@@ -10,7 +10,7 @@ import {
10
10
  intersection,
11
11
  intersectsRaw,
12
12
  union,
13
- } from './util/rectangle';
13
+ } from './util/rectangle.js';
14
14
  import {
15
15
  GEOM_RECTANGLE,
16
16
  TOP_LEFT,
@@ -22,7 +22,7 @@ import {
22
22
  BOTTOM_LEFT,
23
23
  BOTTOM_CENTER,
24
24
  BOTTOM_RIGHT,
25
- } from '../core/const';
25
+ } from '../core/const.js';
26
26
 
27
27
  export class Rectangle {
28
28
  /**
@@ -1,5 +1,5 @@
1
- import { clone } from './util/rounded_rectangle';
2
- import { GEOM_ROUNDED_RECTANGLE } from '../core/const';
1
+ import { clone } from './util/rounded_rectangle.js';
2
+ import { GEOM_ROUNDED_RECTANGLE } from '../core/const.js';
3
3
 
4
4
  export class RoundedRectangle {
5
5
  /**
@@ -1,6 +1,6 @@
1
- import { Circle } from '../circle';
2
- import { Point } from '../point';
3
- import { degToRad, distance } from '../../util/math';
1
+ import { Circle } from '../circle.js';
2
+ import { Point } from '../point.js';
3
+ import { degToRad, distance } from '../../util/math.js';
4
4
 
5
5
  /**
6
6
  * TBD.
@@ -1,6 +1,6 @@
1
- import { Point } from '../point';
2
- import { Line } from '../line';
3
- import { intersects as intersectsRect } from './rectangle';
1
+ import { Point } from '../point.js';
2
+ import { Line } from '../line.js';
3
+ import { intersects as intersectsRect } from './rectangle.js';
4
4
 
5
5
  /**
6
6
  * TBD.
@@ -1,4 +1,4 @@
1
- import { Matrix } from '../matrix';
1
+ import { Matrix } from '../matrix.js';
2
2
 
3
3
  /**
4
4
  * TBD.
@@ -1,4 +1,4 @@
1
- import { Point } from '../point';
1
+ import { Point } from '../point.js';
2
2
 
3
3
  /**
4
4
  * TBD.
@@ -1,4 +1,4 @@
1
- import { Polygon } from '../polygon';
1
+ import { Polygon } from '../polygon.js';
2
2
 
3
3
  /**
4
4
  * TBD.
@@ -1,5 +1,5 @@
1
- import { Rectangle } from '../rectangle';
2
- import { Point } from '../point';
1
+ import { Rectangle } from '../rectangle.js';
2
+ import { Point } from '../point.js';
3
3
 
4
4
  /**
5
5
  * TBD.
@@ -184,7 +184,7 @@ export function union(a, b, output = null) {
184
184
  Math.min(a.x, b.x),
185
185
  Math.min(a.y, b.y),
186
186
  Math.max(a.right, b.right) - Math.min(a.left, b.left),
187
- Math.max(a.bottom, b.bottom) - Math.min(a.top, b.top)
187
+ Math.max(a.bottom, b.bottom) - Math.min(a.top, b.top),
188
188
  );
189
189
  }
190
190
 
@@ -1,4 +1,4 @@
1
- import { RoundedRectangle } from '../rounded_rectangle';
1
+ import { RoundedRectangle } from '../rounded_rectangle.js';
2
2
 
3
3
  /**
4
4
  * TBD.
package/types/index.d.ts CHANGED
@@ -1,35 +1,35 @@
1
- import * as Const from './phaser/core/const';
2
- import { Game } from './phaser/core/game';
3
- import { GameObjectFactory } from './phaser/core/factory';
4
- import { Signal } from './phaser/core/signal';
5
- import * as MathUtils from './phaser/util/math';
6
- import { BaseTexture } from './phaser/display/webgl/base_texture';
7
- import { Sound } from './phaser/core/sound';
8
- import { SoundSprite } from './phaser/core/sound_sprite';
9
- import { SoundManager } from './phaser/core/sound_manager';
10
- import { Time } from './phaser/core/time';
11
- import { Timer } from './phaser/core/timer';
12
- import { TimerEvent } from './phaser/core/timer_event';
13
- import { Tween } from './phaser/core/tween';
14
- import { TweenData } from './phaser/core/tween_data';
15
- import { TweenManager } from './phaser/core/tween_manager';
16
- import { Animation } from './phaser/core/animation';
17
- import { AnimationManager } from './phaser/core/animation_manager';
18
- import { Texture } from './phaser/display/webgl/texture';
19
- import { Circle } from './phaser/geom/circle';
20
- import { Ellipse } from './phaser/geom/ellipse';
21
- import { Line } from './phaser/geom/line';
22
- import { Matrix } from './phaser/geom/matrix';
23
- import { Point } from './phaser/geom/point';
24
- import { Polygon } from './phaser/geom/polygon';
25
- import { Rectangle } from './phaser/geom/rectangle';
26
- import { RoundedRectangle } from './phaser/geom/rounded_rectangle';
27
- import { BitmapText } from './phaser/display/bitmap_text';
28
- import { Button } from './phaser/display/button';
29
- import { DisplayObject } from './phaser/display/display_object';
30
- import { Image } from './phaser/display/image';
31
- import { Group } from './phaser/display/group';
32
- import { Text } from './phaser/display/text';
33
- import { Graphics } from './phaser/display/graphics';
1
+ import * as Const from './phaser/core/const.js';
2
+ import { Game } from './phaser/core/game.js';
3
+ import { GameObjectFactory } from './phaser/core/factory.js';
4
+ import { Signal } from './phaser/core/signal.js';
5
+ import * as MathUtils from './phaser/util/math.js';
6
+ import { BaseTexture } from './phaser/display/webgl/base_texture.js';
7
+ import { Sound } from './phaser/core/sound.js';
8
+ import { SoundSprite } from './phaser/core/sound_sprite.js';
9
+ import { SoundManager } from './phaser/core/sound_manager.js';
10
+ import { Time } from './phaser/core/time.js';
11
+ import { Timer } from './phaser/core/timer.js';
12
+ import { TimerEvent } from './phaser/core/timer_event.js';
13
+ import { Tween } from './phaser/core/tween.js';
14
+ import { TweenData } from './phaser/core/tween_data.js';
15
+ import { TweenManager } from './phaser/core/tween_manager.js';
16
+ import { Animation } from './phaser/core/animation.js';
17
+ import { AnimationManager } from './phaser/core/animation_manager.js';
18
+ import { Texture } from './phaser/display/webgl/texture.js';
19
+ import { Circle } from './phaser/geom/circle.js';
20
+ import { Ellipse } from './phaser/geom/ellipse.js';
21
+ import { Line } from './phaser/geom/line.js';
22
+ import { Matrix } from './phaser/geom/matrix.js';
23
+ import { Point } from './phaser/geom/point.js';
24
+ import { Polygon } from './phaser/geom/polygon.js';
25
+ import { Rectangle } from './phaser/geom/rectangle.js';
26
+ import { RoundedRectangle } from './phaser/geom/rounded_rectangle.js';
27
+ import { BitmapText } from './phaser/display/bitmap_text.js';
28
+ import { Button } from './phaser/display/button.js';
29
+ import { DisplayObject } from './phaser/display/display_object.js';
30
+ import { Image } from './phaser/display/image.js';
31
+ import { Group } from './phaser/display/group.js';
32
+ import { Text } from './phaser/display/text.js';
33
+ import { Graphics } from './phaser/display/graphics.js';
34
34
  export { Const, Game, GameObjectFactory, Signal, MathUtils, BaseTexture, Sound, SoundSprite, SoundManager, Time, Timer, TimerEvent, Tween, TweenData, TweenManager, Animation, AnimationManager, Texture, Circle, Ellipse, Line, Matrix, Point, Polygon, Rectangle, RoundedRectangle, BitmapText, Button, DisplayObject, Image, Group, Text, Graphics };
35
35
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"uBACuB,qBAAqB;qBACvB,oBAAoB;kCACP,uBAAuB;uBAClC,sBAAsB;2BAClB,oBAAoB;4BAiBnB,qCAAqC;sBAf3C,qBAAqB;4BACf,4BAA4B;6BAC3B,6BAA6B;qBAErC,oBAAoB;sBACnB,qBAAqB;2BAChB,2BAA2B;sBAEhC,qBAAqB;0BACjB,0BAA0B;6BACvB,6BAA6B;0BAEhC,yBAAyB;iCAClB,iCAAiC;wBAG1C,gCAAgC;uBAEjC,sBAAsB;wBACrB,uBAAuB;qBAC1B,oBAAoB;uBAClB,sBAAsB;sBACvB,qBAAqB;wBACnB,uBAAuB;0BACrB,yBAAyB;iCAClB,iCAAiC;2BAEvC,8BAA8B;uBAElC,yBAAyB;8BADlB,iCAAiC;sBAEzC,wBAAwB;sBACxB,wBAAwB;qBACzB,uBAAuB;yBACnB,2BAA2B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"uBACuB,wBAAwB;qBAC1B,uBAAuB;kCACV,0BAA0B;uBACrC,yBAAyB;2BACrB,uBAAuB;4BAiBtB,wCAAwC;sBAf9C,wBAAwB;4BAClB,+BAA+B;6BAC9B,gCAAgC;qBAExC,uBAAuB;sBACtB,wBAAwB;2BACnB,8BAA8B;sBAEnC,wBAAwB;0BACpB,6BAA6B;6BAC1B,gCAAgC;0BAEnC,4BAA4B;iCACrB,oCAAoC;wBAG7C,mCAAmC;uBAEpC,yBAAyB;wBACxB,0BAA0B;qBAC7B,uBAAuB;uBACrB,yBAAyB;sBAC1B,wBAAwB;wBACtB,0BAA0B;0BACxB,4BAA4B;iCACrB,oCAAoC;2BAE1C,iCAAiC;uBAErC,4BAA4B;8BADrB,oCAAoC;sBAE5C,2BAA2B;sBAC3B,2BAA2B;qBAC5B,0BAA0B;yBACtB,8BAA8B"}