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
@@ -12,7 +12,7 @@ import { PolygonCollider } from './Colliders/PolygonCollider';
12
12
  import { EdgeCollider } from './Colliders/EdgeCollider';
13
13
  export declare class ColliderComponent extends Component<'ex.collider'> {
14
14
  readonly type = "ex.collider";
15
- events: EventDispatcher<this>;
15
+ events: EventDispatcher<any>;
16
16
  /**
17
17
  * Observable that notifies when a collider is added to the body
18
18
  */
@@ -25,7 +25,6 @@ export declare class ColliderComponent extends Component<'ex.collider'> {
25
25
  private _collider;
26
26
  /**
27
27
  * Get the current collider geometry
28
- * @returns
29
28
  */
30
29
  get(): Collider;
31
30
  /**
@@ -53,7 +52,6 @@ export declare class ColliderComponent extends Component<'ex.collider'> {
53
52
  /**
54
53
  * Collide component with another
55
54
  * @param other
56
- * @returns
57
55
  */
58
56
  collide(other: ColliderComponent): CollisionContact[];
59
57
  onAdd(entity: Entity): void;
@@ -92,7 +90,6 @@ export declare class ColliderComponent extends Component<'ex.collider'> {
92
90
  /**
93
91
  * Setups up a [[CompositeCollider]] which can define any arbitrary set of excalibur colliders
94
92
  * @param colliders
95
- * @returns
96
93
  */
97
94
  useCompositeCollider(colliders: Collider[]): CompositeCollider;
98
95
  }
@@ -27,10 +27,15 @@ export declare class CircleCollider extends Collider {
27
27
  */
28
28
  offset: Vector;
29
29
  get worldPos(): Vector;
30
+ private _naturalRadius;
30
31
  /**
31
- * This is the radius of the circle
32
+ * Get the radius of the circle
32
33
  */
33
- radius: number;
34
+ get radius(): number;
35
+ /**
36
+ * Set the radius of the circle
37
+ */
38
+ set radius(val: number);
34
39
  private _transform;
35
40
  constructor(options: CircleColliderOptions);
36
41
  /**
@@ -86,7 +91,18 @@ export declare class CircleCollider extends Collider {
86
91
  * Project the circle along a specified axis
87
92
  */
88
93
  project(axis: Vector): Projection;
94
+ /**
95
+ * @deprecated signature will change in v0.26.0
96
+ * @param ctx
97
+ * @param color
98
+ * @param pos
99
+ */
89
100
  draw(ctx: CanvasRenderingContext2D, color?: Color, pos?: Vector): void;
90
101
  debug(ex: ExcaliburGraphicsContext, color: Color): void;
102
+ /**
103
+ * @deprecated signature will change in v0.26.0
104
+ * @param ctx
105
+ * @param color
106
+ */
91
107
  debugDraw(ctx: CanvasRenderingContext2D, color?: Color): void;
92
108
  }
@@ -18,7 +18,7 @@ export interface EdgeColliderOptions {
18
18
  */
19
19
  end: Vector;
20
20
  /**
21
- * Optionall specify an offset
21
+ * Optionally specify an offset
22
22
  */
23
23
  offset?: Vector;
24
24
  }
@@ -16,11 +16,11 @@ export interface SeparationInfo {
16
16
  */
17
17
  separation: number;
18
18
  /**
19
- * Axis of separation from the collider's perpective
19
+ * Axis of separation from the collider's perspective
20
20
  */
21
21
  axis: Vector;
22
22
  /**
23
- * Side of separation (reference) from the collider's perpsective
23
+ * Side of separation (reference) from the collider's perspective
24
24
  */
25
25
  side?: Line;
26
26
  /**
@@ -5,12 +5,12 @@ import { Collider } from '../Colliders/Collider';
5
5
  import { CollisionContact } from '../Detection/CollisionContact';
6
6
  import { ExcaliburGraphicsContext } from '../..';
7
7
  /**
8
- * Responsible for performing the collision broadphase (locating potential colllisions) and
8
+ * Responsible for performing the collision broadphase (locating potential collisions) and
9
9
  * the narrowphase (actual collision contacts)
10
10
  */
11
11
  export declare class DynamicTreeCollisionProcessor implements CollisionProcessor {
12
12
  private _dynamicCollisionTree;
13
- private _collisions;
13
+ private _pairs;
14
14
  private _collisionPairCache;
15
15
  private _colliders;
16
16
  getColliders(): readonly Collider[];
@@ -22,9 +22,9 @@ export declare class DynamicTreeCollisionProcessor implements CollisionProcessor
22
22
  * Untracks a physics body
23
23
  */
24
24
  untrack(target: Collider): void;
25
- private _shouldGenerateCollisionPair;
25
+ private _pairExists;
26
26
  /**
27
- * Detects potential collision pairs in a broadphase approach with the dynamic aabb tree strategy
27
+ * Detects potential collision pairs in a broadphase approach with the dynamic AABB tree strategy
28
28
  */
29
29
  broadphase(targets: Collider[], delta: number, stats?: FrameStats): Pair[];
30
30
  /**
@@ -9,6 +9,11 @@ export declare class Pair {
9
9
  colliderB: Collider;
10
10
  id: string;
11
11
  constructor(colliderA: Collider, colliderB: Collider);
12
+ /**
13
+ * Returns whether a it is allowed for 2 colliders in a Pair to collide
14
+ * @param colliderA
15
+ * @param colliderB
16
+ */
12
17
  static canCollide(colliderA: Collider, colliderB: Collider): boolean;
13
18
  /**
14
19
  * Returns whether or not it is possible for the pairs to collide
@@ -21,7 +26,6 @@ export declare class Pair {
21
26
  /**
22
27
  * Check if the collider is part of the pair
23
28
  * @param collider
24
- * @returns
25
29
  */
26
30
  hasCollider(collider: Collider): boolean;
27
31
  /**
@@ -85,7 +85,6 @@ export declare class CollisionGroup {
85
85
  * Combine collision groups with each other. The new group includes all of the previous groups.
86
86
  *
87
87
  * @param collisionGroups
88
- * @returns
89
88
  */
90
89
  static combine(collisionGroups: CollisionGroup[]): CollisionGroup;
91
90
  /**
@@ -7,5 +7,9 @@ export declare class MotionSystem extends System<TransformComponent | MotionComp
7
7
  systemType: SystemType;
8
8
  priority: number;
9
9
  update(_entities: Entity[], elapsedMs: number): void;
10
+ /**
11
+ * @deprecated signature will change in v0.26.0
12
+ * @param _ctx
13
+ */
10
14
  debugDraw(_ctx: CanvasRenderingContext2D): void;
11
15
  }
@@ -13,7 +13,7 @@ export declare class ContactConstraintPoint {
13
13
  */
14
14
  update(): this;
15
15
  /**
16
- * Returns the relative velocity betwen bodyA and bodyB
16
+ * Returns the relative velocity between bodyA and bodyB
17
17
  */
18
18
  getRelativeVelocity(): Vector;
19
19
  /**
@@ -31,7 +31,7 @@ export declare abstract class CollisionSolver {
31
31
  */
32
32
  abstract solveVelocity(contacts: CollisionContact[]): void;
33
33
  /**
34
- * Solve position adjust the position of collders so that they are not overlapping
34
+ * Solve position adjust the position of colliders so that they are not overlapping
35
35
  * @param contacts
36
36
  * @inheritdoc
37
37
  */
@@ -2,6 +2,7 @@ import { DebugFlags, ColorBlindFlags } from './DebugFlags';
2
2
  import { Engine } from '../Engine';
3
3
  import { Color } from '../Color';
4
4
  import { CollisionContact } from '../Collision/Detection/CollisionContact';
5
+ import { StandardClock, TestClock } from '..';
5
6
  /**
6
7
  * Debug stats containing current and previous frame statistics
7
8
  */
@@ -129,12 +130,27 @@ export interface GraphicsStatistics {
129
130
  export declare class Debug implements DebugFlags {
130
131
  private _engine;
131
132
  constructor(engine: Engine);
133
+ /**
134
+ * Switch the current excalibur clock with the [[TestClock]] and return
135
+ * it in the same running state.
136
+ *
137
+ * This is useful when you need to debug frame by frame.
138
+ */
139
+ useTestClock(): TestClock;
140
+ /**
141
+ * Switch the current excalibur clock with the [[StandardClock]] and
142
+ * return it in the same running state.
143
+ *
144
+ * This is useful when you need to switch back to normal mode after
145
+ * debugging.
146
+ */
147
+ useStandardClock(): StandardClock;
132
148
  /**
133
149
  * Performance statistics
134
150
  */
135
151
  stats: DebugStats;
136
152
  /**
137
- * Correct or simulate color blindness using [[ColorBlindness]] post processor.
153
+ * Correct or simulate color blindness using [[ColorBlindnessPostProcessor]].
138
154
  * @warning Will reduce FPS.
139
155
  */
140
156
  colorBlindMode: ColorBlindFlags;
@@ -160,6 +176,7 @@ export declare class Debug implements DebugFlags {
160
176
  transform: {
161
177
  showAll: boolean;
162
178
  showPosition: boolean;
179
+ showPositionLabel: boolean;
163
180
  positionColor: Color;
164
181
  showScale: boolean;
165
182
  scaleColor: Color;
@@ -1,11 +1,24 @@
1
+ import { ColorBlindnessMode } from '../Graphics/PostProcessor/ColorBlindnessMode';
1
2
  import { Engine } from '../Engine';
2
- import { ColorBlindness } from '../PostProcessing/Index';
3
3
  export interface DebugFlags {
4
4
  colorBlindMode: ColorBlindFlags;
5
5
  }
6
6
  export declare class ColorBlindFlags {
7
7
  private _engine;
8
+ private _colorBlindPostProcessor;
8
9
  constructor(engine: Engine);
9
- correct(colorBlindness: ColorBlindness): void;
10
- simulate(colorBlindness: ColorBlindness): void;
10
+ /**
11
+ * Correct colors for a specified color blindness
12
+ * @param colorBlindness
13
+ */
14
+ correct(colorBlindness: ColorBlindnessMode): void;
15
+ /**
16
+ * Simulate colors for a specified color blindness
17
+ * @param colorBlindness
18
+ */
19
+ simulate(colorBlindness: ColorBlindnessMode): void;
20
+ /**
21
+ * Remove color blindness post processor
22
+ */
23
+ clear(): void;
11
24
  }
@@ -11,13 +11,13 @@ import { Loader } from './Loader';
11
11
  import { VisibleEvent, HiddenEvent, GameStartEvent, GameStopEvent, PreUpdateEvent, PostUpdateEvent, PreFrameEvent, PostFrameEvent, GameEvent, PreDrawEvent, PostDrawEvent } from './Events';
12
12
  import { Color } from './Color';
13
13
  import { Scene } from './Scene';
14
- import { PostProcessor } from './PostProcessing/PostProcessor';
15
14
  import { Debug, DebugStats } from './Debug/Debug';
16
15
  import { Class } from './Class';
17
16
  import * as Input from './Input/Index';
18
17
  import * as Events from './Events';
19
18
  import { BrowserEvents } from './Util/Browser';
20
19
  import { ExcaliburGraphicsContext } from './Graphics';
20
+ import { Clock } from './Util/Clock';
21
21
  /**
22
22
  * Enum representing the different mousewheel event bubble prevention
23
23
  */
@@ -59,6 +59,12 @@ export interface EngineOptions {
59
59
  resolution?: ScreenDimension;
60
60
  /**
61
61
  * Optionally specify antialiasing (smoothing), by default true (smooth pixels)
62
+ *
63
+ * * `true` - useful for high resolution art work you would like smoothed, this also hints excalibur to load images
64
+ * with [[ImageFiltering.Blended]]
65
+ *
66
+ * * `false` - useful for pixel art style art work you would like sharp, this also hints excalibur to load images
67
+ * with [[ImageFiltering.Pixel]]
62
68
  */
63
69
  antialiasing?: boolean;
64
70
  /**
@@ -124,6 +130,13 @@ export interface EngineOptions {
124
130
  * Optionally set the background color
125
131
  */
126
132
  backgroundColor?: Color;
133
+ /**
134
+ * Optionally set the maximum fps if not set Excalibur will go as fast as the device allows.
135
+ *
136
+ * You may want to constrain max fps if your game cannot maintain fps consistently, it can look and feel better to have a 30fps game than
137
+ * one that bounces between 30fps and 60fps
138
+ */
139
+ maxFps?: number;
127
140
  }
128
141
  /**
129
142
  * The Excalibur Engine
@@ -134,7 +147,7 @@ export interface EngineOptions {
134
147
  */
135
148
  export declare class Engine extends Class implements CanInitialize, CanUpdate, CanDraw {
136
149
  /**
137
- *
150
+ * Excalibur browser events abstraction used for wiring to native browser events safely
138
151
  */
139
152
  browser: BrowserEvents;
140
153
  /**
@@ -147,13 +160,28 @@ export declare class Engine extends Class implements CanInitialize, CanUpdate, C
147
160
  canvas: HTMLCanvasElement;
148
161
  /**
149
162
  * Direct access to the engine's 2D rendering context
163
+ * @deprecated Will be removed in v0.26.0, use Engine.graphicsContext
150
164
  */
151
165
  ctx: CanvasRenderingContext2D;
166
+ /**
167
+ * Direct access to the ExcaliburGraphicsContext used for drawing things to the screen
168
+ */
152
169
  graphicsContext: ExcaliburGraphicsContext;
153
170
  /**
154
171
  * Direct access to the canvas element ID, if an ID exists
155
172
  */
156
173
  canvasElementId: string;
174
+ /**
175
+ * Optionally set the maximum fps if not set Excalibur will go as fast as the device allows.
176
+ *
177
+ * You may want to constrain max fps if your game cannot maintain fps consistently, it can look and feel better to have a 30fps game than
178
+ * one that bounces between 30fps and 60fps
179
+ */
180
+ maxFps: number;
181
+ /**
182
+ * Direct access to the excalibur clock
183
+ */
184
+ clock: Clock;
157
185
  /**
158
186
  * The width of the game canvas in pixels (physical width component of the
159
187
  * resolution of the canvas element)
@@ -199,16 +227,17 @@ export declare class Engine extends Class implements CanInitialize, CanUpdate, C
199
227
  private _hasStarted;
200
228
  /**
201
229
  * Access Excalibur debugging functionality.
230
+ *
231
+ * Useful when you want to debug different aspects of built in engine features like
232
+ * * Transform
233
+ * * Graphics
234
+ * * Colliders
202
235
  */
203
236
  debug: Debug;
204
237
  /**
205
238
  * Access [[stats]] that holds frame statistics.
206
239
  */
207
240
  get stats(): DebugStats;
208
- /**
209
- * Gets or sets the list of post processors to apply at the end of drawing a frame (such as [[ColorBlindCorrector]])
210
- */
211
- postProcessors: PostProcessor[];
212
241
  /**
213
242
  * The current [[Scene]] being drawn and updated on screen
214
243
  */
@@ -225,7 +254,7 @@ export declare class Engine extends Class implements CanInitialize, CanUpdate, C
225
254
  };
226
255
  /**
227
256
  * @hidden
228
- * @deprecated
257
+ * @deprecated will be removed in v0.26.0
229
258
  */
230
259
  private _animations;
231
260
  /**
@@ -243,6 +272,7 @@ export declare class Engine extends Class implements CanInitialize, CanUpdate, C
243
272
  get pixelRatio(): number;
244
273
  /**
245
274
  * Indicates the current position of the engine. Valid only when DisplayMode is DisplayMode.Position
275
+ * @deprecated will be removed in v0.26.0
246
276
  */
247
277
  position: string | AbsolutePosition;
248
278
  /**
@@ -254,6 +284,10 @@ export declare class Engine extends Class implements CanInitialize, CanUpdate, C
254
284
  */
255
285
  private _isDebug;
256
286
  get isDebug(): boolean;
287
+ /**
288
+ * No longer used
289
+ * @deprecated will be removed in v0.26.0
290
+ */
257
291
  debugColor: Color;
258
292
  /**
259
293
  * Sets the background color for the engine.
@@ -263,6 +297,11 @@ export declare class Engine extends Class implements CanInitialize, CanUpdate, C
263
297
  * Sets the Transparency for the engine.
264
298
  */
265
299
  enableCanvasTransparency: boolean;
300
+ /**
301
+ * Hints the graphics context to truncate fractional world space coordinates
302
+ */
303
+ get snapToPixel(): boolean;
304
+ set snapToPixel(shouldSnapToPixel: boolean);
266
305
  /**
267
306
  * The action to take when a fatal exception is thrown
268
307
  */
@@ -276,7 +315,6 @@ export declare class Engine extends Class implements CanInitialize, CanUpdate, C
276
315
  private _compatible;
277
316
  private _timescale;
278
317
  private _loader;
279
- private _isLoading;
280
318
  private _isInitialized;
281
319
  private _deferredGoTo;
282
320
  on(eventName: Events.initialize, handler: (event: Events.InitializeEvent<Engine>) => void): void;
@@ -555,13 +593,28 @@ export declare class Engine extends Class implements CanInitialize, CanUpdate, C
555
593
  * Returns true when loading is totally complete and the player has clicked start
556
594
  */
557
595
  get loadingComplete(): boolean;
596
+ private _isReady;
597
+ get ready(): boolean;
598
+ private _isReadyResolve;
599
+ private _isReadyPromise;
600
+ isReady(): Promise<void>;
558
601
  /**
559
602
  * Starts the internal game loop for Excalibur after loading
560
603
  * any provided assets.
561
604
  * @param loader Optional [[Loader]] to use to load resources. The default loader is [[Loader]], override to provide your own
562
605
  * custom loader.
606
+ *
607
+ * Note: start() only resolves AFTER the user has clicked the play button
563
608
  */
564
609
  start(loader?: Loader): Promise<void>;
610
+ private _mainloop;
611
+ /**
612
+ *
613
+ * @param game
614
+ * @param raf
615
+ * @param nowFn
616
+ * @deprecated Use [[Clock]] to run the mainloop, will be removed in v0.26.0
617
+ */
565
618
  static createMainLoop(game: Engine, raf: (func: Function) => number, nowFn: () => number): () => void;
566
619
  /**
567
620
  * Stops Excalibur's main loop, useful for pausing the game.
@@ -569,8 +622,13 @@ export declare class Engine extends Class implements CanInitialize, CanUpdate, C
569
622
  stop(): void;
570
623
  /**
571
624
  * Returns the Engine's Running status, Useful for checking whether engine is running or paused.
625
+ * @deprecated will be removed in v0.26.0, use isRunning()
572
626
  */
573
627
  isPaused(): boolean;
628
+ /**
629
+ * Returns the Engine's running status, Useful for checking whether engine is running or paused.
630
+ */
631
+ isRunning(): boolean;
574
632
  /**
575
633
  * Takes a screen shot of the current viewport and returns it as an
576
634
  * HTML Image Element.
@@ -9,9 +9,9 @@ export declare type ComponentType<ComponentToParse> = ComponentToParse extends C
9
9
  */
10
10
  export declare type ComponentStringType<T> = T extends Component<infer R> ? R : string;
11
11
  /**
12
- * Components are containers for state in Excalibur, the are meant to convey capabilities that an Entity posesses
12
+ * Components are containers for state in Excalibur, the are meant to convey capabilities that an Entity possesses
13
13
  *
14
- * Implementations of Component must have a zero-arg constructor to support dependecies
14
+ * Implementations of Component must have a zero-arg constructor to support dependencies
15
15
  *
16
16
  * ```typescript
17
17
  * class MyComponent extends ex.Component<'my'> {
@@ -47,7 +47,7 @@ export declare abstract class Component<TypeName extends string = string> {
47
47
  */
48
48
  onAdd?(owner: Entity): void;
49
49
  /**
50
- * Opitonal callback called when acomponent is added to an entity
50
+ * Optional callback called when a component is added to an entity
51
51
  */
52
52
  onRemove?(previousOwner: Entity): void;
53
53
  }
@@ -22,7 +22,7 @@ export interface Motion {
22
22
  */
23
23
  torque: number;
24
24
  /**
25
- * Inerita can be thought of as the resistance to motion
25
+ * Inertia can be thought of as the resistance to motion
26
26
  */
27
27
  inertia: number;
28
28
  }
@@ -49,7 +49,7 @@ export declare class MotionComponent extends Component<'ex.motion'> {
49
49
  */
50
50
  torque: number;
51
51
  /**
52
- * Inerita can be thought of as the resistance to motion
52
+ * Inertia can be thought of as the resistance to motion
53
53
  */
54
54
  inertia: number;
55
55
  }
@@ -152,7 +152,7 @@ export declare class Entity extends Class implements OnInitialize, OnPreUpdate,
152
152
  /**
153
153
  * Adds a copy of all the components from another template entity as a "prefab"
154
154
  * @param templateEntity Entity to use as a template
155
- * @param force Force component replacement if it aleady exists on the target entity
155
+ * @param force Force component replacement if it already exists on the target entity
156
156
  */
157
157
  addTemplate(templateEntity: Entity, force?: boolean): Entity;
158
158
  /**
@@ -197,20 +197,20 @@ export declare class Entity extends Class implements OnInitialize, OnPreUpdate,
197
197
  /**
198
198
  * Initializes this entity, meant to be called by the Scene before first update not by users of Excalibur.
199
199
  *
200
- * It is not recommended that internal excalibur methods be overriden, do so at your own risk.
200
+ * It is not recommended that internal excalibur methods be overridden, do so at your own risk.
201
201
  *
202
202
  * @internal
203
203
  */
204
204
  _initialize(engine: Engine): void;
205
205
  /**
206
- * It is not recommended that internal excalibur methods be overriden, do so at your own risk.
206
+ * It is not recommended that internal excalibur methods be overridden, do so at your own risk.
207
207
  *
208
208
  * Internal _preupdate handler for [[onPreUpdate]] lifecycle event
209
209
  * @internal
210
210
  */
211
211
  _preupdate(engine: Engine, delta: number): void;
212
212
  /**
213
- * It is not recommended that internal excalibur methods be overriden, do so at your own risk.
213
+ * It is not recommended that internal excalibur methods be overridden, do so at your own risk.
214
214
  *
215
215
  * Internal _preupdate handler for [[onPostUpdate]] lifecycle event
216
216
  * @internal
@@ -42,7 +42,7 @@ export declare abstract class System<ComponentTypeUnion extends Component = Comp
42
42
  /**
43
43
  * System can execute in priority order, by default all systems are priority 0. Lower values indicated higher priority.
44
44
  * For a system to execute before all other a lower priority value (-1 for example) must be set.
45
- * For a system to exectue after all other a higher priority value (10 for example) must be set.
45
+ * For a system to execute after all other a higher priority value (10 for example) must be set.
46
46
  */
47
47
  priority: number;
48
48
  /**
@@ -21,7 +21,6 @@ export declare class SystemManager<ContextType> {
21
21
  /**
22
22
  * Get a system registered in the manager by type
23
23
  * @param systemType
24
- * @returns
25
24
  */
26
25
  get<T extends System>(systemType: SystemCtor<T>): T | null;
27
26
  /**
@@ -34,6 +33,12 @@ export declare class SystemManager<ContextType> {
34
33
  * @param system
35
34
  */
36
35
  removeSystem(system: System<any, ContextType>): void;
36
+ /**
37
+ * Initialize all systems in the manager
38
+ *
39
+ * Systems added after initialize() will be initialized on add
40
+ */
41
+ initialize(): void;
37
42
  /**
38
43
  * Updates all systems
39
44
  * @param type whether this is an update or draw system
@@ -3,11 +3,6 @@ import { Eventable } from './Interfaces/Evented';
3
3
  export declare class EventDispatcher<T = any> implements Eventable {
4
4
  private _handlers;
5
5
  private _wiredEventDispatchers;
6
- private _target;
7
- /**
8
- * @param target The object that will be the recipient of events from this event dispatcher
9
- */
10
- constructor(target: T);
11
6
  /**
12
7
  * Clears any existing handlers or wired event dispatchers on this event dispatcher
13
8
  */
@@ -0,0 +1,6 @@
1
+ export declare abstract class ExEvent<TName extends string> {
2
+ abstract readonly type: TName;
3
+ private _active;
4
+ get active(): boolean;
5
+ cancel(): void;
6
+ }
@@ -0,0 +1,37 @@
1
+ import { GlobalCoordinates } from '..';
2
+ import { WheelDeltaMode } from '../Input/WheelDeltaMode';
3
+ import { ExEvent } from './ExEvent';
4
+ export declare abstract class PointerEvent extends ExEvent<'down' | 'up' | 'move' | 'cancel'> {
5
+ pointerId: number;
6
+ coordinates: GlobalCoordinates;
7
+ nativeEvent: Event;
8
+ constructor(pointerId: number, coordinates: GlobalCoordinates, nativeEvent: Event);
9
+ }
10
+ export declare class PointerUp extends PointerEvent {
11
+ readonly type = "up";
12
+ }
13
+ export declare class PointerDown extends PointerEvent {
14
+ readonly type = "down";
15
+ }
16
+ export declare class PointerMove extends PointerEvent {
17
+ readonly type = "move";
18
+ }
19
+ export declare class PointerCancel extends PointerEvent {
20
+ readonly type = "cancel";
21
+ }
22
+ export declare class Wheel extends ExEvent<'wheel'> {
23
+ x: number;
24
+ y: number;
25
+ pageX: number;
26
+ pageY: number;
27
+ screenX: number;
28
+ screenY: number;
29
+ index: number;
30
+ deltaX: number;
31
+ deltaY: number;
32
+ deltaZ: number;
33
+ deltaMode: WheelDeltaMode;
34
+ ev: Event;
35
+ readonly type = "wheel";
36
+ constructor(x: number, y: number, pageX: number, pageY: number, screenX: number, screenY: number, index: number, deltaX: number, deltaY: number, deltaZ: number, deltaMode: WheelDeltaMode, ev: Event);
37
+ }
@@ -48,7 +48,7 @@ export interface Frame {
48
48
  */
49
49
  graphic?: Graphic;
50
50
  /**
51
- * Optionally specify the number of ms the frame should be visible, overrids the animation duration (default 100 ms)
51
+ * Optionally specify the number of ms the frame should be visible, overrides the animation duration (default 100 ms)
52
52
  */
53
53
  duration?: number;
54
54
  }
@@ -103,6 +103,8 @@ export declare class Animation extends Graphic implements HasTick {
103
103
  private _playing;
104
104
  constructor(options: GraphicOptions & AnimationOptions);
105
105
  clone(): Animation;
106
+ get width(): number;
107
+ get height(): number;
106
108
  /**
107
109
  * Create an Animation from a [[SpriteSheet]], a list of indices into the sprite sheet, a duration per frame
108
110
  * and optional [[AnimationStrategy]]
@@ -184,6 +186,5 @@ export declare class Animation extends Graphic implements HasTick {
184
186
  * @param idempotencyToken Prevents double ticking in a frame by passing a unique token to the frame
185
187
  */
186
188
  tick(elapsedMilliseconds: number, idempotencyToken?: number): void;
187
- private _updateDimensions;
188
189
  protected _drawImage(ctx: ExcaliburGraphicsContext, x: number, y: number): void;
189
190
  }
@@ -4,6 +4,8 @@ export interface CircleOptions {
4
4
  }
5
5
  /**
6
6
  * A circle [[Graphic]] for drawing circles to the [[ExcaliburGraphicsContext]]
7
+ *
8
+ * Circles default to [[ImageFiltering.Blended]]
7
9
  */
8
10
  export declare class Circle extends Raster {
9
11
  private _radius;