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.
- package/.nvmrc +1 -1
- package/CHANGELOG.md +119 -27
- package/README.md +0 -1
- package/build/dist/Actions/ActionsComponent.d.ts +1 -1
- package/build/dist/Actor.d.ts +46 -45
- package/build/dist/Camera.d.ts +10 -2
- package/build/dist/Class.d.ts +4 -5
- package/build/dist/Collision/BodyComponent.d.ts +6 -2
- package/build/dist/Collision/BoundingBox.d.ts +6 -0
- package/build/dist/Collision/ColliderComponent.d.ts +1 -4
- package/build/dist/Collision/Colliders/CircleCollider.d.ts +18 -2
- package/build/dist/Collision/Colliders/EdgeCollider.d.ts +1 -1
- package/build/dist/Collision/Colliders/SeparatingAxis.d.ts +2 -2
- package/build/dist/Collision/Detection/DynamicTreeCollisionProcessor.d.ts +4 -4
- package/build/dist/Collision/Detection/Pair.d.ts +5 -1
- package/build/dist/Collision/Group/CollisionGroup.d.ts +0 -1
- package/build/dist/Collision/MotionSystem.d.ts +4 -0
- package/build/dist/Collision/Solver/ContactConstraintPoint.d.ts +1 -1
- package/build/dist/Collision/Solver/Solver.d.ts +1 -1
- package/build/dist/Debug/Debug.d.ts +18 -1
- package/build/dist/Debug/DebugFlags.d.ts +16 -3
- package/build/dist/Engine.d.ts +66 -8
- package/build/dist/EntityComponentSystem/Component.d.ts +3 -3
- package/build/dist/EntityComponentSystem/Components/MotionComponent.d.ts +2 -2
- package/build/dist/EntityComponentSystem/Entity.d.ts +4 -4
- package/build/dist/EntityComponentSystem/System.d.ts +1 -1
- package/build/dist/EntityComponentSystem/SystemManager.d.ts +6 -1
- package/build/dist/EventDispatcher.d.ts +0 -5
- package/build/dist/Events/ExEvent.d.ts +6 -0
- package/build/dist/Events/PointerEvents.d.ts +37 -0
- package/build/dist/Graphics/Animation.d.ts +3 -2
- package/build/dist/Graphics/Circle.d.ts +2 -0
- package/build/dist/Graphics/Context/ExcaliburGraphicsContext.d.ts +37 -5
- package/build/dist/Graphics/Context/ExcaliburGraphicsContext2DCanvas.d.ts +12 -2
- package/build/dist/Graphics/Context/ExcaliburGraphicsContextWebGL.d.ts +29 -13
- package/build/dist/Graphics/Context/circle-renderer/circle-renderer.d.ts +22 -0
- package/build/dist/Graphics/Context/circle-renderer/circle-renderer.frag.glsl +53 -0
- package/build/dist/Graphics/Context/circle-renderer/circle-renderer.vert.glsl +37 -0
- package/build/dist/Graphics/Context/image-renderer/image-renderer.d.ts +27 -0
- package/build/dist/Graphics/Context/image-renderer/image-renderer.frag.glsl +28 -0
- package/build/dist/Graphics/Context/{shaders/image-vertex.glsl → image-renderer/image-renderer.vert.glsl} +2 -7
- package/build/dist/Graphics/Context/{shaders → line-renderer}/line-fragment.glsl +0 -0
- package/build/dist/Graphics/Context/line-renderer/line-renderer.d.ts +21 -0
- package/build/dist/Graphics/Context/{shaders → line-renderer}/line-vertex.glsl +2 -2
- package/build/dist/Graphics/Context/{shaders → point-renderer}/point-fragment.glsl +6 -2
- package/build/dist/Graphics/Context/point-renderer/point-renderer.d.ts +21 -0
- package/build/dist/Graphics/Context/{shaders → point-renderer}/point-vertex.glsl +2 -2
- package/build/dist/Graphics/Context/quad-index-buffer.d.ts +36 -0
- package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.d.ts +23 -0
- package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.frag.glsl +85 -0
- package/build/dist/Graphics/Context/rectangle-renderer/rectangle-renderer.vert.glsl +42 -0
- package/build/dist/Graphics/Context/render-source.d.ts +7 -0
- package/build/dist/Graphics/Context/render-target.d.ts +26 -0
- package/build/dist/Graphics/Context/renderer.d.ts +20 -51
- package/build/dist/Graphics/Context/screen-pass-painter/screen-fragment.glsl +11 -0
- package/build/dist/Graphics/Context/screen-pass-painter/screen-pass-painter.d.ts +13 -0
- package/build/dist/Graphics/Context/screen-pass-painter/screen-vertex.glsl +11 -0
- package/build/dist/Graphics/Context/shader.d.ts +116 -42
- package/build/dist/Graphics/Context/shaders/crt-effect.glsl +64 -0
- package/build/dist/Graphics/Context/shaders/grayscale-fragment.glsl +13 -0
- package/build/dist/Graphics/Context/shaders/invert-fragment.glsl +12 -0
- package/build/dist/Graphics/Context/texture-loader.d.ts +8 -2
- package/build/dist/Graphics/Context/vertex-buffer.d.ts +49 -0
- package/build/dist/Graphics/Context/vertex-layout.d.ts +52 -0
- package/build/dist/Graphics/Context/webgl-adapter.d.ts +9 -0
- package/build/dist/Graphics/Context/webgl-util.d.ts +22 -0
- package/build/dist/Graphics/DebugGraphicsComponent.d.ts +13 -0
- package/build/dist/Graphics/Filtering.d.ts +15 -0
- package/build/dist/Graphics/Font.d.ts +61 -23
- package/build/dist/Graphics/FontCommon.d.ts +43 -2
- package/build/dist/Graphics/Graphic.d.ts +23 -9
- package/build/dist/Graphics/GraphicsSystem.d.ts +0 -1
- package/build/dist/Graphics/ImageSource.d.ts +8 -3
- package/build/dist/Graphics/Polygon.d.ts +2 -0
- package/build/dist/Graphics/PostProcessor/ColorBlindnessMode.d.ts +5 -0
- package/build/dist/Graphics/PostProcessor/ColorBlindnessPostProcessor.d.ts +17 -0
- package/build/dist/Graphics/PostProcessor/PostProcessor.d.ts +7 -0
- package/build/dist/Graphics/PostProcessor/ScreenShader.d.ts +16 -0
- package/build/dist/Graphics/PostProcessor/color-blind-fragment.glsl +62 -0
- package/build/dist/Graphics/Raster.d.ts +32 -5
- package/build/dist/Graphics/Sprite.d.ts +5 -0
- package/build/dist/Graphics/SpriteFont.d.ts +6 -7
- package/build/dist/Graphics/SpriteSheet.d.ts +1 -2
- package/build/dist/Graphics/Text.d.ts +18 -2
- package/build/dist/Graphics/index.d.ts +14 -0
- package/build/dist/Id.d.ts +1 -1
- package/build/dist/Input/EngineInput.d.ts +2 -2
- package/build/dist/Input/Index.d.ts +10 -3
- package/build/dist/Input/NativePointerButton.d.ts +10 -0
- package/build/dist/Input/PointerAbstraction.d.ts +33 -0
- package/build/dist/Input/PointerButton.d.ts +10 -0
- package/build/dist/Input/PointerComponent.d.ts +24 -0
- package/build/dist/Input/PointerEvent.d.ts +18 -0
- package/build/dist/Input/PointerEventReceiver.d.ts +114 -0
- package/build/dist/Input/PointerScope.d.ts +14 -0
- package/build/dist/Input/PointerSystem.d.ts +43 -0
- package/build/dist/Input/PointerType.d.ts +9 -0
- package/build/dist/Input/WheelDeltaMode.d.ts +5 -0
- package/build/dist/Input/WheelEvent.d.ts +18 -0
- package/build/dist/Interfaces/PointerEventHandlers.d.ts +17 -16
- package/build/dist/Label.d.ts +9 -2
- package/build/dist/Loader.d.ts +5 -2
- package/build/dist/Math/Index.d.ts +1 -0
- package/build/dist/Math/matrix.d.ts +19 -1
- package/build/dist/Math/util.d.ts +45 -0
- package/build/dist/Particles.d.ts +12 -0
- package/build/dist/Resources/Gif.d.ts +1 -1
- package/build/dist/Scene.d.ts +10 -1
- package/build/dist/Screen.d.ts +4 -3
- package/build/dist/TileMap.d.ts +3 -2
- package/build/dist/Traits/Index.d.ts +0 -1
- package/build/dist/Trigger.d.ts +4 -0
- package/build/dist/Util/Clock.d.ts +118 -0
- package/build/dist/Util/Fps.d.ts +40 -0
- package/build/dist/Util/Observable.d.ts +1 -1
- package/build/dist/Util/Pool.d.ts +2 -10
- package/build/dist/Util/Util.d.ts +23 -66
- package/build/dist/excalibur.js +9124 -7580
- package/build/dist/excalibur.js.map +1 -1
- package/build/dist/excalibur.min.js +1 -1
- package/build/dist/excalibur.min.js.LICENSE.txt +2 -2
- package/build/dist/excalibur.min.js.map +1 -1
- package/build/dist/index.d.ts +5 -2
- package/build/esm/Actions/ActionsComponent.d.ts +1 -1
- package/build/esm/Actor.d.ts +46 -45
- package/build/esm/Camera.d.ts +10 -2
- package/build/esm/Class.d.ts +4 -5
- package/build/esm/Collision/BodyComponent.d.ts +6 -2
- package/build/esm/Collision/BoundingBox.d.ts +6 -0
- package/build/esm/Collision/ColliderComponent.d.ts +1 -4
- package/build/esm/Collision/Colliders/CircleCollider.d.ts +18 -2
- package/build/esm/Collision/Colliders/EdgeCollider.d.ts +1 -1
- package/build/esm/Collision/Colliders/SeparatingAxis.d.ts +2 -2
- package/build/esm/Collision/Detection/DynamicTreeCollisionProcessor.d.ts +4 -4
- package/build/esm/Collision/Detection/Pair.d.ts +5 -1
- package/build/esm/Collision/Group/CollisionGroup.d.ts +0 -1
- package/build/esm/Collision/MotionSystem.d.ts +4 -0
- package/build/esm/Collision/Solver/ContactConstraintPoint.d.ts +1 -1
- package/build/esm/Collision/Solver/Solver.d.ts +1 -1
- package/build/esm/Debug/Debug.d.ts +18 -1
- package/build/esm/Debug/DebugFlags.d.ts +16 -3
- package/build/esm/Engine.d.ts +66 -8
- package/build/esm/EntityComponentSystem/Component.d.ts +3 -3
- package/build/esm/EntityComponentSystem/Components/MotionComponent.d.ts +2 -2
- package/build/esm/EntityComponentSystem/Entity.d.ts +4 -4
- package/build/esm/EntityComponentSystem/System.d.ts +1 -1
- package/build/esm/EntityComponentSystem/SystemManager.d.ts +6 -1
- package/build/esm/EventDispatcher.d.ts +0 -5
- package/build/esm/Events/ExEvent.d.ts +6 -0
- package/build/esm/Events/PointerEvents.d.ts +37 -0
- package/build/esm/Graphics/Animation.d.ts +3 -2
- package/build/esm/Graphics/Circle.d.ts +2 -0
- package/build/esm/Graphics/Context/ExcaliburGraphicsContext.d.ts +37 -5
- package/build/esm/Graphics/Context/ExcaliburGraphicsContext2DCanvas.d.ts +12 -2
- package/build/esm/Graphics/Context/ExcaliburGraphicsContextWebGL.d.ts +29 -13
- package/build/esm/Graphics/Context/circle-renderer/circle-renderer.d.ts +22 -0
- package/build/esm/Graphics/Context/image-renderer/image-renderer.d.ts +27 -0
- package/build/esm/Graphics/Context/line-renderer/line-renderer.d.ts +21 -0
- package/build/esm/Graphics/Context/point-renderer/point-renderer.d.ts +21 -0
- package/build/esm/Graphics/Context/quad-index-buffer.d.ts +36 -0
- package/build/esm/Graphics/Context/rectangle-renderer/rectangle-renderer.d.ts +23 -0
- package/build/esm/Graphics/Context/render-source.d.ts +7 -0
- package/build/esm/Graphics/Context/render-target.d.ts +26 -0
- package/build/esm/Graphics/Context/renderer.d.ts +20 -51
- package/build/esm/Graphics/Context/screen-pass-painter/screen-pass-painter.d.ts +13 -0
- package/build/esm/Graphics/Context/shader.d.ts +116 -42
- package/build/esm/Graphics/Context/texture-loader.d.ts +8 -2
- package/build/esm/Graphics/Context/vertex-buffer.d.ts +49 -0
- package/build/esm/Graphics/Context/vertex-layout.d.ts +52 -0
- package/build/esm/Graphics/Context/webgl-adapter.d.ts +9 -0
- package/build/esm/Graphics/Context/webgl-util.d.ts +22 -0
- package/build/esm/Graphics/DebugGraphicsComponent.d.ts +13 -0
- package/build/esm/Graphics/Filtering.d.ts +15 -0
- package/build/esm/Graphics/Font.d.ts +61 -23
- package/build/esm/Graphics/FontCommon.d.ts +43 -2
- package/build/esm/Graphics/Graphic.d.ts +23 -9
- package/build/esm/Graphics/GraphicsSystem.d.ts +0 -1
- package/build/esm/Graphics/ImageSource.d.ts +8 -3
- package/build/esm/Graphics/Polygon.d.ts +2 -0
- package/build/esm/Graphics/PostProcessor/ColorBlindnessMode.d.ts +5 -0
- package/build/esm/Graphics/PostProcessor/ColorBlindnessPostProcessor.d.ts +17 -0
- package/build/esm/Graphics/PostProcessor/PostProcessor.d.ts +7 -0
- package/build/esm/Graphics/PostProcessor/ScreenShader.d.ts +16 -0
- package/build/esm/Graphics/Raster.d.ts +32 -5
- package/build/esm/Graphics/Sprite.d.ts +5 -0
- package/build/esm/Graphics/SpriteFont.d.ts +6 -7
- package/build/esm/Graphics/SpriteSheet.d.ts +1 -2
- package/build/esm/Graphics/Text.d.ts +18 -2
- package/build/esm/Graphics/index.d.ts +14 -0
- package/build/esm/Id.d.ts +1 -1
- package/build/esm/Input/EngineInput.d.ts +2 -2
- package/build/esm/Input/Index.d.ts +10 -3
- package/build/esm/Input/NativePointerButton.d.ts +10 -0
- package/build/esm/Input/PointerAbstraction.d.ts +33 -0
- package/build/esm/Input/PointerButton.d.ts +10 -0
- package/build/esm/Input/PointerComponent.d.ts +24 -0
- package/build/esm/Input/PointerEvent.d.ts +18 -0
- package/build/esm/Input/PointerEventReceiver.d.ts +114 -0
- package/build/esm/Input/PointerScope.d.ts +14 -0
- package/build/esm/Input/PointerSystem.d.ts +43 -0
- package/build/esm/Input/PointerType.d.ts +9 -0
- package/build/esm/Input/WheelDeltaMode.d.ts +5 -0
- package/build/esm/Input/WheelEvent.d.ts +18 -0
- package/build/esm/Interfaces/PointerEventHandlers.d.ts +17 -16
- package/build/esm/Label.d.ts +9 -2
- package/build/esm/Loader.d.ts +5 -2
- package/build/esm/Math/Index.d.ts +1 -0
- package/build/esm/Math/matrix.d.ts +19 -1
- package/build/esm/Math/util.d.ts +45 -0
- package/build/esm/Particles.d.ts +12 -0
- package/build/esm/Resources/Gif.d.ts +1 -1
- package/build/esm/Scene.d.ts +10 -1
- package/build/esm/Screen.d.ts +4 -3
- package/build/esm/TileMap.d.ts +3 -2
- package/build/esm/Traits/Index.d.ts +0 -1
- package/build/esm/Trigger.d.ts +4 -0
- package/build/esm/Util/Clock.d.ts +118 -0
- package/build/esm/Util/Fps.d.ts +40 -0
- package/build/esm/Util/Observable.d.ts +1 -1
- package/build/esm/Util/Pool.d.ts +2 -10
- package/build/esm/Util/Util.d.ts +23 -66
- package/build/esm/excalibur.js +9001 -7438
- package/build/esm/excalibur.js.map +1 -1
- package/build/esm/excalibur.min.js +1 -1
- package/build/esm/excalibur.min.js.LICENSE.txt +2 -2
- package/build/esm/excalibur.min.js.map +1 -1
- package/build/esm/index.d.ts +5 -2
- package/package.json +31 -27
- package/build/dist/Graphics/Context/batch.d.ts +0 -11
- package/build/dist/Graphics/Context/draw-image-command.d.ts +0 -47
- package/build/dist/Graphics/Context/image-renderer.d.ts +0 -39
- package/build/dist/Graphics/Context/line-renderer.d.ts +0 -22
- package/build/dist/Graphics/Context/point-renderer.d.ts +0 -22
- package/build/dist/Graphics/Context/shaders/image-fragment.glsl +0 -48
- package/build/dist/Input/Pointer.d.ts +0 -134
- package/build/dist/Input/PointerEvents.d.ts +0 -170
- package/build/dist/Input/Pointers.d.ts +0 -78
- package/build/dist/PostProcessing/ColorBlindCorrector.d.ts +0 -28
- package/build/dist/PostProcessing/Index.d.ts +0 -2
- package/build/dist/PostProcessing/PostProcessor.d.ts +0 -6
- package/build/dist/Traits/CapturePointer.d.ts +0 -10
- package/build/esm/Graphics/Context/batch.d.ts +0 -11
- package/build/esm/Graphics/Context/draw-image-command.d.ts +0 -47
- package/build/esm/Graphics/Context/image-renderer.d.ts +0 -39
- package/build/esm/Graphics/Context/line-renderer.d.ts +0 -22
- package/build/esm/Graphics/Context/point-renderer.d.ts +0 -22
- package/build/esm/Input/Pointer.d.ts +0 -134
- package/build/esm/Input/PointerEvents.d.ts +0 -170
- package/build/esm/Input/Pointers.d.ts +0 -78
- package/build/esm/PostProcessing/ColorBlindCorrector.d.ts +0 -28
- package/build/esm/PostProcessing/Index.d.ts +0 -2
- package/build/esm/PostProcessing/PostProcessor.d.ts +0 -6
- package/build/esm/Traits/CapturePointer.d.ts +0 -10
- package/wallaby.js +0 -77
package/build/esm/Trigger.d.ts
CHANGED
|
@@ -44,5 +44,9 @@ export declare class Trigger extends Actor {
|
|
|
44
44
|
get target(): Entity;
|
|
45
45
|
_initialize(engine: Engine): void;
|
|
46
46
|
private _dispatchAction;
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated signature will change in v0.26.0
|
|
49
|
+
* @param ctx
|
|
50
|
+
*/
|
|
47
51
|
debugDraw(ctx: CanvasRenderingContext2D): void;
|
|
48
52
|
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { FpsSampler } from './Fps';
|
|
2
|
+
export interface ClockOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Define the function you'd like the clock to tick when it is started
|
|
5
|
+
*/
|
|
6
|
+
tick: (elapsedMs: number) => any;
|
|
7
|
+
/**
|
|
8
|
+
* Optionally define the fatal exception handler, used if an error is thrown in tick
|
|
9
|
+
*/
|
|
10
|
+
onFatalException?: (e: unknown) => any;
|
|
11
|
+
/**
|
|
12
|
+
* Optionally limit the maximum FPS of the clock
|
|
13
|
+
*/
|
|
14
|
+
maxFps?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Abstract Clock is the base type of all Clocks
|
|
18
|
+
*
|
|
19
|
+
* It has a few opinions
|
|
20
|
+
* 1. It manages the calculation of what "elapsed" time means and thus maximum fps
|
|
21
|
+
* 2. The default timing api is implemented in now()
|
|
22
|
+
*
|
|
23
|
+
* To implement your own clock, extend Clock and override start/stop to start and stop the clock, then call update() with whatever
|
|
24
|
+
* method is unique to your clock implementation.
|
|
25
|
+
*/
|
|
26
|
+
export declare abstract class Clock {
|
|
27
|
+
protected tick: (elapsedMs: number) => any;
|
|
28
|
+
private _onFatalException;
|
|
29
|
+
private _maxFps;
|
|
30
|
+
private _lastTime;
|
|
31
|
+
fpsSampler: FpsSampler;
|
|
32
|
+
private _options;
|
|
33
|
+
private _elapsed;
|
|
34
|
+
private _scheduledCbs;
|
|
35
|
+
private _totalElapsed;
|
|
36
|
+
constructor(options: ClockOptions);
|
|
37
|
+
/**
|
|
38
|
+
* Get the elapsed time for the last completed frame
|
|
39
|
+
*/
|
|
40
|
+
elapsed(): number;
|
|
41
|
+
/**
|
|
42
|
+
* Get the current time in milliseconds
|
|
43
|
+
*/
|
|
44
|
+
now(): number;
|
|
45
|
+
toTestClock(): TestClock;
|
|
46
|
+
toStandardClock(): StandardClock;
|
|
47
|
+
setFatalExceptionHandler(handler: (e: unknown) => any): void;
|
|
48
|
+
/**
|
|
49
|
+
* Schedule a callback to fire given a timeout in milliseconds using the excalibur [[Clock]]
|
|
50
|
+
*
|
|
51
|
+
* This is useful to use over the built in browser `setTimeout` because callbacks will be tied to the
|
|
52
|
+
* excalibur update clock, instead of browser time, this means that callbacks wont fire if the game is
|
|
53
|
+
* stopped or paused.
|
|
54
|
+
*
|
|
55
|
+
* @param cb callback to fire
|
|
56
|
+
* @param timeoutMs Optionally specify a timeout in milliseconds from now, default is 0ms which means the next possible tick
|
|
57
|
+
*/
|
|
58
|
+
schedule(cb: () => any, timeoutMs?: number): void;
|
|
59
|
+
private _runScheduledCbs;
|
|
60
|
+
protected update(overrideUpdateMs?: number): void;
|
|
61
|
+
/**
|
|
62
|
+
* Returns if the clock is currently running
|
|
63
|
+
*/
|
|
64
|
+
abstract isRunning(): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Start the clock, it will then periodically call the tick(elapsedMilliseconds) since the last tick
|
|
67
|
+
*/
|
|
68
|
+
abstract start(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Stop the clock, tick() is no longer called
|
|
71
|
+
*/
|
|
72
|
+
abstract stop(): void;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The [[StandardClock]] implements the requestAnimationFrame browser api to run the tick()
|
|
76
|
+
*/
|
|
77
|
+
export declare class StandardClock extends Clock {
|
|
78
|
+
private _running;
|
|
79
|
+
private _requestId;
|
|
80
|
+
constructor(options: ClockOptions);
|
|
81
|
+
isRunning(): boolean;
|
|
82
|
+
start(): void;
|
|
83
|
+
stop(): void;
|
|
84
|
+
}
|
|
85
|
+
export interface TestClockOptions {
|
|
86
|
+
/**
|
|
87
|
+
* Specify the update milliseconds to use for each manual step()
|
|
88
|
+
*/
|
|
89
|
+
defaultUpdateMs: number;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The TestClock is meant for debugging interactions in excalibur that require precise timing to replicate or test
|
|
93
|
+
*/
|
|
94
|
+
export declare class TestClock extends Clock {
|
|
95
|
+
private _logger;
|
|
96
|
+
private _updateMs;
|
|
97
|
+
private _running;
|
|
98
|
+
private _currentTime;
|
|
99
|
+
constructor(options: ClockOptions & TestClockOptions);
|
|
100
|
+
/**
|
|
101
|
+
* Get the current time in milliseconds
|
|
102
|
+
*/
|
|
103
|
+
now(): number;
|
|
104
|
+
isRunning(): boolean;
|
|
105
|
+
start(): void;
|
|
106
|
+
stop(): void;
|
|
107
|
+
/**
|
|
108
|
+
* Manually step the clock forward 1 tick, optionally specify an elapsed time in milliseconds
|
|
109
|
+
* @param overrideUpdateMs
|
|
110
|
+
*/
|
|
111
|
+
step(overrideUpdateMs?: number): void;
|
|
112
|
+
/**
|
|
113
|
+
* Run a number of steps that tick the clock, optionally specify an elapsed time in milliseconds
|
|
114
|
+
* @param numberOfSteps
|
|
115
|
+
* @param overrideUpdateMs
|
|
116
|
+
*/
|
|
117
|
+
run(numberOfSteps: number, overrideUpdateMs?: number): void;
|
|
118
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface FpsSamplerOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Specify the sampling period in milliseconds (default 100)
|
|
4
|
+
*/
|
|
5
|
+
samplePeriod?: number;
|
|
6
|
+
/**
|
|
7
|
+
* Specify the initial FPS
|
|
8
|
+
*/
|
|
9
|
+
initialFps: number;
|
|
10
|
+
/**
|
|
11
|
+
* Specify the function used to return the current time (in milliseconds)
|
|
12
|
+
*/
|
|
13
|
+
nowFn: () => number;
|
|
14
|
+
}
|
|
15
|
+
export declare class FpsSampler {
|
|
16
|
+
private _fps;
|
|
17
|
+
private _samplePeriod;
|
|
18
|
+
private _currentFrameTime;
|
|
19
|
+
private _frames;
|
|
20
|
+
private _previousSampleTime;
|
|
21
|
+
private _beginFrameTime;
|
|
22
|
+
private _nowFn;
|
|
23
|
+
constructor(options: FpsSamplerOptions);
|
|
24
|
+
/**
|
|
25
|
+
* Start of code block to sample FPS for
|
|
26
|
+
*/
|
|
27
|
+
start(): void;
|
|
28
|
+
/**
|
|
29
|
+
* End of code block to sample FPS for
|
|
30
|
+
*/
|
|
31
|
+
end(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Return the currently sampled fps over the last sample period, by default every 100ms
|
|
34
|
+
*/
|
|
35
|
+
get fps(): number;
|
|
36
|
+
/**
|
|
37
|
+
* Return the instantaneous fps, this can be less useful because it will fluctuate given the current frames time
|
|
38
|
+
*/
|
|
39
|
+
get instant(): number;
|
|
40
|
+
}
|
|
@@ -17,7 +17,7 @@ export interface Observer<T> {
|
|
|
17
17
|
*/
|
|
18
18
|
export declare type MaybeObserver<T> = Partial<Observer<T>>;
|
|
19
19
|
/**
|
|
20
|
-
* Simple Observable
|
|
20
|
+
* Simple Observable implementation
|
|
21
21
|
* @template T is the typescript Type that defines the data being observed
|
|
22
22
|
*/
|
|
23
23
|
export declare class Observable<T> {
|
package/build/esm/Util/Pool.d.ts
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
/**
|
|
3
|
-
* Any type that is a member of a an object pool will have a reference to teh pool
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
_pool?: Pool<this>;
|
|
7
|
-
dispose(): this;
|
|
8
|
-
}
|
|
9
|
-
export declare class Pool<Type extends Poolable> {
|
|
1
|
+
export declare class Pool<Type> {
|
|
10
2
|
builder: (...args: any[]) => Type;
|
|
11
3
|
recycler: (instance: Type, ...args: any[]) => Type;
|
|
12
4
|
maxObjects: number;
|
|
@@ -18,7 +10,7 @@ export declare class Pool<Type extends Poolable> {
|
|
|
18
10
|
/**
|
|
19
11
|
* Use many instances out of the in the context and return all to the pool.
|
|
20
12
|
*
|
|
21
|
-
* By returning values out of the
|
|
13
|
+
* By returning values out of the context they will be un-hooked from the pool and are free to be passed to consumers
|
|
22
14
|
* @param context
|
|
23
15
|
*/
|
|
24
16
|
using(context: (pool: Pool<Type>) => Type[] | void): Type[];
|
package/build/esm/Util/Util.d.ts
CHANGED
|
@@ -1,79 +1,39 @@
|
|
|
1
1
|
import { Vector } from '../Math/vector';
|
|
2
|
-
import { Random } from '../Math/Random';
|
|
3
2
|
import { Side } from '../Collision/Side';
|
|
3
|
+
import { Clock } from './Clock';
|
|
4
|
+
import { clamp as lclamp, randomInRange as lrandomInRange, randomIntInRange as lrandomIntInRange, canonicalizeAngle as lcanonicalizeAngle, toDegrees as ltoDegrees, toRadians as ltoRadians } from '../Math/util';
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
+
* @deprecated ex.Util.TwoPI import site will be removed in v0.26.0, use ex.TwoPI
|
|
6
7
|
*/
|
|
7
8
|
export declare const TwoPI: number;
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @param deep Whether or not to do a deep clone
|
|
12
|
-
* @param target The target object to attach properties on
|
|
13
|
-
* @param objects The objects whose properties to merge
|
|
14
|
-
* @returns Merged object with properties from other objects
|
|
15
|
-
*/
|
|
16
|
-
export declare function extend(deep: boolean, target: any, ...objects: any[]): any;
|
|
17
|
-
/**
|
|
18
|
-
* Merges one or more objects into a single target object
|
|
19
|
-
*
|
|
20
|
-
* @param target The target object to attach properties on
|
|
21
|
-
* @param object2 The second object whose properties to merge
|
|
22
|
-
* @returns Merged object with properties from other objects
|
|
23
|
-
*/
|
|
24
|
-
export declare function extend<T1, T2>(target: T1, object2: T2): T1 & T2;
|
|
25
|
-
/**
|
|
26
|
-
* Merges one or more objects into a single target object
|
|
27
|
-
*
|
|
28
|
-
* @param target The target object to attach properties on
|
|
29
|
-
* @param object2 The second object whose properties to merge
|
|
30
|
-
* @param object3 The third object whose properties to merge
|
|
31
|
-
* @returns Merged object with properties from other objects
|
|
32
|
-
*/
|
|
33
|
-
export declare function extend<T1, T2, T3>(target: T1, object2: T2, object3: T3): T1 & T2 & T3;
|
|
34
|
-
/**
|
|
35
|
-
* Merges one or more objects into a single target object
|
|
36
|
-
*
|
|
37
|
-
* @param target The target object to attach properties on
|
|
38
|
-
* @param objects The objects whose properties to merge
|
|
39
|
-
* @returns Merged object with properties from other objects
|
|
10
|
+
* @deprecated ex.Util.clamp import site will be removed in v0.26.0, use ex.clamp
|
|
40
11
|
*/
|
|
41
|
-
export declare
|
|
12
|
+
export declare const clamp: typeof lclamp;
|
|
42
13
|
/**
|
|
43
|
-
*
|
|
44
|
-
* @deprecated This will be removed in v0.26.0
|
|
14
|
+
* @deprecated ex.Util.randomInRange import site will be removed in v0.26.0, use ex.randomInRange
|
|
45
15
|
*/
|
|
46
|
-
export declare
|
|
16
|
+
export declare const randomInRange: typeof lrandomInRange;
|
|
47
17
|
/**
|
|
48
|
-
*
|
|
49
|
-
* @param nullishVal
|
|
50
|
-
* @param defaultVal
|
|
18
|
+
* @deprecated ex.Util.randomIntInRange import site will be removed in v0.26.0, use ex.randomIntInRange
|
|
51
19
|
*/
|
|
52
|
-
export declare
|
|
20
|
+
export declare const randomIntInRange: typeof lrandomIntInRange;
|
|
53
21
|
/**
|
|
54
|
-
*
|
|
22
|
+
* @deprecated ex.Util.canonicalizeAngle import site will be removed in v0.26.0, use ex.canonicalizeAngle
|
|
55
23
|
*/
|
|
56
|
-
export declare
|
|
24
|
+
export declare const canonicalizeAngle: typeof lcanonicalizeAngle;
|
|
57
25
|
/**
|
|
58
|
-
*
|
|
26
|
+
* @deprecated ex.Util.toDegrees import site will be removed in v0.26.0, use ex.toDegrees
|
|
59
27
|
*/
|
|
60
|
-
export declare
|
|
28
|
+
export declare const toDegrees: typeof ltoDegrees;
|
|
61
29
|
/**
|
|
62
|
-
*
|
|
30
|
+
* @deprecated ex.Util.toRadians import site will be removed in v0.26.0, use ex.toRadians
|
|
63
31
|
*/
|
|
64
|
-
export declare
|
|
32
|
+
export declare const toRadians: typeof ltoRadians;
|
|
65
33
|
/**
|
|
66
|
-
*
|
|
34
|
+
* @deprecated ex.Util.range import site will be removed in v0.26.0, use ex.range
|
|
67
35
|
*/
|
|
68
|
-
export declare
|
|
69
|
-
/**
|
|
70
|
-
* Convert radians to degrees
|
|
71
|
-
*/
|
|
72
|
-
export declare function toDegrees(radians: number): number;
|
|
73
|
-
/**
|
|
74
|
-
* Convert degrees to radians
|
|
75
|
-
*/
|
|
76
|
-
export declare function toRadians(degrees: number): number;
|
|
36
|
+
export declare const range: (from: number, to: number) => number[];
|
|
77
37
|
/**
|
|
78
38
|
* Find the screen position of an HTML element
|
|
79
39
|
*/
|
|
@@ -93,7 +53,7 @@ export declare function removeItemFromArray<T>(item: T, array: T[]): boolean;
|
|
|
93
53
|
*/
|
|
94
54
|
export declare function contains(array: Array<any>, obj: any): boolean;
|
|
95
55
|
/**
|
|
96
|
-
* Get the
|
|
56
|
+
* Get the opposite side
|
|
97
57
|
* TODO: Move to Side type
|
|
98
58
|
* @deprecated Will be removed in v0.26.0
|
|
99
59
|
*/
|
|
@@ -182,15 +142,12 @@ export declare class Collection<T> {
|
|
|
182
142
|
* Used for exhaustive checks at compile time
|
|
183
143
|
*/
|
|
184
144
|
export declare function fail(message: never): never;
|
|
185
|
-
/**
|
|
186
|
-
* Generate a range of numbers
|
|
187
|
-
* For example: range(0, 5) -> [0, 1, 2, 3, 4, 5]
|
|
188
|
-
* @param from inclusive
|
|
189
|
-
* @param to inclusive
|
|
190
|
-
*/
|
|
191
|
-
export declare const range: (from: number, to: number) => number[];
|
|
192
145
|
/**
|
|
193
146
|
* Create a promise that resolves after a certain number of milliseconds
|
|
147
|
+
*
|
|
148
|
+
* It is strongly recommended you pass the excalibur clock so delays are bound to the
|
|
149
|
+
* excalibur clock which would be unaffected by stop/pause.
|
|
194
150
|
* @param milliseconds
|
|
151
|
+
* @param clock
|
|
195
152
|
*/
|
|
196
|
-
export declare function delay(milliseconds: number): Promise<void>;
|
|
153
|
+
export declare function delay(milliseconds: number, clock?: Clock): Promise<void>;
|