excalibur 0.25.1 → 0.25.2

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 (254) hide show
  1. package/.nvmrc +1 -1
  2. package/CHANGELOG.md +119 -27
  3. package/README.md +0 -1
  4. package/build/dist/Actions/ActionsComponent.d.ts +1 -1
  5. package/build/dist/Actor.d.ts +46 -45
  6. package/build/dist/Camera.d.ts +10 -2
  7. package/build/dist/Class.d.ts +4 -5
  8. package/build/dist/Collision/BodyComponent.d.ts +6 -2
  9. package/build/dist/Collision/BoundingBox.d.ts +6 -0
  10. package/build/dist/Collision/ColliderComponent.d.ts +1 -4
  11. package/build/dist/Collision/Colliders/CircleCollider.d.ts +18 -2
  12. package/build/dist/Collision/Colliders/EdgeCollider.d.ts +1 -1
  13. package/build/dist/Collision/Colliders/SeparatingAxis.d.ts +2 -2
  14. package/build/dist/Collision/Detection/DynamicTreeCollisionProcessor.d.ts +4 -4
  15. package/build/dist/Collision/Detection/Pair.d.ts +5 -1
  16. package/build/dist/Collision/Group/CollisionGroup.d.ts +0 -1
  17. package/build/dist/Collision/MotionSystem.d.ts +4 -0
  18. package/build/dist/Collision/Solver/ContactConstraintPoint.d.ts +1 -1
  19. package/build/dist/Collision/Solver/Solver.d.ts +1 -1
  20. package/build/dist/Debug/Debug.d.ts +18 -1
  21. package/build/dist/Debug/DebugFlags.d.ts +16 -3
  22. package/build/dist/Engine.d.ts +66 -8
  23. package/build/dist/EntityComponentSystem/Component.d.ts +3 -3
  24. package/build/dist/EntityComponentSystem/Components/MotionComponent.d.ts +2 -2
  25. package/build/dist/EntityComponentSystem/Entity.d.ts +4 -4
  26. package/build/dist/EntityComponentSystem/System.d.ts +1 -1
  27. package/build/dist/EntityComponentSystem/SystemManager.d.ts +6 -1
  28. package/build/dist/EventDispatcher.d.ts +0 -5
  29. package/build/dist/Events/ExEvent.d.ts +6 -0
  30. package/build/dist/Events/PointerEvents.d.ts +37 -0
  31. package/build/dist/Graphics/Animation.d.ts +3 -2
  32. package/build/dist/Graphics/Circle.d.ts +2 -0
  33. package/build/dist/Graphics/Context/ExcaliburGraphicsContext.d.ts +37 -5
  34. package/build/dist/Graphics/Context/ExcaliburGraphicsContext2DCanvas.d.ts +12 -2
  35. package/build/dist/Graphics/Context/ExcaliburGraphicsContextWebGL.d.ts +29 -13
  36. package/build/dist/Graphics/Context/circle-renderer/circle-renderer.d.ts +22 -0
  37. package/build/dist/Graphics/Context/circle-renderer/circle-renderer.frag.glsl +53 -0
  38. package/build/dist/Graphics/Context/circle-renderer/circle-renderer.vert.glsl +37 -0
  39. package/build/dist/Graphics/Context/image-renderer/image-renderer.d.ts +27 -0
  40. package/build/dist/Graphics/Context/image-renderer/image-renderer.frag.glsl +28 -0
  41. package/build/dist/Graphics/Context/{shaders/image-vertex.glsl → image-renderer/image-renderer.vert.glsl} +2 -7
  42. package/build/dist/Graphics/Context/{shaders → line-renderer}/line-fragment.glsl +0 -0
  43. package/build/dist/Graphics/Context/line-renderer/line-renderer.d.ts +21 -0
  44. package/build/dist/Graphics/Context/{shaders → line-renderer}/line-vertex.glsl +2 -2
  45. package/build/dist/Graphics/Context/{shaders → point-renderer}/point-fragment.glsl +6 -2
  46. package/build/dist/Graphics/Context/point-renderer/point-renderer.d.ts +21 -0
  47. package/build/dist/Graphics/Context/{shaders → point-renderer}/point-vertex.glsl +2 -2
  48. package/build/dist/Graphics/Context/quad-index-buffer.d.ts +36 -0
  49. package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.d.ts +23 -0
  50. package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.frag.glsl +85 -0
  51. package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.vert.glsl +42 -0
  52. package/build/dist/Graphics/Context/render-source.d.ts +7 -0
  53. package/build/dist/Graphics/Context/render-target.d.ts +26 -0
  54. package/build/dist/Graphics/Context/renderer.d.ts +20 -51
  55. package/build/dist/Graphics/Context/screen-pass-painter/screen-fragment.glsl +11 -0
  56. package/build/dist/Graphics/Context/screen-pass-painter/screen-pass-painter.d.ts +13 -0
  57. package/build/dist/Graphics/Context/screen-pass-painter/screen-vertex.glsl +11 -0
  58. package/build/dist/Graphics/Context/shader.d.ts +116 -42
  59. package/build/dist/Graphics/Context/shaders/crt-effect.glsl +64 -0
  60. package/build/dist/Graphics/Context/shaders/grayscale-fragment.glsl +13 -0
  61. package/build/dist/Graphics/Context/shaders/invert-fragment.glsl +12 -0
  62. package/build/dist/Graphics/Context/texture-loader.d.ts +8 -2
  63. package/build/dist/Graphics/Context/vertex-buffer.d.ts +49 -0
  64. package/build/dist/Graphics/Context/vertex-layout.d.ts +52 -0
  65. package/build/dist/Graphics/Context/webgl-adapter.d.ts +9 -0
  66. package/build/dist/Graphics/Context/webgl-util.d.ts +22 -0
  67. package/build/dist/Graphics/DebugGraphicsComponent.d.ts +13 -0
  68. package/build/dist/Graphics/Filtering.d.ts +15 -0
  69. package/build/dist/Graphics/Font.d.ts +61 -23
  70. package/build/dist/Graphics/FontCommon.d.ts +43 -2
  71. package/build/dist/Graphics/Graphic.d.ts +23 -9
  72. package/build/dist/Graphics/GraphicsSystem.d.ts +0 -1
  73. package/build/dist/Graphics/ImageSource.d.ts +8 -3
  74. package/build/dist/Graphics/Polygon.d.ts +2 -0
  75. package/build/dist/Graphics/PostProcessor/ColorBlindnessMode.d.ts +5 -0
  76. package/build/dist/Graphics/PostProcessor/ColorBlindnessPostProcessor.d.ts +17 -0
  77. package/build/dist/Graphics/PostProcessor/PostProcessor.d.ts +7 -0
  78. package/build/dist/Graphics/PostProcessor/ScreenShader.d.ts +16 -0
  79. package/build/dist/Graphics/PostProcessor/color-blind-fragment.glsl +62 -0
  80. package/build/dist/Graphics/Raster.d.ts +32 -5
  81. package/build/dist/Graphics/Sprite.d.ts +5 -0
  82. package/build/dist/Graphics/SpriteFont.d.ts +6 -7
  83. package/build/dist/Graphics/SpriteSheet.d.ts +1 -2
  84. package/build/dist/Graphics/Text.d.ts +18 -2
  85. package/build/dist/Graphics/index.d.ts +14 -0
  86. package/build/dist/Id.d.ts +1 -1
  87. package/build/dist/Input/EngineInput.d.ts +2 -2
  88. package/build/dist/Input/Index.d.ts +10 -3
  89. package/build/dist/Input/NativePointerButton.d.ts +10 -0
  90. package/build/dist/Input/PointerAbstraction.d.ts +33 -0
  91. package/build/dist/Input/PointerButton.d.ts +10 -0
  92. package/build/dist/Input/PointerComponent.d.ts +24 -0
  93. package/build/dist/Input/PointerEvent.d.ts +18 -0
  94. package/build/dist/Input/PointerEventReceiver.d.ts +114 -0
  95. package/build/dist/Input/PointerScope.d.ts +14 -0
  96. package/build/dist/Input/PointerSystem.d.ts +43 -0
  97. package/build/dist/Input/PointerType.d.ts +9 -0
  98. package/build/dist/Input/WheelDeltaMode.d.ts +5 -0
  99. package/build/dist/Input/WheelEvent.d.ts +18 -0
  100. package/build/dist/Interfaces/PointerEventHandlers.d.ts +17 -16
  101. package/build/dist/Label.d.ts +9 -2
  102. package/build/dist/Loader.d.ts +5 -2
  103. package/build/dist/Math/Index.d.ts +1 -0
  104. package/build/dist/Math/matrix.d.ts +19 -1
  105. package/build/dist/Math/util.d.ts +45 -0
  106. package/build/dist/Particles.d.ts +12 -0
  107. package/build/dist/Resources/Gif.d.ts +1 -1
  108. package/build/dist/Scene.d.ts +10 -1
  109. package/build/dist/Screen.d.ts +4 -3
  110. package/build/dist/TileMap.d.ts +3 -2
  111. package/build/dist/Traits/Index.d.ts +0 -1
  112. package/build/dist/Trigger.d.ts +4 -0
  113. package/build/dist/Util/Clock.d.ts +118 -0
  114. package/build/dist/Util/Fps.d.ts +40 -0
  115. package/build/dist/Util/Observable.d.ts +1 -1
  116. package/build/dist/Util/Pool.d.ts +2 -10
  117. package/build/dist/Util/Util.d.ts +23 -66
  118. package/build/dist/excalibur.js +9124 -7580
  119. package/build/dist/excalibur.js.map +1 -1
  120. package/build/dist/excalibur.min.js +1 -1
  121. package/build/dist/excalibur.min.js.LICENSE.txt +2 -2
  122. package/build/dist/excalibur.min.js.map +1 -1
  123. package/build/dist/index.d.ts +5 -2
  124. package/build/esm/Actions/ActionsComponent.d.ts +1 -1
  125. package/build/esm/Actor.d.ts +46 -45
  126. package/build/esm/Camera.d.ts +10 -2
  127. package/build/esm/Class.d.ts +4 -5
  128. package/build/esm/Collision/BodyComponent.d.ts +6 -2
  129. package/build/esm/Collision/BoundingBox.d.ts +6 -0
  130. package/build/esm/Collision/ColliderComponent.d.ts +1 -4
  131. package/build/esm/Collision/Colliders/CircleCollider.d.ts +18 -2
  132. package/build/esm/Collision/Colliders/EdgeCollider.d.ts +1 -1
  133. package/build/esm/Collision/Colliders/SeparatingAxis.d.ts +2 -2
  134. package/build/esm/Collision/Detection/DynamicTreeCollisionProcessor.d.ts +4 -4
  135. package/build/esm/Collision/Detection/Pair.d.ts +5 -1
  136. package/build/esm/Collision/Group/CollisionGroup.d.ts +0 -1
  137. package/build/esm/Collision/MotionSystem.d.ts +4 -0
  138. package/build/esm/Collision/Solver/ContactConstraintPoint.d.ts +1 -1
  139. package/build/esm/Collision/Solver/Solver.d.ts +1 -1
  140. package/build/esm/Debug/Debug.d.ts +18 -1
  141. package/build/esm/Debug/DebugFlags.d.ts +16 -3
  142. package/build/esm/Engine.d.ts +66 -8
  143. package/build/esm/EntityComponentSystem/Component.d.ts +3 -3
  144. package/build/esm/EntityComponentSystem/Components/MotionComponent.d.ts +2 -2
  145. package/build/esm/EntityComponentSystem/Entity.d.ts +4 -4
  146. package/build/esm/EntityComponentSystem/System.d.ts +1 -1
  147. package/build/esm/EntityComponentSystem/SystemManager.d.ts +6 -1
  148. package/build/esm/EventDispatcher.d.ts +0 -5
  149. package/build/esm/Events/ExEvent.d.ts +6 -0
  150. package/build/esm/Events/PointerEvents.d.ts +37 -0
  151. package/build/esm/Graphics/Animation.d.ts +3 -2
  152. package/build/esm/Graphics/Circle.d.ts +2 -0
  153. package/build/esm/Graphics/Context/ExcaliburGraphicsContext.d.ts +37 -5
  154. package/build/esm/Graphics/Context/ExcaliburGraphicsContext2DCanvas.d.ts +12 -2
  155. package/build/esm/Graphics/Context/ExcaliburGraphicsContextWebGL.d.ts +29 -13
  156. package/build/esm/Graphics/Context/circle-renderer/circle-renderer.d.ts +22 -0
  157. package/build/esm/Graphics/Context/image-renderer/image-renderer.d.ts +27 -0
  158. package/build/esm/Graphics/Context/line-renderer/line-renderer.d.ts +21 -0
  159. package/build/esm/Graphics/Context/point-renderer/point-renderer.d.ts +21 -0
  160. package/build/esm/Graphics/Context/quad-index-buffer.d.ts +36 -0
  161. package/build/esm/Graphics/Context/rectangle-renderer/rectangle-renderer.d.ts +23 -0
  162. package/build/esm/Graphics/Context/render-source.d.ts +7 -0
  163. package/build/esm/Graphics/Context/render-target.d.ts +26 -0
  164. package/build/esm/Graphics/Context/renderer.d.ts +20 -51
  165. package/build/esm/Graphics/Context/screen-pass-painter/screen-pass-painter.d.ts +13 -0
  166. package/build/esm/Graphics/Context/shader.d.ts +116 -42
  167. package/build/esm/Graphics/Context/texture-loader.d.ts +8 -2
  168. package/build/esm/Graphics/Context/vertex-buffer.d.ts +49 -0
  169. package/build/esm/Graphics/Context/vertex-layout.d.ts +52 -0
  170. package/build/esm/Graphics/Context/webgl-adapter.d.ts +9 -0
  171. package/build/esm/Graphics/Context/webgl-util.d.ts +22 -0
  172. package/build/esm/Graphics/DebugGraphicsComponent.d.ts +13 -0
  173. package/build/esm/Graphics/Filtering.d.ts +15 -0
  174. package/build/esm/Graphics/Font.d.ts +61 -23
  175. package/build/esm/Graphics/FontCommon.d.ts +43 -2
  176. package/build/esm/Graphics/Graphic.d.ts +23 -9
  177. package/build/esm/Graphics/GraphicsSystem.d.ts +0 -1
  178. package/build/esm/Graphics/ImageSource.d.ts +8 -3
  179. package/build/esm/Graphics/Polygon.d.ts +2 -0
  180. package/build/esm/Graphics/PostProcessor/ColorBlindnessMode.d.ts +5 -0
  181. package/build/esm/Graphics/PostProcessor/ColorBlindnessPostProcessor.d.ts +17 -0
  182. package/build/esm/Graphics/PostProcessor/PostProcessor.d.ts +7 -0
  183. package/build/esm/Graphics/PostProcessor/ScreenShader.d.ts +16 -0
  184. package/build/esm/Graphics/Raster.d.ts +32 -5
  185. package/build/esm/Graphics/Sprite.d.ts +5 -0
  186. package/build/esm/Graphics/SpriteFont.d.ts +6 -7
  187. package/build/esm/Graphics/SpriteSheet.d.ts +1 -2
  188. package/build/esm/Graphics/Text.d.ts +18 -2
  189. package/build/esm/Graphics/index.d.ts +14 -0
  190. package/build/esm/Id.d.ts +1 -1
  191. package/build/esm/Input/EngineInput.d.ts +2 -2
  192. package/build/esm/Input/Index.d.ts +10 -3
  193. package/build/esm/Input/NativePointerButton.d.ts +10 -0
  194. package/build/esm/Input/PointerAbstraction.d.ts +33 -0
  195. package/build/esm/Input/PointerButton.d.ts +10 -0
  196. package/build/esm/Input/PointerComponent.d.ts +24 -0
  197. package/build/esm/Input/PointerEvent.d.ts +18 -0
  198. package/build/esm/Input/PointerEventReceiver.d.ts +114 -0
  199. package/build/esm/Input/PointerScope.d.ts +14 -0
  200. package/build/esm/Input/PointerSystem.d.ts +43 -0
  201. package/build/esm/Input/PointerType.d.ts +9 -0
  202. package/build/esm/Input/WheelDeltaMode.d.ts +5 -0
  203. package/build/esm/Input/WheelEvent.d.ts +18 -0
  204. package/build/esm/Interfaces/PointerEventHandlers.d.ts +17 -16
  205. package/build/esm/Label.d.ts +9 -2
  206. package/build/esm/Loader.d.ts +5 -2
  207. package/build/esm/Math/Index.d.ts +1 -0
  208. package/build/esm/Math/matrix.d.ts +19 -1
  209. package/build/esm/Math/util.d.ts +45 -0
  210. package/build/esm/Particles.d.ts +12 -0
  211. package/build/esm/Resources/Gif.d.ts +1 -1
  212. package/build/esm/Scene.d.ts +10 -1
  213. package/build/esm/Screen.d.ts +4 -3
  214. package/build/esm/TileMap.d.ts +3 -2
  215. package/build/esm/Traits/Index.d.ts +0 -1
  216. package/build/esm/Trigger.d.ts +4 -0
  217. package/build/esm/Util/Clock.d.ts +118 -0
  218. package/build/esm/Util/Fps.d.ts +40 -0
  219. package/build/esm/Util/Observable.d.ts +1 -1
  220. package/build/esm/Util/Pool.d.ts +2 -10
  221. package/build/esm/Util/Util.d.ts +23 -66
  222. package/build/esm/excalibur.js +9001 -7438
  223. package/build/esm/excalibur.js.map +1 -1
  224. package/build/esm/excalibur.min.js +1 -1
  225. package/build/esm/excalibur.min.js.LICENSE.txt +2 -2
  226. package/build/esm/excalibur.min.js.map +1 -1
  227. package/build/esm/index.d.ts +5 -2
  228. package/package.json +31 -27
  229. package/build/dist/Graphics/Context/batch.d.ts +0 -11
  230. package/build/dist/Graphics/Context/draw-image-command.d.ts +0 -47
  231. package/build/dist/Graphics/Context/image-renderer.d.ts +0 -39
  232. package/build/dist/Graphics/Context/line-renderer.d.ts +0 -22
  233. package/build/dist/Graphics/Context/point-renderer.d.ts +0 -22
  234. package/build/dist/Graphics/Context/shaders/image-fragment.glsl +0 -48
  235. package/build/dist/Input/Pointer.d.ts +0 -134
  236. package/build/dist/Input/PointerEvents.d.ts +0 -170
  237. package/build/dist/Input/Pointers.d.ts +0 -78
  238. package/build/dist/PostProcessing/ColorBlindCorrector.d.ts +0 -28
  239. package/build/dist/PostProcessing/Index.d.ts +0 -2
  240. package/build/dist/PostProcessing/PostProcessor.d.ts +0 -6
  241. package/build/dist/Traits/CapturePointer.d.ts +0 -10
  242. package/build/esm/Graphics/Context/batch.d.ts +0 -11
  243. package/build/esm/Graphics/Context/draw-image-command.d.ts +0 -47
  244. package/build/esm/Graphics/Context/image-renderer.d.ts +0 -39
  245. package/build/esm/Graphics/Context/line-renderer.d.ts +0 -22
  246. package/build/esm/Graphics/Context/point-renderer.d.ts +0 -22
  247. package/build/esm/Input/Pointer.d.ts +0 -134
  248. package/build/esm/Input/PointerEvents.d.ts +0 -170
  249. package/build/esm/Input/Pointers.d.ts +0 -78
  250. package/build/esm/PostProcessing/ColorBlindCorrector.d.ts +0 -28
  251. package/build/esm/PostProcessing/Index.d.ts +0 -2
  252. package/build/esm/PostProcessing/PostProcessor.d.ts +0 -6
  253. package/build/esm/Traits/CapturePointer.d.ts +0 -10
  254. package/wallaby.js +0 -77
