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/Engine.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,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,
|
|
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
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Vector } from '../../Math/vector';
|
|
2
|
+
import { Matrix } from '../../Math/matrix';
|
|
2
3
|
import { Color } from '../../Color';
|
|
4
|
+
import { ScreenDimension } from '../../Screen';
|
|
5
|
+
import { PostProcessor } from '../PostProcessor/PostProcessor';
|
|
3
6
|
export declare type HTMLImageSource = HTMLImageElement | HTMLCanvasElement;
|
|
4
7
|
export interface ExcaliburGraphicsContextOptions {
|
|
5
8
|
canvasElement: HTMLCanvasElement;
|
|
@@ -55,7 +58,7 @@ export interface ExcaliburGraphicsContext {
|
|
|
55
58
|
width: number;
|
|
56
59
|
height: number;
|
|
57
60
|
/**
|
|
58
|
-
* Snaps all drawings to the nearest pixel
|
|
61
|
+
* Snaps all drawings to the nearest pixel truncated down, by default false
|
|
59
62
|
*/
|
|
60
63
|
snapToPixel: boolean;
|
|
61
64
|
/**
|
|
@@ -74,10 +77,19 @@ export interface ExcaliburGraphicsContext {
|
|
|
74
77
|
* Resets the current transform to the identity matrix
|
|
75
78
|
*/
|
|
76
79
|
resetTransform(): void;
|
|
80
|
+
/**
|
|
81
|
+
* Gets the current transform
|
|
82
|
+
*/
|
|
83
|
+
getTransform(): Matrix;
|
|
84
|
+
/**
|
|
85
|
+
* Multiplies the current transform by a matrix
|
|
86
|
+
* @param m
|
|
87
|
+
*/
|
|
88
|
+
multiply(m: Matrix): void;
|
|
77
89
|
/**
|
|
78
90
|
* Update the context with the current viewport dimensions (used in resizing)
|
|
79
91
|
*/
|
|
80
|
-
updateViewport(): void;
|
|
92
|
+
updateViewport(resolution: ScreenDimension): void;
|
|
81
93
|
/**
|
|
82
94
|
* Access the debug drawing api
|
|
83
95
|
*/
|
|
@@ -112,14 +124,16 @@ export interface ExcaliburGraphicsContext {
|
|
|
112
124
|
* @param height
|
|
113
125
|
* @param color
|
|
114
126
|
*/
|
|
115
|
-
drawRectangle(pos: Vector, width: number, height: number, color: Color): void;
|
|
127
|
+
drawRectangle(pos: Vector, width: number, height: number, color: Color, stroke?: Color, strokeThickness?: number): void;
|
|
116
128
|
/**
|
|
117
|
-
* Draw a
|
|
129
|
+
* Draw a circle to the Excalibur Graphics context
|
|
118
130
|
* @param pos
|
|
119
131
|
* @param radius
|
|
120
132
|
* @param color
|
|
133
|
+
* @param stroke Optionally specify the stroke color
|
|
134
|
+
* @param thickness
|
|
121
135
|
*/
|
|
122
|
-
drawCircle(pos: Vector, radius: number, color: Color): void;
|
|
136
|
+
drawCircle(pos: Vector, radius: number, color: Color, stroke?: Color, thickness?: number): void;
|
|
123
137
|
/**
|
|
124
138
|
* Save the current state of the canvas to the stack (transforms and opacity)
|
|
125
139
|
*/
|
|
@@ -144,6 +158,22 @@ export interface ExcaliburGraphicsContext {
|
|
|
144
158
|
* @param y
|
|
145
159
|
*/
|
|
146
160
|
scale(x: number, y: number): void;
|
|
161
|
+
/**
|
|
162
|
+
* Add a post processor to the graphics context
|
|
163
|
+
*
|
|
164
|
+
* Post processors are run in the order they were added.
|
|
165
|
+
* @param postprocessor
|
|
166
|
+
*/
|
|
167
|
+
addPostProcessor(postprocessor: PostProcessor): void;
|
|
168
|
+
/**
|
|
169
|
+
* Remove a specific post processor from the graphics context
|
|
170
|
+
* @param postprocessor
|
|
171
|
+
*/
|
|
172
|
+
removePostProcessor(postprocessor: PostProcessor): void;
|
|
173
|
+
/**
|
|
174
|
+
* Remove all post processors from the graphics context
|
|
175
|
+
*/
|
|
176
|
+
clearPostProcessors(): void;
|
|
147
177
|
/**
|
|
148
178
|
* Clears the screen with the current background color
|
|
149
179
|
*/
|
|
@@ -152,4 +182,6 @@ export interface ExcaliburGraphicsContext {
|
|
|
152
182
|
* Flushes the batched draw calls to the screen
|
|
153
183
|
*/
|
|
154
184
|
flush(): void;
|
|
185
|
+
beginDrawLifecycle(): void;
|
|
186
|
+
endDrawLifecycle(): void;
|
|
155
187
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ExcaliburGraphicsContext, LineGraphicsOptions, PointGraphicsOptions, ExcaliburGraphicsContextOptions, DebugDraw, HTMLImageSource } from './ExcaliburGraphicsContext';
|
|
2
2
|
import { Vector } from '../../Math/vector';
|
|
3
3
|
import { Color } from '../../Color';
|
|
4
|
+
import { Matrix } from '../../Math/matrix';
|
|
5
|
+
import { ScreenDimension } from '../../Screen';
|
|
6
|
+
import { PostProcessor } from '../PostProcessor/PostProcessor';
|
|
4
7
|
declare class ExcaliburGraphicsContext2DCanvasDebug implements DebugDraw {
|
|
5
8
|
private _ex;
|
|
6
9
|
private _debugText;
|
|
@@ -34,7 +37,7 @@ export declare class ExcaliburGraphicsContext2DCanvas implements ExcaliburGraphi
|
|
|
34
37
|
set smoothing(value: boolean);
|
|
35
38
|
constructor(options: ExcaliburGraphicsContextOptions);
|
|
36
39
|
resetTransform(): void;
|
|
37
|
-
updateViewport(): void;
|
|
40
|
+
updateViewport(_resolution: ScreenDimension): void;
|
|
38
41
|
/**
|
|
39
42
|
* Draw an image to the Excalibur Graphics context at an x and y coordinate using the images width and height
|
|
40
43
|
*/
|
|
@@ -52,7 +55,7 @@ export declare class ExcaliburGraphicsContext2DCanvas implements ExcaliburGraphi
|
|
|
52
55
|
drawImage(image: HTMLImageSource, sx: number, sy: number, swidth?: number, sheight?: number, dx?: number, dy?: number, dwidth?: number, dheight?: number): void;
|
|
53
56
|
drawLine(start: Vector, end: Vector, color: Color, thickness?: number): void;
|
|
54
57
|
drawRectangle(pos: Vector, width: number, height: number, color: Color): void;
|
|
55
|
-
drawCircle(pos: Vector, radius: number, color: Color): void;
|
|
58
|
+
drawCircle(pos: Vector, radius: number, color: Color, stroke?: Color, thickness?: number): void;
|
|
56
59
|
debug: ExcaliburGraphicsContext2DCanvasDebug;
|
|
57
60
|
/**
|
|
58
61
|
* Save the current state of the canvas to the stack (transforms and opacity)
|
|
@@ -78,6 +81,13 @@ export declare class ExcaliburGraphicsContext2DCanvas implements ExcaliburGraphi
|
|
|
78
81
|
* @param y
|
|
79
82
|
*/
|
|
80
83
|
scale(x: number, y: number): void;
|
|
84
|
+
getTransform(): Matrix;
|
|
85
|
+
multiply(_m: Matrix): void;
|
|
86
|
+
addPostProcessor(_postprocessor: PostProcessor): void;
|
|
87
|
+
removePostProcessor(_postprocessor: PostProcessor): void;
|
|
88
|
+
clearPostProcessors(): void;
|
|
89
|
+
beginDrawLifecycle(): void;
|
|
90
|
+
endDrawLifecycle(): void;
|
|
81
91
|
clear(): void;
|
|
82
92
|
/**
|
|
83
93
|
* Flushes the batched draw calls to the screen
|
|
@@ -4,10 +4,10 @@ import { TransformStack } from './transform-stack';
|
|
|
4
4
|
import { Vector } from '../../Math/vector';
|
|
5
5
|
import { Color } from '../../Color';
|
|
6
6
|
import { StateStack } from './state-stack';
|
|
7
|
-
import { LineRenderer } from './line-renderer';
|
|
8
|
-
import { ImageRenderer } from './image-renderer';
|
|
9
|
-
import { PointRenderer } from './point-renderer';
|
|
10
7
|
import { ScreenDimension } from '../../Screen';
|
|
8
|
+
import { PostProcessor } from '../PostProcessor/PostProcessor';
|
|
9
|
+
import { RendererPlugin } from './renderer';
|
|
10
|
+
import { LineRenderer } from './line-renderer/line-renderer';
|
|
11
11
|
declare class ExcaliburGraphicsContextWebGLDebug implements DebugDraw {
|
|
12
12
|
private _webglCtx;
|
|
13
13
|
private _debugText;
|
|
@@ -38,9 +38,17 @@ declare class ExcaliburGraphicsContextWebGLDebug implements DebugDraw {
|
|
|
38
38
|
export interface WebGLGraphicsContextInfo {
|
|
39
39
|
transform: TransformStack;
|
|
40
40
|
state: StateStack;
|
|
41
|
-
|
|
41
|
+
ortho: Matrix;
|
|
42
|
+
context: ExcaliburGraphicsContextWebGL;
|
|
42
43
|
}
|
|
43
44
|
export declare class ExcaliburGraphicsContextWebGL implements ExcaliburGraphicsContext {
|
|
45
|
+
private _logger;
|
|
46
|
+
private _renderers;
|
|
47
|
+
private _isDrawLifecycle;
|
|
48
|
+
private _renderTarget;
|
|
49
|
+
private _postProcessTargets;
|
|
50
|
+
private _screenRenderer;
|
|
51
|
+
private _postprocessors;
|
|
44
52
|
/**
|
|
45
53
|
* Meant for internal use only. Access the internal context at your own risk and no guarantees this will exist in the future.
|
|
46
54
|
* @internal
|
|
@@ -58,11 +66,6 @@ export declare class ExcaliburGraphicsContextWebGL implements ExcaliburGraphicsC
|
|
|
58
66
|
private _transform;
|
|
59
67
|
private _state;
|
|
60
68
|
private _ortho;
|
|
61
|
-
/**
|
|
62
|
-
* Meant for internal use only. Access the internal context at your own risk and no guarantees this will exist in the future.
|
|
63
|
-
* @internal
|
|
64
|
-
*/
|
|
65
|
-
__pointRenderer: PointRenderer;
|
|
66
69
|
/**
|
|
67
70
|
* Meant for internal use only. Access the internal context at your own risk and no guarantees this will exist in the future.
|
|
68
71
|
* @internal
|
|
@@ -72,7 +75,6 @@ export declare class ExcaliburGraphicsContextWebGL implements ExcaliburGraphicsC
|
|
|
72
75
|
* Meant for internal use only. Access the internal context at your own risk and no guarantees this will exist in the future.
|
|
73
76
|
* @internal
|
|
74
77
|
*/
|
|
75
|
-
__imageRenderer: ImageRenderer;
|
|
76
78
|
snapToPixel: boolean;
|
|
77
79
|
smoothing: boolean;
|
|
78
80
|
backgroundColor: Color;
|
|
@@ -80,6 +82,7 @@ export declare class ExcaliburGraphicsContextWebGL implements ExcaliburGraphicsC
|
|
|
80
82
|
set opacity(value: number);
|
|
81
83
|
get width(): number;
|
|
82
84
|
get height(): number;
|
|
85
|
+
get ortho(): Matrix;
|
|
83
86
|
/**
|
|
84
87
|
* Checks the underlying webgl implementation if the requested internal resolution is supported
|
|
85
88
|
* @param dim
|
|
@@ -87,14 +90,22 @@ export declare class ExcaliburGraphicsContextWebGL implements ExcaliburGraphicsC
|
|
|
87
90
|
checkIfResolutionSupported(dim: ScreenDimension): boolean;
|
|
88
91
|
constructor(options: ExcaliburGraphicsContextOptions);
|
|
89
92
|
private _init;
|
|
93
|
+
register<T extends RendererPlugin>(renderer: T): void;
|
|
94
|
+
get(rendererName: string): RendererPlugin;
|
|
95
|
+
private _currentRenderer;
|
|
96
|
+
private _isCurrentRenderer;
|
|
97
|
+
beginDrawLifecycle(): void;
|
|
98
|
+
endDrawLifecycle(): void;
|
|
99
|
+
private _alreadyWarnedDrawLifecycle;
|
|
100
|
+
draw<TRenderer extends RendererPlugin>(rendererName: TRenderer['type'], ...args: Parameters<TRenderer['draw']>): void;
|
|
90
101
|
resetTransform(): void;
|
|
91
|
-
updateViewport(): void;
|
|
102
|
+
updateViewport(resolution: ScreenDimension): void;
|
|
92
103
|
drawImage(image: HTMLImageSource, x: number, y: number): void;
|
|
93
104
|
drawImage(image: HTMLImageSource, x: number, y: number, width: number, height: number): void;
|
|
94
105
|
drawImage(image: HTMLImageSource, sx: number, sy: number, swidth?: number, sheight?: number, dx?: number, dy?: number, dwidth?: number, dheight?: number): void;
|
|
95
106
|
drawLine(start: Vector, end: Vector, color: Color, thickness?: number): void;
|
|
96
|
-
drawRectangle(pos: Vector, width: number, height: number, color: Color): void;
|
|
97
|
-
drawCircle(pos: Vector, radius: number, color: Color): void;
|
|
107
|
+
drawRectangle(pos: Vector, width: number, height: number, color: Color, stroke?: Color, strokeThickness?: number): void;
|
|
108
|
+
drawCircle(pos: Vector, radius: number, color: Color, stroke?: Color, thickness?: number): void;
|
|
98
109
|
debug: ExcaliburGraphicsContextWebGLDebug;
|
|
99
110
|
save(): void;
|
|
100
111
|
restore(): void;
|
|
@@ -102,6 +113,11 @@ export declare class ExcaliburGraphicsContextWebGL implements ExcaliburGraphicsC
|
|
|
102
113
|
rotate(angle: number): void;
|
|
103
114
|
scale(x: number, y: number): void;
|
|
104
115
|
transform(matrix: Matrix): void;
|
|
116
|
+
getTransform(): Matrix;
|
|
117
|
+
multiply(m: Matrix): void;
|
|
118
|
+
addPostProcessor(postprocessor: PostProcessor): void;
|
|
119
|
+
removePostProcessor(postprocessor: PostProcessor): void;
|
|
120
|
+
clearPostProcessors(): void;
|
|
105
121
|
clear(): void;
|
|
106
122
|
/**
|
|
107
123
|
* Flushes all batched rendering to the screen
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Color } from '../../../Color';
|
|
2
|
+
import { Vector } from '../../../Math/vector';
|
|
3
|
+
import { ExcaliburGraphicsContextWebGL } from '../ExcaliburGraphicsContextWebGL';
|
|
4
|
+
import { RendererPlugin } from '../renderer';
|
|
5
|
+
export declare class CircleRenderer implements RendererPlugin {
|
|
6
|
+
readonly type = "ex.circle";
|
|
7
|
+
priority: number;
|
|
8
|
+
private _maxCircles;
|
|
9
|
+
private _shader;
|
|
10
|
+
private _context;
|
|
11
|
+
private _gl;
|
|
12
|
+
private _buffer;
|
|
13
|
+
private _layout;
|
|
14
|
+
private _quads;
|
|
15
|
+
private _circleCount;
|
|
16
|
+
private _vertexIndex;
|
|
17
|
+
initialize(gl: WebGLRenderingContext, context: ExcaliburGraphicsContextWebGL): void;
|
|
18
|
+
private _isFull;
|
|
19
|
+
draw(pos: Vector, radius: number, color: Color, stroke?: Color, strokeThickness?: number): void;
|
|
20
|
+
hasPendingDraws(): boolean;
|
|
21
|
+
flush(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { HTMLImageSource } from '../ExcaliburGraphicsContext';
|
|
2
|
+
import { ExcaliburGraphicsContextWebGL } from '../ExcaliburGraphicsContextWebGL';
|
|
3
|
+
import { RendererPlugin } from '../renderer';
|
|
4
|
+
export declare class ImageRenderer implements RendererPlugin {
|
|
5
|
+
readonly type = "ex.image";
|
|
6
|
+
priority: number;
|
|
7
|
+
private _maxImages;
|
|
8
|
+
private _maxTextures;
|
|
9
|
+
private _context;
|
|
10
|
+
private _gl;
|
|
11
|
+
private _shader;
|
|
12
|
+
private _buffer;
|
|
13
|
+
private _layout;
|
|
14
|
+
private _quads;
|
|
15
|
+
private _imageCount;
|
|
16
|
+
private _textures;
|
|
17
|
+
private _vertexIndex;
|
|
18
|
+
initialize(gl: WebGLRenderingContext, context: ExcaliburGraphicsContextWebGL): void;
|
|
19
|
+
private _transformFragmentSource;
|
|
20
|
+
private _addImageAsTexture;
|
|
21
|
+
private _bindTextures;
|
|
22
|
+
private _getTextureIdForImage;
|
|
23
|
+
private _isFull;
|
|
24
|
+
draw(image: HTMLImageSource, sx: number, sy: number, swidth?: number, sheight?: number, dx?: number, dy?: number, dwidth?: number, dheight?: number): void;
|
|
25
|
+
hasPendingDraws(): boolean;
|
|
26
|
+
flush(): void;
|
|
27
|
+
}
|