melonjs 18.3.0 → 19.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -4
- package/build/application/application.d.ts.map +1 -1
- package/build/application/defaultApplicationSettings.d.ts +0 -1
- package/build/application/defaultApplicationSettings.d.ts.map +1 -1
- package/build/application/header.d.ts.map +1 -1
- package/build/application/settings.d.ts +0 -6
- package/build/application/settings.d.ts.map +1 -1
- package/build/camera/camera2d.d.ts +1 -2
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/geometries/earcut.d.ts.map +1 -1
- package/build/geometries/rectangle.d.ts.map +1 -1
- package/build/index.d.ts +20 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3042 -770
- package/build/index.js.map +4 -4
- package/build/input/gamepad.d.ts.map +1 -1
- package/build/level/level.d.ts +3 -3
- package/build/level/tiled/TMXTile.d.ts.map +1 -1
- package/build/loader/cache.d.ts +2 -0
- package/build/loader/cache.d.ts.map +1 -1
- package/build/loader/loader.d.ts +60 -0
- package/build/loader/loader.d.ts.map +1 -1
- package/build/loader/loadingscreen.d.ts +1 -1
- package/build/loader/parsers/mtl.d.ts +11 -0
- package/build/loader/parsers/mtl.d.ts.map +1 -0
- package/build/loader/parsers/obj.d.ts +11 -0
- package/build/loader/parsers/obj.d.ts.map +1 -0
- package/build/math/color.d.ts.map +1 -1
- package/build/math/math.d.ts +12 -0
- package/build/math/math.d.ts.map +1 -1
- package/build/math/matrix2d.d.ts +2 -2
- package/build/math/matrix2d.d.ts.map +1 -1
- package/build/math/matrix3d.d.ts +19 -4
- package/build/math/matrix3d.d.ts.map +1 -1
- package/build/math/observableVector2d.d.ts +1 -1
- package/build/math/observableVector2d.d.ts.map +1 -1
- package/build/math/observableVector3d.d.ts +1 -1
- package/build/math/observableVector3d.d.ts.map +1 -1
- package/build/math/vertex.d.ts +42 -0
- package/build/math/vertex.d.ts.map +1 -0
- package/build/particles/particle.d.ts.map +1 -1
- package/build/physics/bounds.d.ts +3 -2
- package/build/physics/bounds.d.ts.map +1 -1
- package/build/renderable/container.d.ts +21 -5
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/entity/entity.d.ts +7 -0
- package/build/renderable/entity/entity.d.ts.map +1 -1
- package/build/renderable/mesh.d.ts +147 -0
- package/build/renderable/mesh.d.ts.map +1 -0
- package/build/renderable/renderable.d.ts +56 -30
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +1 -1
- package/build/renderable/text/bitmaptext.d.ts +1 -10
- package/build/renderable/text/bitmaptext.d.ts.map +1 -1
- package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
- package/build/renderable/text/glyph.d.ts +1 -1
- package/build/renderable/text/glyph.d.ts.map +1 -1
- package/build/renderable/text/text.d.ts +2 -12
- package/build/renderable/text/text.d.ts.map +1 -1
- package/build/renderable/trail.d.ts +120 -0
- package/build/renderable/trail.d.ts.map +1 -0
- package/build/renderable/ui/uitextbutton.d.ts +2 -6
- package/build/renderable/ui/uitextbutton.d.ts.map +1 -1
- package/build/state/stage.d.ts +39 -57
- package/build/state/stage.d.ts.map +1 -1
- package/build/state/state.d.ts +14 -28
- package/build/state/state.d.ts.map +1 -1
- package/build/system/event.d.ts +1 -1
- package/build/system/event.d.ts.map +1 -1
- package/build/system/eventEmitter.d.ts.map +1 -1
- package/build/tweens/easing.d.ts +23 -34
- package/build/tweens/easing.d.ts.map +1 -1
- package/build/tweens/interpolation.d.ts +32 -0
- package/build/tweens/interpolation.d.ts.map +1 -1
- package/build/tweens/tween.d.ts +77 -41
- package/build/tweens/tween.d.ts.map +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +7 -4
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/gradient.d.ts +31 -0
- package/build/video/gradient.d.ts.map +1 -1
- package/build/video/renderer.d.ts +17 -6
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/renderstate.d.ts +4 -4
- package/build/video/webgl/batchers/material_batcher.d.ts +65 -0
- package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -0
- package/build/video/webgl/batchers/mesh_batcher.d.ts +20 -0
- package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -0
- package/build/video/webgl/batchers/quad_batcher.d.ts +2 -45
- package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/buffer/index.d.ts +5 -0
- package/build/video/webgl/buffer/index.d.ts.map +1 -1
- package/build/video/webgl/buffer/vertex.d.ts +5 -0
- package/build/video/webgl/buffer/vertex.d.ts.map +1 -1
- package/build/video/webgl/effects/blur.d.ts +36 -0
- package/build/video/webgl/effects/blur.d.ts.map +1 -0
- package/build/video/webgl/effects/chromaticAberration.d.ts +39 -0
- package/build/video/webgl/effects/chromaticAberration.d.ts.map +1 -0
- package/build/video/webgl/effects/desaturate.d.ts +32 -0
- package/build/video/webgl/effects/desaturate.d.ts.map +1 -0
- package/build/video/webgl/effects/dissolve.d.ts +42 -0
- package/build/video/webgl/effects/dissolve.d.ts.map +1 -0
- package/build/video/webgl/effects/dropShadow.d.ts +47 -0
- package/build/video/webgl/effects/dropShadow.d.ts.map +1 -0
- package/build/video/webgl/effects/flash.d.ts +46 -0
- package/build/video/webgl/effects/flash.d.ts.map +1 -0
- package/build/video/webgl/effects/glow.d.ts +48 -0
- package/build/video/webgl/effects/glow.d.ts.map +1 -0
- package/build/video/webgl/effects/hologram.d.ts +37 -0
- package/build/video/webgl/effects/hologram.d.ts.map +1 -0
- package/build/video/webgl/effects/invert.d.ts +29 -0
- package/build/video/webgl/effects/invert.d.ts.map +1 -0
- package/build/video/webgl/effects/outline.d.ts +49 -0
- package/build/video/webgl/effects/outline.d.ts.map +1 -0
- package/build/video/webgl/effects/pixelate.d.ts +38 -0
- package/build/video/webgl/effects/pixelate.d.ts.map +1 -0
- package/build/video/webgl/effects/scanline.d.ts +47 -0
- package/build/video/webgl/effects/scanline.d.ts.map +1 -0
- package/build/video/webgl/effects/sepia.d.ts +28 -0
- package/build/video/webgl/effects/sepia.d.ts.map +1 -0
- package/build/video/webgl/effects/tintPulse.d.ts +43 -0
- package/build/video/webgl/effects/tintPulse.d.ts.map +1 -0
- package/build/video/webgl/effects/wave.d.ts +43 -0
- package/build/video/webgl/effects/wave.d.ts.map +1 -0
- package/build/video/webgl/webgl_renderer.d.ts +8 -9
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/package.json +5 -5
package/build/state/stage.d.ts
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
import type Application from "./../application/application.ts";
|
|
2
|
+
import Camera2d from "./../camera/camera2d.ts";
|
|
3
|
+
import { Color } from "./../math/color.ts";
|
|
4
|
+
import type World from "./../physics/world.js";
|
|
5
|
+
import type Light2d from "./../renderable/light2d.js";
|
|
6
|
+
import type Renderer from "./../video/renderer.js";
|
|
7
|
+
interface StageSettings {
|
|
8
|
+
cameras: Camera2d[];
|
|
9
|
+
onResetEvent?: (app: Application, ...args: unknown[]) => void;
|
|
10
|
+
onDestroyEvent?: (app: Application) => void;
|
|
11
|
+
}
|
|
1
12
|
/**
|
|
2
13
|
* a default "Stage" object.
|
|
3
14
|
* every "stage" object (title screen, credits, ingame, etc...) to be managed
|
|
@@ -6,115 +17,86 @@
|
|
|
6
17
|
* @see state
|
|
7
18
|
*/
|
|
8
19
|
export default class Stage {
|
|
9
|
-
/**
|
|
10
|
-
* @param {object} [settings] - The stage` parameters
|
|
11
|
-
* @param {Camera2d[]} [settings.cameras=[new me.Camera2d()]] - a list of cameras (experimental)
|
|
12
|
-
* @param {Function} [settings.onResetEvent] - called by the state manager when reseting the object
|
|
13
|
-
* @param {Function} [settings.onDestroyEvent] - called by the state manager before switching to another state
|
|
14
|
-
*/
|
|
15
|
-
constructor(settings?: {
|
|
16
|
-
cameras?: Camera2d[] | undefined;
|
|
17
|
-
onResetEvent?: Function | undefined;
|
|
18
|
-
onDestroyEvent?: Function | undefined;
|
|
19
|
-
});
|
|
20
20
|
/**
|
|
21
21
|
* The list of active cameras in this stage.
|
|
22
|
-
* Cameras will be
|
|
22
|
+
* Cameras will be rendered based on this order defined in this list.
|
|
23
23
|
* Only the "default" camera will be resized when the window or canvas is resized.
|
|
24
|
-
* @public
|
|
25
|
-
* @type {Map<Camera2d>}
|
|
26
|
-
* @name cameras
|
|
27
|
-
* @memberof Stage
|
|
28
24
|
*/
|
|
29
|
-
|
|
25
|
+
cameras: Map<string, Camera2d>;
|
|
30
26
|
/**
|
|
31
27
|
* The list of active lights in this stage.
|
|
32
|
-
* (Note: Canvas
|
|
33
|
-
* @public
|
|
34
|
-
* @type {Map<Light2d>}
|
|
35
|
-
* @name lights
|
|
36
|
-
* @memberof Stage
|
|
28
|
+
* (Note: Canvas Rendering mode will only properly support one light per stage)
|
|
37
29
|
* @see Light2d
|
|
38
30
|
* @see Stage.ambientLight
|
|
39
31
|
* @example
|
|
40
32
|
* // create a white spot light
|
|
41
|
-
*
|
|
33
|
+
* const whiteLight = new Light2d(0, 0, 140, "#fff", 0.7);
|
|
42
34
|
* // and add the light to this current stage
|
|
43
35
|
* this.lights.set("whiteLight", whiteLight);
|
|
44
36
|
* // set a dark ambient light
|
|
45
37
|
* this.ambientLight.parseCSS("#1117");
|
|
46
38
|
* // make the light follow the mouse
|
|
47
|
-
*
|
|
39
|
+
* input.registerPointerEvent("pointermove", app.viewport, (event) => {
|
|
48
40
|
* whiteLight.centerOn(event.gameX, event.gameY);
|
|
49
41
|
* });
|
|
50
42
|
*/
|
|
51
|
-
|
|
43
|
+
lights: Map<string, Light2d>;
|
|
52
44
|
/**
|
|
53
45
|
* an ambient light that will be added to the stage rendering
|
|
54
|
-
* @public
|
|
55
|
-
* @type {Color}
|
|
56
|
-
* @name ambientLight
|
|
57
|
-
* @memberof Stage
|
|
58
46
|
* @default "#000000"
|
|
59
47
|
* @see Light2d
|
|
60
48
|
*/
|
|
61
|
-
|
|
49
|
+
ambientLight: Color;
|
|
62
50
|
/**
|
|
63
51
|
* The given constructor options
|
|
64
|
-
* @public
|
|
65
|
-
* @name settings
|
|
66
|
-
* @memberof Stage
|
|
67
|
-
* @type {object}
|
|
68
52
|
*/
|
|
69
|
-
|
|
53
|
+
settings: StageSettings;
|
|
54
|
+
/**
|
|
55
|
+
* @param settings - The stage parameters
|
|
56
|
+
* @param [settings.cameras=[]] - a list of cameras (experimental)
|
|
57
|
+
* @param [settings.onResetEvent] - called by the state manager when reseting the object
|
|
58
|
+
* @param [settings.onDestroyEvent] - called by the state manager before switching to another state
|
|
59
|
+
*/
|
|
60
|
+
constructor(settings?: Partial<StageSettings>);
|
|
70
61
|
/**
|
|
71
62
|
* Object reset function
|
|
72
63
|
* @ignore
|
|
73
64
|
*/
|
|
74
|
-
reset(app:
|
|
65
|
+
reset(app: Application, ...extraArgs: unknown[]): void;
|
|
75
66
|
/**
|
|
76
67
|
* update function
|
|
77
|
-
* @name update
|
|
78
|
-
* @memberof Stage
|
|
79
68
|
* @ignore
|
|
80
|
-
* @param
|
|
81
|
-
* @returns
|
|
69
|
+
* @param dt - time since the last update in milliseconds.
|
|
70
|
+
* @returns true if the stage needs to be redrawn
|
|
82
71
|
*/
|
|
83
72
|
update(dt: number): boolean;
|
|
84
73
|
/**
|
|
85
74
|
* draw the current stage
|
|
86
|
-
* @name draw
|
|
87
|
-
* @memberof Stage
|
|
88
75
|
* @ignore
|
|
89
|
-
* @param
|
|
90
|
-
* @param
|
|
76
|
+
* @param renderer - the renderer object to draw with
|
|
77
|
+
* @param world - the world object to draw
|
|
91
78
|
*/
|
|
92
79
|
draw(renderer: Renderer, world: World): void;
|
|
93
80
|
/**
|
|
94
81
|
* destroy function
|
|
95
82
|
* @ignore
|
|
96
83
|
*/
|
|
97
|
-
destroy(app:
|
|
84
|
+
destroy(app: Application): void;
|
|
98
85
|
/**
|
|
99
86
|
* onResetEvent function<br>
|
|
100
|
-
* called by the state manager when
|
|
87
|
+
* called by the state manager when resetting the object
|
|
101
88
|
* this is typically where you will load a level, add renderables, etc...
|
|
102
|
-
* @
|
|
103
|
-
* @
|
|
104
|
-
* @param {Application} app - the current application instance
|
|
105
|
-
* @param {...*} [args] - optional arguments passed when switching state
|
|
89
|
+
* @param app - the current application instance
|
|
90
|
+
* @param args - optional arguments passed when switching state
|
|
106
91
|
* @see state#change
|
|
107
92
|
*/
|
|
108
|
-
onResetEvent(...args:
|
|
93
|
+
onResetEvent(app: Application, ...args: unknown[]): void;
|
|
109
94
|
/**
|
|
110
95
|
* onDestroyEvent function<br>
|
|
111
96
|
* called by the state manager before switching to another state
|
|
112
|
-
* @
|
|
113
|
-
* @memberof Stage
|
|
114
|
-
* @param {Application} [app] - the current application instance
|
|
97
|
+
* @param app - the current application instance
|
|
115
98
|
*/
|
|
116
|
-
onDestroyEvent(app
|
|
99
|
+
onDestroyEvent(app: Application): void;
|
|
117
100
|
}
|
|
118
|
-
|
|
119
|
-
import { Color } from "./../math/color.ts";
|
|
101
|
+
export {};
|
|
120
102
|
//# sourceMappingURL=stage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../src/state/stage.
|
|
1
|
+
{"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../src/state/stage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,iCAAiC,CAAC;AAC/D,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,uBAAuB,CAAC;AAC/C,OAAO,KAAK,OAAO,MAAM,4BAA4B,CAAC;AAEtD,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AAEnD,UAAU,aAAa;IACtB,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IAC9D,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,CAAC;CAC5C;AAUD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,KAAK;IACzB;;;;OAIG;IACH,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAE/B;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE7B;;;;OAIG;IACH,YAAY,EAAE,KAAK,CAAC;IAEpB;;OAEG;IACH,QAAQ,EAAE,aAAa,CAAC;IAExB;;;;;OAKG;gBACS,QAAQ,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC;IAO7C;;;OAGG;IACH,KAAK,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,SAAS,EAAE,OAAO,EAAE,GAAG,IAAI;IAyBtD;;;;;OAKG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAqB3B;;;;;OAKG;IACH,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAkC5C;;;OAGG;IACH,OAAO,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;IAY/B;;;;;;;OAOG;IACH,YAAY,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAOxD;;;;OAIG;IACH,cAAc,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;CAMtC"}
|
package/build/state/state.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Stage from "./../state/stage.
|
|
1
|
+
import Stage from "./../state/stage.ts";
|
|
2
2
|
/**
|
|
3
3
|
* a State Manager (state machine)
|
|
4
4
|
*/
|
|
@@ -47,10 +47,10 @@ declare const state: {
|
|
|
47
47
|
/**
|
|
48
48
|
* default state ID for user defined constants<br>
|
|
49
49
|
* @example
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
50
|
+
* const STATE_INFO = state.USER + 0;
|
|
51
|
+
* const STATE_WARN = state.USER + 1;
|
|
52
|
+
* const STATE_ERROR = state.USER + 2;
|
|
53
|
+
* const STATE_CUTSCENE = state.USER + 3;
|
|
54
54
|
*/
|
|
55
55
|
USER: 100;
|
|
56
56
|
/**
|
|
@@ -89,41 +89,27 @@ declare const state: {
|
|
|
89
89
|
* @param stage - Instantiated Stage to associate with state ID
|
|
90
90
|
* @param [start = false] - if true the state will be changed immediately after adding it.
|
|
91
91
|
* @example
|
|
92
|
-
* class
|
|
93
|
-
*
|
|
94
|
-
* // Change to the PLAY state when the button is clicked
|
|
95
|
-
* me.state.change(me.state.PLAY);
|
|
96
|
-
* return true;
|
|
97
|
-
* }
|
|
98
|
-
* };
|
|
99
|
-
*
|
|
100
|
-
* class MenuScreen extends me.Stage {
|
|
101
|
-
* onResetEvent() {
|
|
92
|
+
* class MenuScreen extends Stage {
|
|
93
|
+
* onResetEvent(app) {
|
|
102
94
|
* // Load background image
|
|
103
95
|
* app.world.addChild(
|
|
104
|
-
* new
|
|
96
|
+
* new ImageLayer(0, 0, {
|
|
105
97
|
* image : "bg",
|
|
106
98
|
* z: 0 // z-index
|
|
107
|
-
* }
|
|
108
|
-
* );
|
|
109
|
-
*
|
|
110
|
-
* // Add a button
|
|
111
|
-
* app.world.addChild(
|
|
112
|
-
* new MenuButton(350, 200, { "image" : "start" }),
|
|
113
|
-
* 1 // z-index
|
|
99
|
+
* })
|
|
114
100
|
* );
|
|
115
101
|
*
|
|
116
102
|
* // Play music
|
|
117
|
-
*
|
|
103
|
+
* audio.playTrack("menu");
|
|
118
104
|
* }
|
|
119
105
|
*
|
|
120
106
|
* onDestroyEvent() {
|
|
121
107
|
* // Stop music
|
|
122
|
-
*
|
|
108
|
+
* audio.stopTrack();
|
|
123
109
|
* }
|
|
124
|
-
* }
|
|
110
|
+
* }
|
|
125
111
|
*
|
|
126
|
-
*
|
|
112
|
+
* state.set(state.MENU, new MenuScreen());
|
|
127
113
|
*/
|
|
128
114
|
set(stateId: number, stage: Stage, start?: boolean): void;
|
|
129
115
|
/**
|
|
@@ -160,7 +146,7 @@ declare const state: {
|
|
|
160
146
|
* @example
|
|
161
147
|
* // The onResetEvent method on the play screen will receive two args:
|
|
162
148
|
* // "level_1" and the number 3
|
|
163
|
-
*
|
|
149
|
+
* state.change(state.PLAY, false, "level_1", 3);
|
|
164
150
|
*/
|
|
165
151
|
change(stateId: number, forceChange?: boolean, ...extraArgs: unknown[]): void;
|
|
166
152
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/state/state.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/state/state.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,qBAAqB,CAAC;AAkKxC;;GAEG;AACH,QAAA,MAAM,KAAK;IACV;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;;;;;;OAOG;;IAGH;;;OAGG;4BACoB,OAAO,GAAW,IAAI;IAmB7C;;;OAGG;kBACU,OAAO,GAAW,IAAI;IAkBnC;;;OAGG;oBACY,OAAO,GAAW,IAAI;IAiBrC;;;OAGG;mBACW,OAAO,GAAW,IAAI;IAiBpC;;;OAGG;iBACU,OAAO;IAIpB;;;OAGG;gBACS,OAAO;IAInB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;iBACU,MAAM,SAAS,KAAK,UAAS,OAAO,GAAW,IAAI;IAchE;;;;;OAKG;kBACU,MAAM,GAAY,KAAK,GAAG,SAAS;IAQhD;;;;OAIG;eACQ,KAAK,GAAG,SAAS;IAI5B;;;;;OAKG;uBACgB,MAAM,SAAS,MAAM,YAAY,MAAM,GAAG,IAAI;IAOjE;;;;OAIG;2BACoB,MAAM,UAAU,OAAO,GAAG,IAAI;IAIrD;;;;;;;;;OASG;oBAEO,MAAM,gBACF,OAAO,gBACN,OAAO,EAAE,GACrB,IAAI;IA4CP;;;;OAIG;uBACgB,MAAM,GAAG,OAAO;CAGnC,CAAC;AACF,eAAe,KAAK,CAAC"}
|
package/build/system/event.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type Application from "../application/application.ts";
|
|
|
5
5
|
import Pointer from "../input/pointer.ts";
|
|
6
6
|
import { Vector2d } from "../math/vector2d.ts";
|
|
7
7
|
import { Draggable } from "../renderable/draggable.js";
|
|
8
|
-
import Stage from "../state/stage.
|
|
8
|
+
import type Stage from "../state/stage.ts";
|
|
9
9
|
import Renderer from "../video/renderer.js";
|
|
10
10
|
/**
|
|
11
11
|
* event when the DOM is Ready is booting
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/system/event.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAC7D,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/system/event.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,WAAW,MAAM,+BAA+B,CAAC;AAC7D,OAAO,OAAO,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,KAAK,MAAM,mBAAmB,CA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
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* Easing.
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* Easing.Circular.InOut<br>
|
|
26
|
-
* Easing.Elastic.In<br>
|
|
27
|
-
* Easing.Elastic.Out<br>
|
|
28
|
-
* Easing.Elastic.InOut<br>
|
|
29
|
-
* Easing.Back.In<br>
|
|
30
|
-
* Easing.Back.Out<br>
|
|
31
|
-
* Easing.Back.InOut<br>
|
|
32
|
-
* Easing.Bounce.In<br>
|
|
33
|
-
* Easing.Bounce.Out<br>
|
|
34
|
-
* Easing.Bounce.InOut
|
|
35
|
-
* </p>
|
|
2
|
+
* Easing functions for use with {@link Tween}.
|
|
3
|
+
* Each family provides `In` (accelerate), `Out` (decelerate), and `InOut` (both) variants.
|
|
4
|
+
*
|
|
5
|
+
* Available families:
|
|
6
|
+
* - `Linear.None` — constant speed
|
|
7
|
+
* - `Quadratic` — power of 2
|
|
8
|
+
* - `Cubic` — power of 3
|
|
9
|
+
* - `Quartic` — power of 4
|
|
10
|
+
* - `Quintic` — power of 5
|
|
11
|
+
* - `Sinusoidal` — sine wave
|
|
12
|
+
* - `Exponential` — base-2 exponential
|
|
13
|
+
* - `Circular` — circular arc
|
|
14
|
+
* - `Elastic` — spring overshoot
|
|
15
|
+
* - `Back` — slight overshoot before settling
|
|
16
|
+
* - `Bounce` — bouncing ball effect
|
|
17
|
+
* @example
|
|
18
|
+
* // use with Tween
|
|
19
|
+
* new me.Tween(obj).to({ x: 100 }, {
|
|
20
|
+
* duration: 1000,
|
|
21
|
+
* easing: me.Tween.Easing.Bounce.Out,
|
|
22
|
+
* }).start();
|
|
23
|
+
* @see https://easings.net/ for visual reference
|
|
24
|
+
* @category Tweens
|
|
36
25
|
*/
|
|
37
26
|
export type EasingFunction = (t: number) => number;
|
|
38
27
|
export declare const Easing: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"easing.d.ts","sourceRoot":"","sources":["../../src/tweens/easing.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"easing.d.ts","sourceRoot":"","sources":["../../src/tweens/easing.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAEnD,eAAO,MAAM,MAAM;;kBAEP,MAAM;;;gBAMR,MAAM;iBAGL,MAAM;mBAGJ,MAAM;;;gBAST,MAAM;iBAGL,MAAM;mBAGJ,MAAM;;;gBAST,MAAM;iBAGL,MAAM;mBAGJ,MAAM;;;gBAST,MAAM;iBAGL,MAAM;mBAGJ,MAAM;;;gBAST,MAAM;iBAGL,MAAM;mBAGJ,MAAM;;;gBAMT,MAAM;iBAGL,MAAM;mBAGJ,MAAM;;;gBAeT,MAAM;iBAGL,MAAM;mBAGJ,MAAM;;;gBAST,MAAM;iBASL,MAAM;mBASJ,MAAM;;;gBAoBT,MAAM;iBAIL,MAAM;mBAIJ,MAAM;;;gBAUT,MAAM;iBAGL,MAAM;mBAWJ,MAAM;;CAOlB,CAAC"}
|
|
@@ -1,7 +1,39 @@
|
|
|
1
1
|
export type InterpolationFunction = (v: number[], k: number) => number;
|
|
2
|
+
/**
|
|
3
|
+
* Interpolation functions for tweening through arrays of values.
|
|
4
|
+
* Used when a tween target property is an array (e.g. a path of waypoints).
|
|
5
|
+
*
|
|
6
|
+
* Available functions:
|
|
7
|
+
* - `Linear` — straight-line interpolation between consecutive values
|
|
8
|
+
* - `Bezier` — smooth Bezier curve through all values
|
|
9
|
+
* - `CatmullRom` — smooth Catmull-Rom spline through all values (best for paths)
|
|
10
|
+
* @example
|
|
11
|
+
* // tween through waypoints using CatmullRom spline
|
|
12
|
+
* new me.Tween(obj).to({ x: [100, 200, 300, 400] }, {
|
|
13
|
+
* duration: 2000,
|
|
14
|
+
* interpolation: me.Tween.Interpolation.CatmullRom,
|
|
15
|
+
* }).start();
|
|
16
|
+
* @see {@link Tween}
|
|
17
|
+
* @category Tweens
|
|
18
|
+
*/
|
|
2
19
|
export declare const Interpolation: {
|
|
20
|
+
/**
|
|
21
|
+
* Piecewise linear interpolation between consecutive array values.
|
|
22
|
+
* @param v - array of values
|
|
23
|
+
* @param k - interpolation factor (0 to 1)
|
|
24
|
+
*/
|
|
3
25
|
Linear: (v: number[], k: number) => number;
|
|
26
|
+
/**
|
|
27
|
+
* Smooth Bezier curve interpolation through all array values.
|
|
28
|
+
* @param v - array of values
|
|
29
|
+
* @param k - interpolation factor (0 to 1)
|
|
30
|
+
*/
|
|
4
31
|
Bezier: (v: number[], k: number) => number;
|
|
32
|
+
/**
|
|
33
|
+
* Smooth Catmull-Rom spline interpolation — best for path-following tweens.
|
|
34
|
+
* @param v - array of values
|
|
35
|
+
* @param k - interpolation factor (0 to 1)
|
|
36
|
+
*/
|
|
5
37
|
CatmullRom: (v: number[], k: number) => number;
|
|
6
38
|
};
|
|
7
39
|
//# sourceMappingURL=interpolation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interpolation.d.ts","sourceRoot":"","sources":["../../src/tweens/interpolation.ts"],"names":[],"mappings":"AA8CA,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAEvE,eAAO,MAAM,aAAa;
|
|
1
|
+
{"version":3,"file":"interpolation.d.ts","sourceRoot":"","sources":["../../src/tweens/interpolation.ts"],"names":[],"mappings":"AA8CA,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AAEvE;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa;IACzB;;;;OAIG;gBACS,MAAM,EAAE,KAAK,MAAM;IAc/B;;;;OAIG;gBACS,MAAM,EAAE,KAAK,MAAM;IAU/B;;;;OAIG;oBACa,MAAM,EAAE,KAAK,MAAM;CAoCnC,CAAC"}
|
package/build/tweens/tween.d.ts
CHANGED
|
@@ -7,17 +7,30 @@ type OnUpdateCallback<T> = (this: T, value: number) => void;
|
|
|
7
7
|
/** @ignore */
|
|
8
8
|
type OnCompleteCallback<T> = (this: T) => void;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
10
|
+
* A tweening engine for smoothly interpolating object properties over time.
|
|
11
|
+
* Based on <a href="https://github.com/sole/Tween.js">tween.js</a> with
|
|
12
|
+
* optimised Robert Penner's equations.
|
|
13
|
+
*
|
|
14
|
+
* Tweens use an event-based lifecycle — on `start()` the tween subscribes to
|
|
15
|
+
* the game loop events (`TICK`, `GAME_AFTER_UPDATE`, `STATE_PAUSE`,
|
|
16
|
+
* `STATE_RESUME`, `GAME_RESET`)
|
|
17
|
+
* and automatically unsubscribes on completion or `stop()`.
|
|
18
|
+
* They do not need to be added to a container.
|
|
19
|
+
* @example
|
|
20
|
+
* // basic usage
|
|
21
|
+
* new me.Tween(myObject.pos)
|
|
22
|
+
* .to({ x: 200, y: 200 }, { duration: 3000, easing: me.Tween.Easing.Bounce.Out })
|
|
23
|
+
* .onComplete(() => console.log("done!"))
|
|
24
|
+
* .start();
|
|
25
|
+
* @example
|
|
26
|
+
* // auto-start with options
|
|
27
|
+
* new me.Tween(myObject.pos).to({ x: 200 }, {
|
|
28
|
+
* duration: 1000,
|
|
29
|
+
* easing: me.Tween.Easing.Quadratic.InOut,
|
|
30
|
+
* yoyo: true,
|
|
31
|
+
* repeat: Infinity,
|
|
32
|
+
* autoStart: true,
|
|
33
|
+
* });
|
|
21
34
|
* @category Tweens
|
|
22
35
|
*/
|
|
23
36
|
export default class Tween {
|
|
@@ -40,21 +53,21 @@ export default class Tween {
|
|
|
40
53
|
_onCompleteCallback: OnCompleteCallback<object> | null;
|
|
41
54
|
_tweenTimeTracker: number;
|
|
42
55
|
_lastUpdate: number;
|
|
56
|
+
_isRunning: boolean;
|
|
57
|
+
_isPaused: boolean;
|
|
58
|
+
_lastTick: number;
|
|
59
|
+
/**
|
|
60
|
+
* whether the tween should persist across state changes (not auto-stopped on game reset)
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
43
63
|
isPersistent: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* whether the tween should keep running when the game is paused
|
|
66
|
+
* @default false
|
|
67
|
+
*/
|
|
44
68
|
updateWhenPaused: boolean;
|
|
45
|
-
isRenderable: boolean;
|
|
46
69
|
/**
|
|
47
|
-
* @param object - object
|
|
48
|
-
* @example
|
|
49
|
-
* // add a tween to change the object pos.x and pos.y variable to 200 in 3 seconds
|
|
50
|
-
* tween = new me.Tween(myObject.pos).to({
|
|
51
|
-
* x: 200,
|
|
52
|
-
* y: 200,
|
|
53
|
-
* }, {
|
|
54
|
-
* duration: 3000,
|
|
55
|
-
* easing: me.Tween.Easing.Bounce.Out,
|
|
56
|
-
* autoStart : true
|
|
57
|
-
* }).onComplete(myFunc);
|
|
70
|
+
* @param object - the object whose properties will be tweened
|
|
58
71
|
*/
|
|
59
72
|
constructor(object: object);
|
|
60
73
|
/**
|
|
@@ -71,27 +84,33 @@ export default class Tween {
|
|
|
71
84
|
_resumeCallback(elapsed: number): void;
|
|
72
85
|
/** @ignore */
|
|
73
86
|
_onAfterUpdate(lastUpdate: number): void;
|
|
87
|
+
/** @ignore */
|
|
88
|
+
_onTick(timestamp: number): void;
|
|
89
|
+
/** @ignore */
|
|
90
|
+
_onPause(): void;
|
|
91
|
+
/** @ignore */
|
|
92
|
+
_onReset(): void;
|
|
74
93
|
/**
|
|
75
|
-
*
|
|
94
|
+
* Subscribe to the game loop events
|
|
76
95
|
* @ignore
|
|
77
96
|
*/
|
|
78
|
-
|
|
97
|
+
_subscribe(): void;
|
|
79
98
|
/**
|
|
80
|
-
* Unsubscribe
|
|
99
|
+
* Unsubscribe from the game loop events
|
|
81
100
|
* @ignore
|
|
82
101
|
*/
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
*
|
|
86
|
-
* @param properties -
|
|
87
|
-
* @param [options] -
|
|
88
|
-
* @param [options.duration] - tween duration
|
|
89
|
-
* @param [options.easing] - easing function
|
|
90
|
-
* @param [options.delay] - delay
|
|
91
|
-
* @param [options.yoyo] -
|
|
92
|
-
* @param [options.repeat] -
|
|
93
|
-
* @param [options.interpolation] - interpolation function
|
|
94
|
-
* @param [options.autoStart] -
|
|
102
|
+
_unsubscribe(): void;
|
|
103
|
+
/**
|
|
104
|
+
* Define the target property values and tween options.
|
|
105
|
+
* @param properties - target property values to tween to (e.g. `{ x: 200, y: 100 }`)
|
|
106
|
+
* @param [options] - tween configuration
|
|
107
|
+
* @param [options.duration] - tween duration in milliseconds
|
|
108
|
+
* @param [options.easing] - easing function (e.g. `Tween.Easing.Quadratic.InOut`)
|
|
109
|
+
* @param [options.delay] - delay before starting, in milliseconds
|
|
110
|
+
* @param [options.yoyo] - bounce back to original values when finished (use with `repeat`)
|
|
111
|
+
* @param [options.repeat] - number of times to repeat (use `Infinity` for endless loops)
|
|
112
|
+
* @param [options.interpolation] - interpolation function for array values
|
|
113
|
+
* @param [options.autoStart] - start the tween immediately without calling `start()`
|
|
95
114
|
* @returns this instance for object chaining
|
|
96
115
|
*/
|
|
97
116
|
to(properties: Record<string, unknown>, options?: {
|
|
@@ -104,13 +123,13 @@ export default class Tween {
|
|
|
104
123
|
autoStart?: boolean | undefined;
|
|
105
124
|
}): this;
|
|
106
125
|
/**
|
|
107
|
-
*
|
|
108
|
-
* @param [time] - the
|
|
126
|
+
* Start the tween. Subscribes to game loop events and begins interpolation.
|
|
127
|
+
* @param [time] - the start time (defaults to current game time)
|
|
109
128
|
* @returns this instance for object chaining
|
|
110
129
|
*/
|
|
111
130
|
start(time?: number): this;
|
|
112
131
|
/**
|
|
113
|
-
*
|
|
132
|
+
* Stop the tween. Unsubscribes from all game loop events.
|
|
114
133
|
* @returns this instance for object chaining
|
|
115
134
|
*/
|
|
116
135
|
stop(): this;
|
|
@@ -171,6 +190,15 @@ export default class Tween {
|
|
|
171
190
|
onComplete(onCompleteCallback: OnCompleteCallback<object>): this;
|
|
172
191
|
/** @ignore */
|
|
173
192
|
update(dt: number): boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Available easing functions, accessed via `Tween.Easing`.
|
|
195
|
+
* Each family provides `In`, `Out`, and `InOut` variants.
|
|
196
|
+
* @see {@link Easing} for the full list
|
|
197
|
+
* @example
|
|
198
|
+
* me.Tween.Easing.Quadratic.InOut
|
|
199
|
+
* me.Tween.Easing.Bounce.Out
|
|
200
|
+
* me.Tween.Easing.Elastic.In
|
|
201
|
+
*/
|
|
174
202
|
static get Easing(): {
|
|
175
203
|
Linear: {
|
|
176
204
|
None: (k: number) => number;
|
|
@@ -226,6 +254,14 @@ export default class Tween {
|
|
|
226
254
|
InOut: (k: number) => number;
|
|
227
255
|
};
|
|
228
256
|
};
|
|
257
|
+
/**
|
|
258
|
+
* Available interpolation functions for tweening array values.
|
|
259
|
+
* @see {@link Interpolation}
|
|
260
|
+
* @example
|
|
261
|
+
* me.Tween.Interpolation.Linear
|
|
262
|
+
* me.Tween.Interpolation.Bezier
|
|
263
|
+
* me.Tween.Interpolation.CatmullRom
|
|
264
|
+
*/
|
|
229
265
|
static get Interpolation(): {
|
|
230
266
|
Linear: (v: number[], k: number) => number;
|
|
231
267
|
Bezier: (v: number[], k: number) => number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tween.d.ts","sourceRoot":"","sources":["../../src/tweens/tween.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tween.d.ts","sourceRoot":"","sources":["../../src/tweens/tween.ts"],"names":[],"mappings":"AAWA,OAAO,EAAU,cAAc,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAiB,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAO1E,cAAc;AACd,KAAK,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;AAC5C,cAAc;AACd,KAAK,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;AAC5D,cAAc;AACd,KAAK,kBAAkB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,OAAO,OAAO,KAAK;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,eAAe,EAAE,cAAc,CAAC;IAChC,sBAAsB,EAAE,qBAAqB,CAAC;IAC9C,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7B,gBAAgB,EAAE,eAAe,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACj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AAG,SAAS,CAAC;KAChC;IA+BF;;;;OAIG;IACH,KAAK,CAAC,IAAI,SAAkB;IA4C5B;;;OAGG;IACH,IAAI;IAKJ;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM;IAKpB;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM;IAKpB;;;;;OAKG;IACH,IAAI,CAAC,IAAI,EAAE,OAAO;IAKlB;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,cAAc;IAK7B;;;;OAIG;IACH,aAAa,CAAC,aAAa,EAAE,qBAAqB;IAKlD;;;;OAIG;IACH,KAAK,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE;IAKxB;;;;OAIG;IACH,OAAO,CAAC,eAAe,EAAE,eAAe,CAAC,MAAM,CAAC;IAKhD;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,MAAM,CAAC;IAKnD;;;;OAIG;IACH,UAAU,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,MAAM,CAAC;IAKzD,cAAc;IACd,MAAM,CAAC,EAAE,EAAE,MAAM;IAiHjB;;;;;;;;OAQG;IACH,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAEhB;IAED;;;;;;;OAOG;IACH,MAAM,KAAK,aAAa;;;;MAEvB;CACD;AAED,eAAO,MAAM,SAAS,wDASpB,CAAC"}
|
|
@@ -117,6 +117,9 @@ export default class CanvasRenderer extends Renderer {
|
|
|
117
117
|
* @see CanvasRenderer#createPattern
|
|
118
118
|
*/
|
|
119
119
|
drawPattern(pattern: CanvasPattern, x: number, y: number, width: number, height: number): void;
|
|
120
|
+
_meshSortBuf: Float64Array<ArrayBuffer> | undefined;
|
|
121
|
+
_meshColorCanvas: HTMLCanvasElement | undefined;
|
|
122
|
+
_meshColorCtx: CanvasRenderingContext2D | null | undefined;
|
|
120
123
|
/**
|
|
121
124
|
* starts a new path by emptying the list of sub-paths. Call this method when you want to create a new path
|
|
122
125
|
* @example
|
|
@@ -399,25 +402,25 @@ export default class CanvasRenderer extends Renderer {
|
|
|
399
402
|
/**
|
|
400
403
|
* Reset (overrides) the renderer transformation matrix to the
|
|
401
404
|
* identity one, and then apply the given transformation matrix.
|
|
402
|
-
* @param {Matrix2d|number} a - a
|
|
405
|
+
* @param {Matrix2d|Matrix3d|number} a - a matrix to transform by, or the a component to multiply the current matrix by
|
|
403
406
|
* @param {number} b - the b component to multiply the current matrix by
|
|
404
407
|
* @param {number} c - the c component to multiply the current matrix by
|
|
405
408
|
* @param {number} d - the d component to multiply the current matrix by
|
|
406
409
|
* @param {number} e - the e component to multiply the current matrix by
|
|
407
410
|
* @param {number} f - the f component to multiply the current matrix by
|
|
408
411
|
*/
|
|
409
|
-
setTransform(a: Matrix2d | number, b: number, c: number, d: number, e: number, f: number): void;
|
|
412
|
+
setTransform(a: Matrix2d | Matrix3d | number, b: number, c: number, d: number, e: number, f: number): void;
|
|
410
413
|
/**
|
|
411
414
|
* Multiply given matrix into the renderer tranformation matrix
|
|
412
415
|
* @see {@link CanvasRenderer.setTransform} which will reset the current transform matrix prior to performing the new transformation
|
|
413
|
-
* @param {Matrix2d|number} a - a
|
|
416
|
+
* @param {Matrix2d|Matrix3d|number} a - a matrix to transform by, or the a component to multiply the current matrix by
|
|
414
417
|
* @param {number} b - the b component to multiply the current matrix by
|
|
415
418
|
* @param {number} c - the c component to multiply the current matrix by
|
|
416
419
|
* @param {number} d - the d component to multiply the current matrix by
|
|
417
420
|
* @param {number} e - the e component to multiply the current matrix by
|
|
418
421
|
* @param {number} f - the f component to multiply the current matrix by
|
|
419
422
|
*/
|
|
420
|
-
transform(a: Matrix2d | number, b: number, c: number, d: number, e: number, f: number): void;
|
|
423
|
+
transform(a: Matrix2d | Matrix3d | number, b: number, c: number, d: number, e: number, f: number): void;
|
|
421
424
|
/**
|
|
422
425
|
* adds a translation transformation to the current matrix.
|
|
423
426
|
* @param {number} x - Distance to move in the horizontal direction. Positive values are to the right, and negative to the left.
|