package/.nvmrc CHANGED
@@ -1 +1 @@
1
- 14.18.1
1
+ 16.13.2
package/CHANGELOG.md CHANGED
@@ -5,9 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
- ### Breaking Changes
8
+ ## Breaking Changes
9
9
 
10
10
  -
11
+
11
12
  ### Deprecated
12
13
 
13
14
  -
@@ -16,7 +17,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
16
17
 
17
18
  -
18
19
 
19
-
20
20
  ### Fixed
21
21
 
22
22
  -
@@ -29,15 +29,113 @@ This project adheres to [Semantic Versioning](http://semver.org/).
29
29
 
30
30
  -
31
31
 
32
-
33
32
  <!--------------------------------- DO NOT EDIT BELOW THIS LINE --------------------------------->
34
33
  <!--------------------------------- DO NOT EDIT BELOW THIS LINE --------------------------------->
35
34
  <!--------------------------------- DO NOT EDIT BELOW THIS LINE --------------------------------->
36
- ## [v0.25.1] - 2021-11-05
35
+
36
+
37
+ ## [0.25.2] - 2022-01-21
37
38
 
38
39
  ### Breaking Changes
39
40
 
41
+ - `ex.Util.extend()` is removed, modern js spread operator `{...someobject, ...someotherobject}` handles this better.
42
+ - Excalibur post processing is now moved to the `engine.graphicsContext.addPostProcessor()`
43
+ - Breaking change to `ex.PostProcessor`, all post processors must now now implement this interface
44
+ ```typescript
45
+ export interface PostProcessor {
46
+ intialize(gl: WebGLRenderingContext): void;
47
+ getShader(): Shader;
48
+ }
49
+ ```
50
+ ### Deprecated
51
+
52
+ - The static `Engine.createMainLoop` is now marked deprecated and will be removed in v0.26.0, it is replaced by the `Clock` api
53
+ - Mark legacy draw routines in `ex.Engine`, `ex.Scene`, and `ex.Actor` deprecated
54
+
55
+ ### Added
56
+
57
+ - Added ability to build custom renderer plugins that are accessible to the `ex.ExcaliburGraphicsContext.draw<TCustomRenderer>(...)` after registering them `ex.ExcaliburGraphicsContext.register(new LineRenderer())`
58
+ - Added ability to draw circles and rectangles with outlines! `ex.ExcaliburGraphicsContext.drawCircle(...)` and `ex.ExcaliburGraphicsContext.drawRectangle(...)`
59
+ - Added `ex.CoordPlane` can be set in the `new ex.Actor({coordPlane: CoordPlane.Screen})` constructor
60
+ - Added convenience feature, setting the color, sets the color on default graphic if applicable
61
+ - Added a `DebugGraphicsComponent` for doing direct debug draw in the `DebugSystem`
62
+ - Added back TileMap debug draw
63
+ - Added `ex.Scene.timers` to expose the list of timers
64
+ - Added support for different webgl texture blending modes as `ex.ImageFiltering` :
65
+ * `ex.ImageFiltering.Blended` - Blended is useful when you have high resolution artwork and would like it blended and smoothed
66
+ * `ex.ImageFiltering.Pixel` - Pixel is useful when you do not want smoothing aka antialiasing applied to your graphics.
67
+ - Excalibur will set a "default" blend mode based on the `ex.EngineOption` antialiasing property, but can be overridden per graphic
68
+ - `antialiasing: true`, then the blend mode defaults to `ex.ImageFiltering.Blended`
69
+ - `antialiasing: false`, then the blend mode defaults to `ex.ImageFiltering.Pixel`
70
+ - `ex.Text/ex.Font` defaults to blended which improves the default look of text rendering dramatically!
71
+ - `ex.Circle` and `ex.Polygon` also default to blended which improves the default look dramatically!
72
+ - `ex.ImageSource` can now specify a blend mode before the Image is loaded, otherwise
73
+ - Added new `measureText` method to the `ex.SpriteFont` and `ex.Font` to return the bounds of any particular text
74
+ - Added new `Clock` api to manage the core main loop. Clocks hide the implementation detail of how the mainloop runs, users just knows that it ticks somehow. Clocks additionally encapsulate any related browser timing, like `performance.now()`
75
+ 1. `StandardClock` encapsulates the existing `requestAnimationFrame` api logic
76
+ 2. `TestClock` allows a user to manually step the mainloop, this can be useful for frame by frame debugging #1170
77
+ 3. The base abstract clock implements the specifics of elapsed time
78
+
79
+ - Added a new feature to Engine options to set a maximum fps `new ex.Engine({...options, maxFps: 30})`. This can be useful when needing to deliver a consistent experience across devices.
80
+ - Pointers can now be configured to use the collider or the graphics bounds as the target for pointers with the `ex.PointerComponent`
81
+ - `useColliderShape` - (default true) uses the collider component geometry for pointer events
82
+ - `useGraphicsBounds` - (default false) uses the graphics bounds for pointer events
83
+
84
+
85
+ ### Fixed
86
+
87
+ - Fixed issue [#2192] where Actor.center was not correct in child actors
88
+ - Fixed issue where `ex.CircleCollider`s did not respect rotation/scale when offset
89
+ - Fixed issue [#2157] when compiling in TS strict mode complaining about `ex.Poolable`
90
+ - Fixed issue where scaled graphics were not calculating the correct bounds
91
+ - Fixed unreleased issue where clock implementation was not updating frame id
92
+ - Fixed alpha pre-multiply math in multiple shaders
93
+ - Fixed label initialization of fonts, passing a font in the constructor work
94
+ - Fixed bug in sprite bounds calculations not taking scale into account
95
+ - Fixed bug with pointer api where clicking on screen coordinate actors didn't work
96
+ - Fixed [#1815] issue where Camera would jitter when using a strategies based off of actors in the previous frame.
97
+ - Fixed issue where TileMaps would sometimes have a geometry seam that may not fall on an actual screen pixel causing a visible gap between tiles and the background
98
+ -- ![image](https://user-images.githubusercontent.com/612071/144700377-ac4585ba-3f4c-44b8-95db-ad36c5fc9a32.png)
99
+ - Fixed unreleased issue where SpriteFonts log every frame they detect a misconfigured font.
100
+ - Fixed unreleased issue where clock when constraining fps would pass larger than expected elapsed times to the simulation causing things to "speed up" bizarrely
101
+ - Fixed unreleased issue where games with no resources would crash
102
+ - Fixed issue [#2152] where shared state in `ex.Font` and `ex.SpriteFont` prevented text from aligning properly when re-used
103
+ - Fixed issue where fast moving `CompositeCollider`s were erroneously generating pairs for their constituent parts
104
+ - Fixed Safari 13.1 crash when booting Excalibur because of they odd MediaQuery API in older Safari
105
+ - Fixed issue where pointers did not work because of missing types
106
+ - Fixed issue with `ArcadeSolver` where stacked/overlapped tiles would double solve the position of the collider for the same overlap
107
+ - Fixed issue where changing the `ex.Sprite.width` or `ex.Sprite.height` did not resize the graphic.
108
+ - Fixed issue where initial Actor anchors set in the constructor were not being set in the graphics component
109
+ - EventDispatcher
110
+ - `EventDispatcher` - doesn't require the target object. The context of `this` is not tampered anymore.
111
+ - Pointers
112
+ - `PointerAbstraction` - is fixed to maintain reference
40
113
  -
114
+
115
+ ### Updates
116
+
117
+ - The following Engine's pieces: `Collision` `Graphics` `Resources` `Trigger` are updated to reflect the new EventDispatcher behavior.
118
+ - Refactor camera/screen interaction to utilize transforms instead of bespoke coordinate conversion
119
+ ### Changed
120
+
121
+ - Updated Graphics to improve general performance
122
+ - Updated the webgl primitives to make building `ex.Shader`s, `ex.VertexBuffer`s, and `ex.VertexLayout`s much easier
123
+ - Broke up the internal monolithic shader into separate internal renderer plugins
124
+ - Changed the debug system to separate displaying the debug position point (`game.debug.transform.showPosition = true`) and debug position label (`game.debug.transform.showPositionLabel = true`)
125
+ - `ex.ColorBlindCorrector` is renamed to `ex.ColorBlindnessPostProcessor`, and `ex.ColorBlindness` is renamed to `ex.ColorBlindnessMode`
126
+ - Color blindness can still be corrected or simulated:
127
+ * `game.debug.colorBlindMode.correct(ex.ColorBlindnessMode.Deuteranope)`
128
+ * `game.debug.colorBlindMode.simulate(ex.ColorBlindnessMode.Deuteranope)`
129
+ - Excalibur now uses pre-multiplied alpha automatically, images will be unpacked into memory using `gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true)`
130
+ - Excalibur FPS is now sampled over 100ms blocks, this gives a more usable fps in the stats. The sampler is available off of the engine clock `engine.clock.fpsSampler.fps`
131
+ - Pointer Events:
132
+ * Event types (up, down, move, etc) now all exist in 2 types `ex.Input.PointerEvent` and `ex.Input.WheelEvent`
133
+ * The `stopPropagation()` method used to cancel further dispatches has been renamed to `cancel()` to match other events API.
134
+ * Events no longer have a reference to the `pointer` but now have all of the same information that was availabe on the pointer `worldPos`, `screenPos`, `pagePos`
135
+
136
+
137
+ ## [0.25.1] - 2021-11-05
138
+
41
139
  ### Added
42
140
 
43
141
  - *Experimental:* Native ES module bundle distribution in package `esm/excalibur.js` entrypoint ([#2064](https://github.com/excaliburjs/Excalibur/pull/2064))
@@ -45,21 +143,22 @@ This project adheres to [Semantic Versioning](http://semver.org/).
45
143
  - Story to show a play / pause implementation.
46
144
  - `ex.Animation` now support `totalDuration` that will calculate automatically each frame duration based on how many frames have.
47
145
  - `ex.Animation` now supports `.reverse()` to reverse the direction of play in an animation, use the `ex.Animation.direction` to inspect if the animation is playing in the `ex.AnimationDirection.Forward` direction or the `ex.AnimationDirection.Backward` direction.
48
- -
49
146
  ### Changed
50
147
 
148
+ - Pointer system refactored into 2 parts:
149
+ * First is an ECS style system `ex.PointerSystem` that dispatches events to Entities/Actors
150
+ * Second is an event receiver `ex.PointerEventReceiver` which is responsible for collecting the native browser events
151
+ * The API is mostly backwards compatible breaking changes are listed in the breaking change section, event types have been simplified, and `stopPropagation()` and been renamed to `cancel()`
51
152
  - Internal Actions implementation converted to ECS system and component, this is a backwards compatible change with v0.25.0
52
153
  - `ex.ActionsSystem` and `ex.ActionsComponent` now wrap the existing `ex.ActionContext`
53
154
  - Actions can be shared with all entities now!
54
155
  - Dispatch the `hidePlayButton` on the Button Event to prevent that keep on the screen on some situations [#1431].
55
156
  - Revert VSCode Workbench Colors
56
- -
157
+
57
158
  ### Deprecated
58
159
 
59
160
  - Actions `asPromise()` renamed to `toPromise()`
60
- ### Removed
61
161
 
62
- -
63
162
  ### Fixed
64
163
 
65
164
  - Fixed loader button position on window resize
@@ -123,7 +222,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
123
222
  - Directly changing debug drawing by `engine.isDebug = value` has been replaced by `engine.showDebug(value)` and `engine.toggleDebug()` ([#1655](https://github.com/excaliburjs/Excalibur/issues/1655))
124
223
  - `UIActor` Class instances need to be replaced to `ScreenElement` (This Class it's marked as Obsolete) ([#1656](https://github.com/excaliburjs/Excalibur/issues/1656))
125
224
  - Switch to browser based promise, the Excalibur implementation `ex.Promise` is marked deprecated ([#994](https://github.com/excaliburjs/Excalibur/issues/994))
126
-
127
225
  - `DisplayMode`'s have changed ([#1733](https://github.com/excaliburjs/Excalibur/issues/1733)) & ([#1928](https://github.com/excaliburjs/Excalibur/issues/1928)):
128
226
 
129
227
  - `DisplayMode.FitContainer` fits the screen to the available width/height in the canvas parent element, while maintaining aspect ratio and resolution
@@ -199,6 +297,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
199
297
  - Add `KeyEvent.originalEvent?: KeyboardEvent` which exposes the raw keyboard event handled from the browser.
200
298
  - Added a new getter to GraphicsComponent.ts called currentKeys that will return the names of the graphics shown in all layers
201
299
  - Added a new getter to GraphicsLayer called currentKeys that will the names of the graphics shown in this layer
300
+
202
301
  ### Changed
203
302
 
204
303
  - `Gif` now supports new graphics component
@@ -219,8 +318,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
219
318
  - `ex.Promise` is marked deprecated ([#994](https://github.com/excaliburjs/Excalibur/issues/994))
220
319
  - `ex.DisplayMode.Position` CSS can accomplish this task better than Excalibur ([#1733](https://github.com/excaliburjs/Excalibur/issues/1733))
221
320
 
222
- ### Removed
223
-
224
321
  ### Fixed
225
322
 
226
323
  - Fixed allow `ex.ColliderComponent` to not have a collider
@@ -253,8 +350,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
253
350
  - Fixed `anchor` properly of single shape `Actor` [#1535](https://github.com/excaliburjs/Excalibur/issues/1535)
254
351
  - Fixed Safari bug where `Sound` resources would fail to load ([#1848](https://github.com/excaliburjs/Excalibur/issues/1848))
255
352
 
353
+ <!----------------------------------------------------------------------------------------------->
256
354
 
257
- ## [[0.24.5] - 2020-09-07
355
+ ## [0.24.5] - 2020-09-07
258
356
 
259
357
  ### Breaking Changes
260
358
 
@@ -269,19 +367,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
269
367
  - Adds new `ex.System` type which operates on matching Entities to do some behavior in Excalibur.
270
368
  - Adds new `ex.Observable` a small observable implementation for observing Entity component changes over time
271
369
 
272
- ### Changed
273
-
274
- ### Deprecated
275
-
276
- ### Removed
277
-
278
370
  ### Fixed
279
371
 
280
372
  - Fixed Animation flicker bug on the first frame when using animations with scale, anchors, or rotation. ([#1636](https://github.com/excaliburjs/Excalibur/issues/1636))
281
373
 
282
- ## [0.24.4] - 2020-09-02
374
+ <!----------------------------------------------------------------------------------------------->
283
375
 
284
- ### Breaking Changes
376
+ ## [0.24.4] - 2020-09-02
285
377
 
286
378
  ### Added
287
379
 
@@ -302,10 +394,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
302
394
  - Upgrade Excalibur to TypeScript 3.9.2
303
395
  - Upgrade Excalibur to Node 12 LTS
304
396
 
305
- ### Deprecated
306
-
307
- ### Removed
308
-
309
397
  ### Fixed
310
398
 
311
399
  - Fixed Loader play button markup and styles are now cleaned up after clicked ([#1431](https://github.com/excaliburjs/Excalibur/issues/1431))
@@ -315,6 +403,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
315
403
  - Fixed issue where actors that were not in scene still received pointer events ([#1555](https://github.com/excaliburjs/Excalibur/issues/1555))
316
404
  - Fixed Scene initialization order when using the lifecycle overrides ([#1553](https://github.com/excaliburjs/Excalibur/issues/1553))
317
405
 
406
+ <!----------------------------------------------------------------------------------------------->
407
+
318
408
  ## [0.24.0] - 2020-04-23
319
409
 
320
410
  ### Breaking Changes
@@ -382,7 +472,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
382
472
  - Changed `moveBy`, `rotateBy`, and `scaleBy` to operate relative to the current actor position at a speed, instead of moving to an absolute by a certain time.
383
473
  - Changed event handlers in excalibur to expect non-null event objects, before `hander: (event?: GameEvent) => void` implied that event could be null. This change addresses ([#1147](https://github.com/excaliburjs/Excalibur/issues/1147)) making strict null/function checks compatible with new TypeScript.
384
474
  - Changed collision system to remove actor coupling, in addition `ex.Collider` is a new type that encapsulates all collision behavior. Use `ex.Actor.body.collider` to interact with collisions in Excalibur ([#1119](https://github.com/excaliburjs/Excalibur/issues/1119))
385
-
386
475
  - Add new `ex.Collider` type that is the housing for all collision related code
387
476
  - The source of truth for `ex.CollisionType` is now on collider, with a convenience getter on actor
388
477
  - The collision system now operates on `ex.Collider`'s not `ex.Actor`'s
@@ -422,7 +511,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
422
511
  - Removed `NaiveCollisionBroadphase` as it was no longer used
423
512
  - Renamed methods and properties will be available until `v0.24.0`
424
513
  - Deprecated collision attributes on actor, use `Actor.body.collider`
425
-
426
514
  - `Actor.x` & `Actor.y` will be removed in `v0.24.0` use `Actor.pos.x` & `Actor.pos.y`
427
515
  - `Actor.collisionArea` will be removed in `v0.24.0` use `Actor.body.collider.shape`
428
516
  - `Actor.getLeft()`, `Actor.getRight()`, `Actor.getTop()`, and `Actor.getBottom` are deprecated
@@ -1184,7 +1272,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1184
1272
 
1185
1273
  <!----------------------------------------------------------------------------------------------->
1186
1274
 
1187
- [unreleased]: https://github.com/excaliburjs/Excalibur/compare/v0.24.0...HEAD
1275
+ [unreleased]: https://github.com/excaliburjs/Excalibur/compare/v0.25.1...HEAD
1276
+ [0.25.1]: https://github.com/excaliburjs/Excalibur/compare/v0.25.0...v0.25.1
1277
+ [0.25.0]: https://github.com/excaliburjs/Excalibur/compare/v0.24.5...v0.25.0
1278
+ [0.24.5]: https://github.com/excaliburjs/Excalibur/compare/v0.24.4...v0.24.5
1279
+ [0.24.4]: https://github.com/excaliburjs/Excalibur/compare/v0.24.0...v0.24.4
1188
1280
  [0.24.0]: https://github.com/excaliburjs/Excalibur/compare/v0.23.0...v0.24.0
1189
1281
  [0.23.0]: https://github.com/excaliburjs/Excalibur/compare/v0.22.0...v0.23.0
1190
1282
  [0.22.0]: https://github.com/excaliburjs/Excalibur/compare/v0.21.0...v0.22.0
package/README.md CHANGED
@@ -1,6 +1,5 @@
1
1
  ![Logo](/assets/logo.png?raw=true)
2
2
 
3
- [![Build Status](https://img.shields.io/travis/excaliburjs/Excalibur/main.svg)](https://travis-ci.org/excaliburjs/Excalibur)
4
3
  [![Appveyor status](https://img.shields.io/appveyor/ci/eonarheim/excalibur/main.svg)](https://ci.appveyor.com/project/eonarheim/excalibur)
5
4
  [![Coverage Status](https://coveralls.io/repos/github/excaliburjs/Excalibur/badge.svg?branch=main)](https://coveralls.io/github/excaliburjs/Excalibur?branch=main)
6
5
  [![npm version](https://img.shields.io/npm/v/excalibur.svg)](https://www.npmjs.com/package/excalibur)
@@ -18,7 +18,7 @@ export declare class ActionsComponent extends Component<'ex.actions'> implements
18
18
  onRemove(): void;
19
19
  /**
20
20
  * Returns the internal action queue
21
- * @returns action queu
21
+ * @returns action queue
22
22
  */
23
23
  getQueue(): ActionQueue;
24
24
  /**
@@ -1,6 +1,5 @@
1
1
  import { Texture } from './Drawing/Texture';
2
2
  import { InitializeEvent, KillEvent, PreUpdateEvent, PostUpdateEvent, PreDrawEvent, PostDrawEvent, PreDebugDrawEvent, PostDebugDrawEvent, PostCollisionEvent, PreCollisionEvent, CollisionStartEvent, CollisionEndEvent, PostKillEvent, PreKillEvent, GameEvent, ExitTriggerEvent, EnterTriggerEvent, EnterViewPortEvent, ExitViewPortEvent } from './Events';
3
- import { PointerEvent, WheelEvent, PointerDragEvent } from './Input/PointerEvents';
4
3
  import { Engine } from './Engine';
5
4
  import { Color } from './Color';
6
5
  import { Sprite } from './Drawing/Sprite';
@@ -16,12 +15,14 @@ import * as Events from './Events';
16
15
  import { PointerEvents } from './Interfaces/PointerEventHandlers';
17
16
  import { CollisionType } from './Collision/CollisionType';
18
17
  import { Entity } from './EntityComponentSystem/Entity';
19
- import { TransformComponent } from './EntityComponentSystem/Components/TransformComponent';
18
+ import { CoordPlane, TransformComponent } from './EntityComponentSystem/Components/TransformComponent';
20
19
  import { MotionComponent } from './EntityComponentSystem/Components/MotionComponent';
21
20
  import { GraphicsComponent } from './Graphics/GraphicsComponent';
22
21
  import { ColliderComponent } from './Collision/ColliderComponent';
23
22
  import { Collider, CollisionGroup } from './Collision/Index';
24
- import { CapturePointerConfig } from './Input/CapturePointerConfig';
23
+ import { PointerEvent } from './Input/PointerEvent';
24
+ import { WheelEvent } from './Input/WheelEvent';
25
+ import { PointerComponent } from './Input/PointerComponent';
25
26
  import { ActionsComponent } from './Actions/ActionsComponent';
26
27
  /**
27
28
  * Type guard for checking if something is an Actor
@@ -45,9 +46,13 @@ export interface ActorArgs {
45
46
  */
46
47
  y?: number;
47
48
  /**
48
- * Optionaly set the (x, y) position of the actor as a vector, default is (0, 0)
49
+ * Optionally set the (x, y) position of the actor as a vector, default is (0, 0)
49
50
  */
50
51
  pos?: Vector;
52
+ /**
53
+ * Optionally set the coordinate plane of the actor, default is [[CoordPlane.World]] meaning actor is subject to camera positioning
54
+ */
55
+ coordPlane?: CoordPlane;
51
56
  /**
52
57
  * Optionally set the width of a box collider for the actor
53
58
  */
@@ -145,7 +150,11 @@ export declare class Actor extends Entity implements Eventable, PointerEvents, C
145
150
  */
146
151
  get collider(): ColliderComponent;
147
152
  /**
148
- * Useful for quickly scripting actor behavior, like moving to a place, patroling back and forth, blinking, etc.
153
+ * Access to the Actor's built in [[PointerComponent]] config
154
+ */
155
+ get pointer(): PointerComponent;
156
+ /**
157
+ * Useful for quickly scripting actor behavior, like moving to a place, patrolling back and forth, blinking, etc.
149
158
  *
150
159
  * Access to the Actor's built in [[ActionsComponent]] which forwards to the
151
160
  * [[ActionContext|Action context]] of the actor.
@@ -258,6 +267,9 @@ export declare class Actor extends Entity implements Eventable, PointerEvents, C
258
267
  * The scene that the actor is in
259
268
  */
260
269
  scene: Scene;
270
+ /**
271
+ * @deprecated will be removed in v0.26.0
272
+ */
261
273
  frames: {
262
274
  [key: string]: Drawable;
263
275
  };
@@ -265,7 +277,7 @@ export declare class Actor extends Entity implements Eventable, PointerEvents, C
265
277
  * Access to the current drawing for the actor, this can be
266
278
  * an [[Animation]], [[Sprite]], or [[Polygon]].
267
279
  * Set drawings with [[setDrawing]].
268
- * @deprecated
280
+ * @deprecated will be removed in v0.26.0
269
281
  */
270
282
  currentDrawing: Drawable;
271
283
  /**
@@ -281,26 +293,15 @@ export declare class Actor extends Entity implements Eventable, PointerEvents, C
281
293
  set draggable(isDraggable: boolean);
282
294
  /**
283
295
  * Modify the current actor update pipeline.
296
+ * @deprecated will be removed in v0.26.0
284
297
  */
285
298
  traits: Trait[];
286
299
  /**
287
- * Sets the color of the actor. A rectangle of this color will be
288
- * drawn if no [[Drawable]] is specified as the actors drawing.
289
- *
290
- * The default is `null` which prevents a rectangle from being drawn.
300
+ * Sets the color of the actor's current graphic
291
301
  */
292
302
  get color(): Color;
293
303
  set color(v: Color);
294
304
  private _color;
295
- /**
296
- * Whether or not to enable the [[Traits.CapturePointer]] trait that propagates
297
- * pointer events to this actor
298
- */
299
- enableCapturePointer: boolean;
300
- /**
301
- * Configuration for [[Traits.CapturePointer]] trait
302
- */
303
- capturePointer: CapturePointerConfig;
304
305
  /**
305
306
  *
306
307
  * @param config
@@ -321,10 +322,6 @@ export declare class Actor extends Entity implements Eventable, PointerEvents, C
321
322
  * @internal
322
323
  */
323
324
  _initialize(engine: Engine): void;
324
- private _capturePointerEvents;
325
- private _captureMoveEvents;
326
- private _captureDragEvents;
327
- private _checkForPointerOptIn;
328
325
  on(eventName: Events.exittrigger, handler: (event: ExitTriggerEvent) => void): void;
329
326
  on(eventName: Events.entertrigger, handler: (event: EnterTriggerEvent) => void): void;
330
327
  /**
@@ -379,11 +376,11 @@ export declare class Actor extends Entity implements Eventable, PointerEvents, C
379
376
  on(eventName: Events.pointermove, handler: (event: PointerEvent) => void): void;
380
377
  on(eventName: Events.pointercancel, handler: (event: PointerEvent) => void): void;
381
378
  on(eventName: Events.pointerwheel, handler: (event: WheelEvent) => void): void;
382
- on(eventName: Events.pointerdragstart, handler: (event: PointerDragEvent) => void): void;
383
- on(eventName: Events.pointerdragend, handler: (event: PointerDragEvent) => void): void;
384
- on(eventName: Events.pointerdragenter, handler: (event: PointerDragEvent) => void): void;
385
- on(eventName: Events.pointerdragleave, handler: (event: PointerDragEvent) => void): void;
386
- on(eventName: Events.pointerdragmove, handler: (event: PointerDragEvent) => void): void;
379
+ on(eventName: Events.pointerdragstart, handler: (event: PointerEvent) => void): void;
380
+ on(eventName: Events.pointerdragend, handler: (event: PointerEvent) => void): void;
381
+ on(eventName: Events.pointerdragenter, handler: (event: PointerEvent) => void): void;
382
+ on(eventName: Events.pointerdragleave, handler: (event: PointerEvent) => void): void;
383
+ on(eventName: Events.pointerdragmove, handler: (event: PointerEvent) => void): void;
387
384
  on(eventName: Events.enterviewport, handler: (event: EnterViewPortEvent) => void): void;
388
385
  on(eventName: Events.exitviewport, handler: (event: ExitViewPortEvent) => void): void;
389
386
  on(eventName: string, handler: (event: GameEvent<Actor>) => void): void;
@@ -441,11 +438,11 @@ export declare class Actor extends Entity implements Eventable, PointerEvents, C
441
438
  once(eventName: Events.pointermove, handler: (event: PointerEvent) => void): void;
442
439
  once(eventName: Events.pointercancel, handler: (event: PointerEvent) => void): void;
443
440
  once(eventName: Events.pointerwheel, handler: (event: WheelEvent) => void): void;
444
- once(eventName: Events.pointerdragstart, handler: (event: PointerDragEvent) => void): void;
445
- once(eventName: Events.pointerdragend, handler: (event: PointerDragEvent) => void): void;
446
- once(eventName: Events.pointerdragenter, handler: (event: PointerDragEvent) => void): void;
447
- once(eventName: Events.pointerdragleave, handler: (event: PointerDragEvent) => void): void;
448
- once(eventName: Events.pointerdragmove, handler: (event: PointerDragEvent) => void): void;
441
+ once(eventName: Events.pointerdragstart, handler: (event: PointerEvent) => void): void;
442
+ once(eventName: Events.pointerdragend, handler: (event: PointerEvent) => void): void;
443
+ once(eventName: Events.pointerdragenter, handler: (event: PointerEvent) => void): void;
444
+ once(eventName: Events.pointerdragleave, handler: (event: PointerEvent) => void): void;
445
+ once(eventName: Events.pointerdragmove, handler: (event: PointerEvent) => void): void;
449
446
  once(eventName: Events.enterviewport, handler: (event: EnterViewPortEvent) => void): void;
450
447
  once(eventName: Events.exitviewport, handler: (event: ExitViewPortEvent) => void): void;
451
448
  once(eventName: string, handler: (event: GameEvent<Actor>) => void): void;
@@ -493,11 +490,11 @@ export declare class Actor extends Entity implements Eventable, PointerEvents, C
493
490
  off(eventName: Events.pointermove, handler?: (event: PointerEvent) => void): void;
494
491
  off(eventName: Events.pointercancel, handler?: (event: PointerEvent) => void): void;
495
492
  off(eventName: Events.pointerwheel, handler?: (event: WheelEvent) => void): void;
496
- off(eventName: Events.pointerdragstart, handler?: (event: PointerDragEvent) => void): void;
497
- off(eventName: Events.pointerdragend, handler?: (event: PointerDragEvent) => void): void;
498
- off(eventName: Events.pointerdragenter, handler?: (event: PointerDragEvent) => void): void;
499
- off(eventName: Events.pointerdragleave, handler?: (event: PointerDragEvent) => void): void;
500
- off(eventName: Events.pointerdragmove, handler?: (event: PointerDragEvent) => void): void;
493
+ off(eventName: Events.pointerdragstart, handler?: (event: PointerEvent) => void): void;
494
+ off(eventName: Events.pointerdragend, handler?: (event: PointerEvent) => void): void;
495
+ off(eventName: Events.pointerdragenter, handler?: (event: PointerEvent) => void): void;
496
+ off(eventName: Events.pointerdragleave, handler?: (event: PointerEvent) => void): void;
497
+ off(eventName: Events.pointerdragmove, handler?: (event: PointerEvent) => void): void;
501
498
  off(eventName: Events.prekill, handler?: (event: PreKillEvent) => void): void;
502
499
  off(eventName: Events.postkill, handler?: (event: PostKillEvent) => void): void;
503
500
  off(eventName: Events.initialize, handler?: (event: Events.InitializeEvent<Actor>) => void): void;
@@ -563,19 +560,19 @@ export declare class Actor extends Entity implements Eventable, PointerEvents, C
563
560
  setDrawing(key: number): void;
564
561
  /**
565
562
  * Adds a whole texture as the "default" drawing. Set a drawing using [[setDrawing]].
566
- * @deprecated Use [[GraphicsComponent.add|Actor.graphics.add]]
563
+ * @deprecated Use [[GraphicsComponent.add|Actor.graphics.add]], will be removed in v0.26.0
567
564
  */
568
565
  addDrawing(texture: Texture): void;
569
566
  /**
570
567
  * Adds a whole sprite as the "default" drawing. Set a drawing using [[setDrawing]].
571
- * @deprecated Use [[GraphicsComponent.add|Actor.graphics.add]]
568
+ * @deprecated Use [[GraphicsComponent.add|Actor.graphics.add]], will be removed in v0.26.0
572
569
  */
573
570
  addDrawing(sprite: Sprite): void;
574
571
  /**
575
572
  * Adds a drawing to the list of available drawings for an actor. Set a drawing using [[setDrawing]].
576
573
  * @param key The key to associate with a drawing for this actor
577
574
  * @param drawing This can be an [[Animation]], [[Sprite]], or [[Polygon]].
578
- * @deprecated Use [[GraphicsComponent.add|Actor.graphics.add]]
575
+ * @deprecated Use [[GraphicsComponent.add|Actor.graphics.add]], will be removed in v0.26.0
579
576
  */
580
577
  addDrawing(key: any, drawing: Drawable): void;
581
578
  /**
@@ -584,7 +581,7 @@ export declare class Actor extends Entity implements Eventable, PointerEvents, C
584
581
  */
585
582
  get z(): number;
586
583
  /**
587
- * @deprecated Use [[Actor.z]]
584
+ * @deprecated Use [[Actor.z]], will be removed in v0.26.0
588
585
  */
589
586
  getZIndex(): number;
590
587
  /**
@@ -596,13 +593,17 @@ export declare class Actor extends Entity implements Eventable, PointerEvents, C
596
593
  set z(newZ: number);
597
594
  /**
598
595
  * @param newIndex new z-index to assign
599
- * @deprecated Use [[Actor.z]]
596
+ * @deprecated Use [[Actor.z]], will be removed in v0.26.0
600
597
  */
601
598
  setZIndex(newIndex: number): void;
602
599
  /**
603
- * Get the center point of an actor
600
+ * Get the center point of an actor (global position)
604
601
  */
605
602
  get center(): Vector;
603
+ /**
604
+ * Get the local center point of an actor
605
+ */
606
+ get localCenter(): Vector;
606
607
  get width(): number;
607
608
  get height(): number;
608
609
  /**
@@ -720,7 +721,7 @@ export declare class Actor extends Entity implements Eventable, PointerEvents, C
720
721
  *
721
722
  *
722
723
  * **Warning** only works with Flags.useLegacyDrawing() enabled
723
- * @deprecated Use Actor.graphics.onPostDraw, will be removed in v0.26.0
724
+ * @deprecated will be removed in v0.26.0
724
725
  * @internal
725
726
  */
726
727
  debugDraw(_ctx: CanvasRenderingContext2D): void;
@@ -7,6 +7,7 @@ import { PreUpdateEvent, PostUpdateEvent, GameEvent, InitializeEvent } from './E
7
7
  import { Class } from './Class';
8
8
  import { BoundingBox } from './Collision/BoundingBox';
9
9
  import { ExcaliburGraphicsContext } from './Graphics/Context/ExcaliburGraphicsContext';
10
+ import { Matrix } from './Math/matrix';
10
11
  /**
11
12
  * Interface that describes a custom camera strategy for tracking targets
12
13
  */
@@ -148,6 +149,8 @@ export declare class LimitCameraBoundsStrategy implements CameraStrategy<Boundin
148
149
  *
149
150
  */
150
151
  export declare class Camera extends Class implements CanUpdate, CanInitialize {
152
+ transform: Matrix;
153
+ inverse: Matrix;
151
154
  protected _follow: Actor;
152
155
  private _cameraStrategies;
153
156
  strategy: StrategyContainer;
@@ -171,6 +174,7 @@ export declare class Camera extends Class implements CanUpdate, CanInitialize {
171
174
  rotation: number;
172
175
  /**
173
176
  * Current angular velocity
177
+ * @deprecated will be removed in v0.26.0, use angularVelocity
174
178
  */
175
179
  rx: number;
176
180
  /**
@@ -190,7 +194,7 @@ export declare class Camera extends Class implements CanUpdate, CanInitialize {
190
194
  */
191
195
  vel: Vector;
192
196
  /**
193
- * GEt or set the camera's acceleration
197
+ * Get or set the camera's acceleration
194
198
  */
195
199
  acc: Vector;
196
200
  private _cameraMoving;
@@ -328,6 +332,7 @@ export declare class Camera extends Class implements CanUpdate, CanInitialize {
328
332
  */
329
333
  onPostUpdate(_engine: Engine, _delta: number): void;
330
334
  private _engine;
335
+ private _screen;
331
336
  private _isInitialized;
332
337
  get isInitialized(): boolean;
333
338
  _initialize(_engine: Engine): void;
@@ -348,13 +353,16 @@ export declare class Camera extends Class implements CanUpdate, CanInitialize {
348
353
  once(eventName: 'preupdate', handler: (event: PreUpdateEvent) => void): void;
349
354
  once(eventName: 'postupdate', handler: (event: PostUpdateEvent) => void): void;
350
355
  once(eventName: string, handler: (event: GameEvent<Camera>) => void): void;
356
+ runStrategies(engine: Engine, delta: number): void;
357
+ updateViewport(): void;
351
358
  update(_engine: Engine, delta: number): void;
352
359
  /**
353
360
  * Applies the relevant transformations to the game canvas to "move" or apply effects to the Camera
354
- * @param ctx Canvas context to apply transformations
361
+ * @param ctx Canvas context to apply transformations
355
362
  */
356
363
  draw(ctx: CanvasRenderingContext2D): void;
357
364
  draw(ctx: ExcaliburGraphicsContext): void;
365
+ updateTransform(): void;
358
366
  debugDraw(_ctx: CanvasRenderingContext2D): void;
359
367
  private _isDoneShaking;
360
368
  }
@@ -1,4 +1,3 @@
1
- import { GameEvent } from './Events';
2
1
  import { EventDispatcher } from './EventDispatcher';
3
2
  import { Eventable } from './Interfaces/Evented';
4
3
  /**
@@ -17,7 +16,7 @@ export declare class Class implements Eventable {
17
16
  * @param eventName Name of the event to listen for
18
17
  * @param handler Event handler for the thrown event
19
18
  */
20
- on(eventName: string, handler: (event: GameEvent<any>) => void): void;
19
+ on(eventName: string, handler: (event: any) => void): void;
21
20
  /**
22
21
  * Alias for `removeEventListener`. If only the eventName is specified
23
22
  * it will remove all handlers registered for that specific event. If the eventName
@@ -26,18 +25,18 @@ export declare class Class implements Eventable {
26
25
  * @param eventName Name of the event to listen for
27
26
  * @param handler Event handler for the thrown event
28
27
  */
29
- off(eventName: string, handler?: (event: GameEvent<any>) => void): void;
28
+ off(eventName: string, handler?: (event: any) => void): void;
30
29
  /**
31
30
  * Emits a new event
32
31
  * @param eventName Name of the event to emit
33
32
  * @param eventObject Data associated with this event
34
33
  */
35
- emit(eventName: string, eventObject: GameEvent<any>): void;
34
+ emit(eventName: string, eventObject: any): void;
36
35
  /**
37
36
  * Once listens to an event one time, then unsubscribes from that event
38
37
  *
39
38
  * @param eventName The name of the event to subscribe to once
40
39
  * @param handler The handler of the event that will be auto unsubscribed
41
40
  */
42
- once(eventName: string, handler: (event: GameEvent<any>) => void): void;
41
+ once(eventName: string, handler: (event: any) => void): void;
43
42
  }
@@ -26,7 +26,7 @@ export declare class BodyComponent extends Component<'ex.body'> implements Clona
26
26
  dependencies: (typeof TransformComponent | typeof MotionComponent)[];
27
27
  static _ID: number;
28
28
  readonly id: Id<'body'>;
29
- events: EventDispatcher<this>;
29
+ events: EventDispatcher<any>;
30
30
  constructor(options?: BodyComponentOptions);
31
31
  /**
32
32
  * Collision type for the rigidbody physics simulation, by default [[CollisionType.PreventCollision]]
@@ -195,7 +195,7 @@ export declare class BodyComponent extends Component<'ex.body'> implements Clona
195
195
  */
196
196
  applyLinearImpulse(impulse: Vector): void;
197
197
  /**
198
- * Apply only angular impuse to the body
198
+ * Apply only angular impulse to the body
199
199
  * @param point
200
200
  * @param impulse
201
201
  */
@@ -204,5 +204,9 @@ export declare class BodyComponent extends Component<'ex.body'> implements Clona
204
204
  * Sets the old versions of pos, vel, acc, and scale.
205
205
  */
206
206
  captureOldTransform(): void;
207
+ /**
208
+ * @deprecated signature will change in v0.26.0
209
+ * @param _ctx
210
+ */
207
211
  debugDraw(_ctx: CanvasRenderingContext2D): void;
208
212
  }
@@ -99,6 +99,12 @@ export declare class BoundingBox {
99
99
  * @param bb The other actor to test
100
100
  */
101
101
  intersectWithSide(bb: BoundingBox): Side;
102
+ /**
103
+ *
104
+ * @deprecated signature will change in v0.26.0
105
+ * @param ctx
106
+ * @param color
107
+ */
102
108
  debugDraw(ctx: CanvasRenderingContext2D, color?: Color): void;
103
109
  /**
104
110
  * Draw a debug bounding box