melonjs 20.10.1 → 20.11.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 +3 -5
- package/build/application/application.d.ts.map +1 -1
- package/build/application/defaultApplicationSettings.d.ts +1 -0
- package/build/application/defaultApplicationSettings.d.ts.map +1 -1
- package/build/application/settings.d.ts +48 -1
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/audio.d.ts +14 -4
- package/build/audio/audio.d.ts.map +1 -1
- package/build/audio/playback.d.ts.map +1 -1
- package/build/audio/types.d.ts +19 -1
- package/build/audio/types.d.ts.map +1 -1
- package/build/camera/camera2d.d.ts +48 -4
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/camera/effects/shake_effect.d.ts +3 -1
- package/build/camera/effects/shake_effect.d.ts.map +1 -1
- package/build/index.d.ts +4 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3174 -1038
- package/build/index.js.map +4 -4
- package/build/level/tiled/TMXLayer.d.ts +1 -1
- package/build/level/tiled/TMXLayer.d.ts.map +1 -1
- package/build/level/tiled/TMXObject.d.ts +196 -1
- package/build/level/tiled/TMXObject.d.ts.map +1 -1
- package/build/level/tiled/TMXObjectFactory.d.ts +18 -5
- package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -1
- package/build/level/tiled/TMXTile.d.ts.map +1 -1
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
- package/build/level/tiled/TMXTileset.d.ts +17 -1
- package/build/level/tiled/TMXTileset.d.ts.map +1 -1
- package/build/level/tiled/TMXUtils.d.ts.map +1 -1
- package/build/level/tiled/factories/shape.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
- package/build/lighting/light2d.d.ts +30 -0
- package/build/lighting/light2d.d.ts.map +1 -1
- package/build/particles/emitter.d.ts.map +1 -1
- package/build/particles/particle.d.ts.map +1 -1
- package/build/particles/settings.d.ts +25 -0
- package/build/particles/settings.d.ts.map +1 -1
- package/build/physics/builtin/raycast.d.ts.map +1 -1
- package/build/physics/builtin/sat.d.ts +40 -1
- package/build/physics/builtin/sat.d.ts.map +1 -1
- package/build/renderable/animation.d.ts +10 -1
- package/build/renderable/animation.d.ts.map +1 -1
- package/build/renderable/colorlayer.d.ts.map +1 -1
- package/build/renderable/container.d.ts +22 -2
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/frameAnimation.d.ts.map +1 -1
- package/build/renderable/imagelayer.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts +69 -1
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +19 -7
- package/build/renderable/sprite.d.ts.map +1 -1
- package/build/renderable/sprite3d.d.ts +5 -3
- package/build/renderable/sprite3d.d.ts.map +1 -1
- package/build/renderable/text/text.d.ts.map +1 -1
- package/build/state/stage.d.ts +9 -2
- package/build/state/stage.d.ts.map +1 -1
- package/build/system/timer.d.ts +1 -0
- package/build/system/timer.d.ts.map +1 -1
- package/build/utils/fetchdata.d.ts.map +1 -1
- package/build/video/buffer/vertex.d.ts.map +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +7 -7
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/effects/ambientlight.d.ts +2 -0
- package/build/video/effects/ambientlight.d.ts.map +1 -0
- package/build/video/effects/bloom.d.ts +7 -9
- package/build/video/effects/bloom.d.ts.map +1 -1
- package/build/video/effects/blur.d.ts +3 -2
- package/build/video/effects/blur.d.ts.map +1 -1
- package/build/video/effects/chromaticAberration.d.ts +3 -2
- package/build/video/effects/chromaticAberration.d.ts.map +1 -1
- package/build/video/effects/dissolve.d.ts +5 -2
- package/build/video/effects/dissolve.d.ts.map +1 -1
- package/build/video/effects/dropShadow.d.ts +15 -3
- package/build/video/effects/dropShadow.d.ts.map +1 -1
- package/build/video/effects/flash.d.ts +6 -2
- package/build/video/effects/flash.d.ts.map +1 -1
- package/build/video/effects/frame.d.ts +48 -0
- package/build/video/effects/frame.d.ts.map +1 -0
- package/build/video/effects/glow.d.ts +8 -4
- package/build/video/effects/glow.d.ts.map +1 -1
- package/build/video/effects/glsl_realization.d.ts.map +1 -1
- package/build/video/effects/hologram.d.ts +5 -2
- package/build/video/effects/hologram.d.ts.map +1 -1
- package/build/video/effects/outline.d.ts +8 -4
- package/build/video/effects/outline.d.ts.map +1 -1
- package/build/video/effects/pixelate.d.ts +3 -2
- package/build/video/effects/pixelate.d.ts.map +1 -1
- package/build/video/effects/radialGradient.d.ts +9 -4
- package/build/video/effects/radialGradient.d.ts.map +1 -1
- package/build/video/effects/rgba.d.ts +2 -0
- package/build/video/effects/rgba.d.ts.map +1 -0
- package/build/video/effects/shadereffect.d.ts +13 -0
- package/build/video/effects/shadereffect.d.ts.map +1 -1
- package/build/video/effects/shine.d.ts +5 -2
- package/build/video/effects/shine.d.ts.map +1 -1
- package/build/video/effects/squish.d.ts.map +1 -1
- package/build/video/effects/sway.d.ts +64 -0
- package/build/video/effects/sway.d.ts.map +1 -0
- package/build/video/effects/tintPulse.d.ts +5 -2
- package/build/video/effects/tintPulse.d.ts.map +1 -1
- package/build/video/effects/wave.d.ts +17 -0
- package/build/video/effects/wave.d.ts.map +1 -1
- package/build/video/effects/wgsl/scaffold.d.ts.map +1 -1
- package/build/video/effects/wgsl_realization.d.ts.map +1 -1
- package/build/video/gpu/frame.d.ts +2 -0
- package/build/video/gpu/frame.d.ts.map +1 -0
- package/build/video/renderer.d.ts +35 -11
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/rendertarget/canvasrendertarget.d.ts +14 -4
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/rendertarget.d.ts +12 -16
- package/build/video/rendertarget/rendertarget.d.ts.map +1 -1
- package/build/video/texture/atlas.d.ts +23 -4
- package/build/video/texture/atlas.d.ts.map +1 -1
- package/build/video/texture/cache.d.ts.map +1 -1
- package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/glshader.d.ts.map +1 -1
- package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
- package/build/video/webgl/shaders/frameclamp.d.ts +2 -0
- package/build/video/webgl/shaders/frameclamp.d.ts.map +1 -0
- package/build/video/webgl/shaders/multitexture-lit.d.ts.map +1 -1
- package/build/video/webgl/shaders/multitexture.d.ts.map +1 -1
- package/build/video/webgl/utils/uniforms.d.ts.map +1 -1
- package/build/video/webgl/webgl_renderer.d.ts +0 -21
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts +2 -1
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/quad_batcher.d.ts +2 -2
- package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/buffer/uniformring.d.ts.map +1 -1
- package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
- package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/package.json +21 -19
- package/skills/melonjs-audio/SKILL.md +22 -1
- package/skills/melonjs-camera-and-drawing/SKILL.md +63 -1
- package/skills/melonjs-display-and-scaling/SKILL.md +98 -2
- package/skills/melonjs-effects-and-shaders/SKILL.md +89 -7
- package/skills/melonjs-lighting/SKILL.md +39 -5
- package/skills/melonjs-math/SKILL.md +21 -1
- package/skills/melonjs-particles-and-trails/SKILL.md +36 -2
- package/skills/melonjs-performance/SKILL.md +1 -0
- package/skills/melonjs-renderables/SKILL.md +42 -3
- package/skills/melonjs-sprites-and-animation/SKILL.md +19 -3
- package/skills/melonjs-tilemaps/SKILL.md +126 -4
|
@@ -99,8 +99,8 @@ export default class TMXLayer extends Renderable {
|
|
|
99
99
|
*/
|
|
100
100
|
renderMode: string;
|
|
101
101
|
onActivateEvent(): void;
|
|
102
|
-
canvasRenderer: CanvasRenderer | undefined;
|
|
103
102
|
preRender: boolean | undefined;
|
|
103
|
+
canvasRenderer: CanvasRenderer | undefined;
|
|
104
104
|
onDeactivateEvent(): void;
|
|
105
105
|
/**
|
|
106
106
|
* Set the TMX renderer for this layer object
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TMXLayer.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXLayer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TMXLayer.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXLayer.js"],"names":[],"mappings":"AAmIA;;;;GAIG;AACH;IACC;;;;;;;;OAQG;IACH,iBARW,MAAM,QACN,MAAM,aACN,MAAM,cACN,MAAM,eACN,MAAM,YACN,eAAe,KACf,MAAM,EA6LhB;IAtLA,eAA4C;IAC5C,gBAA+C;IAG/C,oBAA8B;IAE9B;;;;OAIG;IACH,GAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,GAFU,MAAM,CAEN;IAEV;;;OAGG;IACH,UAFU,eAAe,CAED;IAGxB,2BAAwE;IAGxE;;;MAGC;IAaD;;;OAGG;IACH,kBAFU,UAAU,EAAE,CAEI;IAE1B;;;OAGG;IACH,YAFU,OAAO,CAEM;IAEvB;;;;;OAKG;IACH,aAHU,MAAM,CAGmC;IAEnD;;;OAGG;IACH,OAFU,MAAM,CAEO;IASvB,UAAqB;IACrB,aAAuB;IACvB,aAAwB;IA8BxB;;;;;;;;;OASG;IACH,WAFU,WAAW,CAEsC;IAE3D;;;;;;;;;;;;OAYG;IACH,YAJU,KAAK,CAAC,IAAI,GAAC,IAAI,CAAC,GAAC,IAAI,CAIT;IAE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AA2B"}
|
|
@@ -1,2 +1,197 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* An object of a Tiled map, as read from the map. It is the `settings` that
|
|
3
|
+
* a class registered with {@link registerTiledObjectClass} receives (and
|
|
4
|
+
* that a factory registered with {@link registerTiledObjectFactory} is
|
|
5
|
+
* given), before the object is turned into a renderable.
|
|
6
|
+
* <br><br>
|
|
7
|
+
* The object's own custom properties are set on it by name.
|
|
8
|
+
* {@link TMXObject#resolvedProperties} and {@link TMXObject#resolvedProperty}
|
|
9
|
+
* also include those a tile object inherits from its tile, as Tiled shows
|
|
10
|
+
* them. A tile object with no class of its own is matched by its tile's class.
|
|
11
|
+
* <br><br>
|
|
12
|
+
* In TypeScript, declare the custom properties a class reads by extending
|
|
13
|
+
* this type.
|
|
14
|
+
* @category Tilemap
|
|
15
|
+
* @example
|
|
16
|
+
* import { registerTiledObjectClass, Sprite, type TMXObject } from "melonjs";
|
|
17
|
+
*
|
|
18
|
+
* // the custom properties the class reads, as set on the object in Tiled
|
|
19
|
+
* interface ChestSettings extends TMXObject {
|
|
20
|
+
* locked?: boolean;
|
|
21
|
+
* }
|
|
22
|
+
*
|
|
23
|
+
* class Chest extends Sprite {
|
|
24
|
+
* locked: boolean;
|
|
25
|
+
* gold: number;
|
|
26
|
+
* constructor(x: number, y: number, settings: ChestSettings) {
|
|
27
|
+
* super(x, y, { image: "chest" });
|
|
28
|
+
* this.locked = settings.locked ?? false;
|
|
29
|
+
* // set on the object, or else on the chest tile in the tileset
|
|
30
|
+
* this.gold = settings.resolvedProperty("gold") ?? 10;
|
|
31
|
+
* }
|
|
32
|
+
* }
|
|
33
|
+
* // in Tiled, give the chest tile the class "Chest": every chest placed
|
|
34
|
+
* // in the map is then built by this class
|
|
35
|
+
* registerTiledObjectClass("Chest", Chest);
|
|
36
|
+
*/
|
|
37
|
+
export default class TMXObject {
|
|
38
|
+
/**
|
|
39
|
+
* point list in JSON format
|
|
40
|
+
* @type {object[]}
|
|
41
|
+
*/
|
|
42
|
+
points: object[];
|
|
43
|
+
/**
|
|
44
|
+
* object name
|
|
45
|
+
* @type {string}
|
|
46
|
+
*/
|
|
47
|
+
name: string;
|
|
48
|
+
/**
|
|
49
|
+
* object x position
|
|
50
|
+
* @type {number}
|
|
51
|
+
*/
|
|
52
|
+
x: number;
|
|
53
|
+
/**
|
|
54
|
+
* object y position
|
|
55
|
+
* @type {number}
|
|
56
|
+
*/
|
|
57
|
+
y: number;
|
|
58
|
+
/**
|
|
59
|
+
* object z order
|
|
60
|
+
* @type {number}
|
|
61
|
+
*/
|
|
62
|
+
z: number;
|
|
63
|
+
/**
|
|
64
|
+
* object width
|
|
65
|
+
* @type {number}
|
|
66
|
+
*/
|
|
67
|
+
width: number;
|
|
68
|
+
/**
|
|
69
|
+
* object height
|
|
70
|
+
* @type {number}
|
|
71
|
+
*/
|
|
72
|
+
height: number;
|
|
73
|
+
/**
|
|
74
|
+
* object gid value
|
|
75
|
+
* when defined the object is a tiled object
|
|
76
|
+
* @type {number|null}
|
|
77
|
+
*/
|
|
78
|
+
gid: number | null;
|
|
79
|
+
/**
|
|
80
|
+
* tint color
|
|
81
|
+
* @type {string}
|
|
82
|
+
*/
|
|
83
|
+
tintcolor: string;
|
|
84
|
+
/**
|
|
85
|
+
* object type
|
|
86
|
+
* @type {string}
|
|
87
|
+
* @deprecated since Tiled 1.9
|
|
88
|
+
* @see {@link https://docs.mapeditor.org/en/stable/reference/tmx-changelog/#tiled-1-9}
|
|
89
|
+
*/
|
|
90
|
+
type: string;
|
|
91
|
+
/**
|
|
92
|
+
* the object class
|
|
93
|
+
* @type {string}
|
|
94
|
+
*/
|
|
95
|
+
class: string;
|
|
96
|
+
/**
|
|
97
|
+
* object text
|
|
98
|
+
* @type {object}
|
|
99
|
+
* @see {@link http://docs.mapeditor.org/en/stable/reference/tmx-map-format/#text}
|
|
100
|
+
*/
|
|
101
|
+
text: object;
|
|
102
|
+
/**
|
|
103
|
+
* The rotation of the object in radians clockwise (defaults to 0)
|
|
104
|
+
* @type {number}
|
|
105
|
+
*/
|
|
106
|
+
rotation: number;
|
|
107
|
+
/**
|
|
108
|
+
* the object opacity (0-1), defaults to 1 (since Tiled 1.12)
|
|
109
|
+
* @type {number}
|
|
110
|
+
*/
|
|
111
|
+
opacity: number;
|
|
112
|
+
/**
|
|
113
|
+
* whether the object is visible, defaults to true
|
|
114
|
+
* @type {boolean}
|
|
115
|
+
*/
|
|
116
|
+
visible: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* object unique identifier per level (Tiled 0.11.x+)
|
|
119
|
+
* @type {number}
|
|
120
|
+
*/
|
|
121
|
+
id: number;
|
|
122
|
+
/**
|
|
123
|
+
* object orientation (orthogonal or isometric)
|
|
124
|
+
* @type {string}
|
|
125
|
+
*/
|
|
126
|
+
orientation: string;
|
|
127
|
+
/**
|
|
128
|
+
* the collision shapes defined for this object
|
|
129
|
+
* @type {object[]}
|
|
130
|
+
*/
|
|
131
|
+
shapes: object[];
|
|
132
|
+
/**
|
|
133
|
+
* the detected shape type
|
|
134
|
+
* @type {string}
|
|
135
|
+
*/
|
|
136
|
+
shapeType: string;
|
|
137
|
+
/** @type {boolean} */
|
|
138
|
+
isEllipse: boolean;
|
|
139
|
+
/** @type {boolean} */
|
|
140
|
+
isCapsule: boolean;
|
|
141
|
+
/** @type {boolean} */
|
|
142
|
+
isPoint: boolean;
|
|
143
|
+
/** @type {boolean} */
|
|
144
|
+
isPolygon: boolean;
|
|
145
|
+
/** @type {boolean} */
|
|
146
|
+
isPolyLine: boolean;
|
|
147
|
+
/**
|
|
148
|
+
* width of the object's tile in its tileset image, for a tile
|
|
149
|
+
* object from a tileset image (undefined otherwise)
|
|
150
|
+
* @type {number|undefined}
|
|
151
|
+
*/
|
|
152
|
+
framewidth: number | undefined;
|
|
153
|
+
/**
|
|
154
|
+
* height of the object's tile in its tileset image, for a tile
|
|
155
|
+
* object from a tileset image (undefined otherwise)
|
|
156
|
+
* @type {number|undefined}
|
|
157
|
+
*/
|
|
158
|
+
frameheight: number | undefined;
|
|
159
|
+
/**
|
|
160
|
+
* the tile of a tile object (one with a `gid`), undefined otherwise
|
|
161
|
+
* @type {Tile|undefined}
|
|
162
|
+
*/
|
|
163
|
+
tile: Tile | undefined;
|
|
164
|
+
/**
|
|
165
|
+
* Return the object's custom properties, including those it inherits
|
|
166
|
+
* from its tile (for a tile object), as Tiled resolves them: a property
|
|
167
|
+
* the object sets itself wins over its tile's. Each call returns a new
|
|
168
|
+
* object; the values themselves are not copied.
|
|
169
|
+
* @returns {Object<string, *>} the resolved custom properties
|
|
170
|
+
* @example
|
|
171
|
+
* // a door tile has a "facing" property in the tileset: every door
|
|
172
|
+
* // object placed from it has it, unless the object sets its own
|
|
173
|
+
* const { facing = "N" } = settings.resolvedProperties();
|
|
174
|
+
*/
|
|
175
|
+
resolvedProperties(): {
|
|
176
|
+
[x: string]: any;
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Return the value of one custom property of the object, or else of its
|
|
180
|
+
* tile (for a tile object), as Tiled resolves it.
|
|
181
|
+
* @param {string} name - name of the custom property
|
|
182
|
+
* @returns {*} the property's value, or undefined if neither the object
|
|
183
|
+
* nor its tile sets it
|
|
184
|
+
* @example
|
|
185
|
+
* const opens = settings.resolvedProperty("opens");
|
|
186
|
+
*/
|
|
187
|
+
resolvedProperty(name: string): any;
|
|
188
|
+
/**
|
|
189
|
+
* parses the TMX shape definition and returns a corresponding array of shape objects
|
|
190
|
+
* @private
|
|
191
|
+
* @returns {Polygon[]|Line[]|Ellipse[]|RoundRect[]} an array of shape objects
|
|
192
|
+
*/
|
|
193
|
+
private parseTMXShapes;
|
|
194
|
+
#private;
|
|
195
|
+
}
|
|
196
|
+
import Tile from "./TMXTile.js";
|
|
2
197
|
//# sourceMappingURL=TMXObject.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TMXObject.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXObject.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TMXObject.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXObject.js"],"names":[],"mappings":"AAyCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH;IAaC;;;;;;OAMG;IACH,iBANW,UAAU,YACV,MAAM,KACN,MAAM,EA6KhB;IAxKA;;;OAGG;IACH,QAFU,MAAM,EAAE,CAEK;IAEvB;;;OAGG;IACH,MAFU,MAAM,CAES;IAEzB;;;OAGG;IACH,GAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,GAFU,MAAM,CAEI;IAEpB;;;OAGG;IACH,GAFU,MAAM,CAEL;IAEX;;;OAGG;IACH,OAFU,MAAM,CAEiB;IAEjC;;;OAGG;IACH,QAFU,MAAM,CAEmB;IAEnC;;;;OAIG;IACH,KAFU,MAAM,GAAC,IAAI,CAEW;IAEhC;;;OAGG;IACH,WAFU,MAAM,CAEmB;IAEnC;;;;;OAKG;IACH,MAJU,MAAM,CAIS;IAEzB;;;OAGG;IACH,OAFU,MAAM,CAE4B;IAE5C;;;;OAIG;IACH,MAHU,MAAM,CAGK;IAErB;;;OAGG;IACH,UAFU,MAAM,CAEiC;IAEjD;;;OAGG;IACH,SAFU,MAAM,CAEuB;IAEvC;;;OAGG;IACH,SAFU,OAAO,CAE4B;IAE7C;;;OAGG;IACH,IAFU,MAAM,CAEmB;IAEnC;;;OAGG;IACH,aAFU,MAAM,CAEkB;IAMlC;;;OAGG;IACH,QAFU,MAAM,EAAE,CAEK;IAEvB;;;OAGG;IACH,WAFU,MAAM,CAEY;IAa5B,sBAAsB;IACtB,WADW,OAAO,CAC2B;IAC7C,sBAAsB;IACtB,WADW,OAAO,CAC2B;IAC7C,sBAAsB;IACtB,SADW,OAAO,CACuB;IACzC,sBAAsB;IACtB,WADW,OAAO,CAC2B;IAC7C,sBAAsB;IACtB,YADW,OAAO,CAC6B;IA4BhD;;;;OAIG;IACH,6BA2BC;IAvBC;;;;OAIG;IACH,YAFU,MAAM,GAAC,SAAS,CAES;IACnC;;;;OAIG;IACH,aAFU,MAAM,GAAC,SAAS,CAEW;IAOtC;;;OAGG;IACH,MAFU,IAAI,GAAC,SAAS,CAE+B;IAGxD;;;;;;;;;;OAUG;IACH;;MAEC;IAED;;;;;;;;OAQG;IACH,uBANW,MAAM,GACJ,GAAC,CAab;IAED;;;;;OAKG;IACH,uBAJa,MAAM,GAAC,SAAS,CAS5B;IAyCD;;;;OAIG;IACH,uBAgHC;IAED;;;;OAIG;IACH,wCAEC;;CACD;iBA5fgB,cAAc;4BAIJ,iBAAiB"}
|
|
@@ -6,12 +6,14 @@
|
|
|
6
6
|
* <br><br>
|
|
7
7
|
* Built-in structural types are: `"text"`, `"tile"`, `"shape"`.
|
|
8
8
|
* Custom types are matched against the object's Tiled `class` or `name` property.
|
|
9
|
+
* A tile object with no class of its own is matched by its tile's class.
|
|
9
10
|
* <br><br>
|
|
10
11
|
* For simple cases where you just want to map a Tiled class to a constructor,
|
|
11
12
|
* use {@link registerTiledObjectClass} instead.
|
|
12
13
|
* @category Tilemap
|
|
14
|
+
* @template [S=TMXObject]
|
|
13
15
|
* @param {string} type - the object type key (built-in type or Tiled class/name)
|
|
14
|
-
* @param {
|
|
16
|
+
* @param {(settings: S, map: TMXTileMap) => Renderable} factory - factory function, given the Tiled object (a {@link TMXObject}) and its map
|
|
15
17
|
* @example
|
|
16
18
|
* // register a custom factory for "Spine" objects in Tiled
|
|
17
19
|
* // (set the object class to "Spine" in Tiled, and add atlasFile/jsonFile custom properties)
|
|
@@ -30,11 +32,18 @@
|
|
|
30
32
|
* return obj;
|
|
31
33
|
* });
|
|
32
34
|
*/
|
|
33
|
-
export function registerTiledObjectFactory(type: string, factory:
|
|
35
|
+
export function registerTiledObjectFactory<S = TMXObject>(type: string, factory: (settings: S, map: TMXTileMap) => Renderable): void;
|
|
34
36
|
/**
|
|
35
37
|
* Register a class constructor as a Tiled object factory.
|
|
36
38
|
* When an object with a matching `class` or `name` is found in a Tiled map,
|
|
37
|
-
* an instance of the given constructor will be created with `new Constructor(x, y, settings)
|
|
39
|
+
* an instance of the given constructor will be created with `new Constructor(x, y, settings)`,
|
|
40
|
+
* `settings` being the {@link TMXObject} as read from the map.
|
|
41
|
+
* <br><br>
|
|
42
|
+
* A tile object with no class of its own is matched by its tile's class, as in
|
|
43
|
+
* Tiled: give a tile a class in Tiled's tileset editor, and every object placed
|
|
44
|
+
* from that tile is built by the class registered under that name (an object's
|
|
45
|
+
* own class or name, when registered, still comes first). The tile's custom
|
|
46
|
+
* properties are read with {@link TMXObject#resolvedProperty}.
|
|
38
47
|
* <br><br>
|
|
39
48
|
* This is a convenience wrapper around {@link registerTiledObjectFactory}.
|
|
40
49
|
* If the same class is registered twice with the same constructor, the call is silently ignored.
|
|
@@ -43,8 +52,9 @@ export function registerTiledObjectFactory(type: string, factory: Function): voi
|
|
|
43
52
|
* Note: classes registered via {@link pool.register} are also automatically registered
|
|
44
53
|
* as Tiled object factories (unless {@link pool.autoRegisterTiled} is set to `false`).
|
|
45
54
|
* @category Tilemap
|
|
55
|
+
* @template [S=TMXObject]
|
|
46
56
|
* @param {string} name - the Tiled class or object name to match
|
|
47
|
-
* @param {
|
|
57
|
+
* @param {new (x: number, y: number, settings: S) => Renderable} Constructor - class constructor, given the object's position and the object (a {@link TMXObject})
|
|
48
58
|
* @example
|
|
49
59
|
* // register a custom enemy class for use in Tiled maps
|
|
50
60
|
* // In Tiled: set the object class to "Enemy" and add custom properties
|
|
@@ -56,5 +66,8 @@ export function registerTiledObjectFactory(type: string, factory: Function): voi
|
|
|
56
66
|
* // alone does not do
|
|
57
67
|
* pool.register("CoinEntity", CoinEntity, true);
|
|
58
68
|
*/
|
|
59
|
-
export function registerTiledObjectClass(name: string, Constructor:
|
|
69
|
+
export function registerTiledObjectClass<S = TMXObject>(name: string, Constructor: new (x: number, y: number, settings: S) => Renderable): void;
|
|
70
|
+
import type TMXObject from "./TMXObject.js";
|
|
71
|
+
import type TMXTileMap from "./TMXTileMap.js";
|
|
72
|
+
import type Renderable from "../../renderable/renderable.js";
|
|
60
73
|
//# sourceMappingURL=TMXObjectFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TMXObjectFactory.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXObjectFactory.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TMXObjectFactory.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXObjectFactory.js"],"names":[],"mappings":"AAwDA;;;;;;;GAOG;AACH,0CALW,MAAM,GACJ,OAAO,GAAC,MAAM,EAAE,CAiB5B;AAED;;;;;;;;;;;;;;;GAeG;AACH,2CALW,MAAM,GACJ,MAAM,CAqClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,2CArBc,CAAC,oBACJ,MAAM,WACN,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,UAAU,KAAK,UAAU,QA+BtD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,yCAdc,CAAC,oBACJ,MAAM,eACN,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,UAAU,QAyC/D;AAsBD;;;;;;;;GAQG;AACH,gDALW,MAAM,+BAWhB;AAoED;;;;;;;;GAQG;AACH,0CANW,MAAM,OACN,UAAU,GACR,UAAU,CAsBtB;2BAzWyB,gBAAgB;4BACf,iBAAiB;4BAFjB,gCAAgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TMXTile.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXTile.js"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;;;;GAiBG;AACH,8CARW,QAAQ,YACR,MAAM,SACN,MAAM,UACN,MAAM,GACJ,QAAQ,CAyBpB;AAED;;;GAGG;AACH;IACC;;;;;OAKG;IACH,eALW,MAA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MAAM,GACJ,UAAU,CAuDtB;CACD;yBA/OwB,wBAAwB;uBAC1B,yBAAyB;4BAMrB,iBAAiB;4BADjB,gCAAgC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TMXTileMap.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXTileMap.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TMXTileMap.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXTileMap.js"],"names":[],"mappings":"AA0JA;;;;GAIG;AACH;IACC;;;;;;;;;;;OAWG;IACH,oBAJU,aAAa,CAAC,MAAM,CAAC,CAIsC;IAErE;;;;;;;;OAQG;IACH,qBARW,MAAM,QACN,MAAM,EAiKhB;IAzJA;;;;OAIG;IACH,aAAgB;IAEhB;;;OAGG;IACH,MAFU,MAAM,CAEG;IAEnB;;;OAGG;IACH,QAFU,MAAM,CAEG;IAEnB;;;OAGG;IACH,MAFU,MAAM,CAEO;IAEvB;;;OAGG;IACH,MAFU,MAAM,CAEQ;IAExB;;;OAGG;IACH,WAFU,MAAM,CAEgB;IAEhC;;;OAGG;IACH,YAFU,MAAM,CAEkB;IAElC;;;;OAIG;IACH,UAHU,MAAM,CAGmB;IAEnC;;;;OAIG;IACH,aAHU,MAAM,CAGmB;IAEnC;;;;OAIG;IACH,OAHU,MAAM,CAGe;IAE/B;;;;OAIG;IACH,OAHU,MAAM,CAGe;IAE/B;;;;;OAKG;IACH,aAHU,MAAM,CAGmC;IAEnD;;;OAGG;IACH,SAFU,MAAM,CAEgB;IAEhC;;;OAGG;IACH,cAFU,MAAM,CAE0B;IAE1C;;;OAGG;IACH,OAFU,MAAM,CAEO;IAGvB,6CAAoB;IAInB,cAAgB;IAIhB,oBAAsB;IAIvB,kBAA8C;IAG9C,iCAAmD;IAGnD,sBAAwC;IACxC,iBAAmC;IACnC,kBAAqC;IAGrC,eAAoD;IAGpD,cAA8B;IAC9B,eAAgC;IAGhC,qBAA2C;IAwB3C,qBAAwB;IAGzB;;;OAGG;IACH,eAFa,WAAW,CAUvB;IAHC,0LAAuC;IAKzC;;;OAGG;IACH,aAFa,MAAM,CAKlB;IAED;;;;OAIG;IACH,gCA2DC;IAED;;;;;;;;;;;OAWG;IACH,iBATW,SAAS,YACT,OAAO,sBACP,OAAO,QAgFjB;IAED;;;;;;;;;OASG;IACH,qBAJW,OAAO,GAEL,UAAU,EAAE,CAiHxB;IAED;;;OAGG;IACH,aAFa,QAAQ,EAAE,CAMtB;IAED;;OAEG;IACH,gBAKC;CACD;4BAnoB2B,sBAAsB;4BAIzB,yBAAyB;6BAEtB,2BAA2B;sBAhBjC,+BAA+B;4BAe1B,gCAAgC;qBARtC,eAAe"}
|
|
@@ -78,13 +78,22 @@ export default class TMXTileset {
|
|
|
78
78
|
* @default "stretch"
|
|
79
79
|
*/
|
|
80
80
|
fillmode: string;
|
|
81
|
+
/**
|
|
82
|
+
* the point of a tile object from this tileset that sits at its
|
|
83
|
+
* position: "topleft", "top", "topright", "left", "center", "right",
|
|
84
|
+
* "bottomleft", "bottom" or "bottomright". "unspecified" means the
|
|
85
|
+
* bottom left, or the bottom center on an isometric map
|
|
86
|
+
* @type {string}
|
|
87
|
+
* @default "unspecified"
|
|
88
|
+
*/
|
|
89
|
+
objectalignment: string;
|
|
81
90
|
/**
|
|
82
91
|
* Tileset animations
|
|
83
92
|
* @private
|
|
84
93
|
* @type {Map}
|
|
85
94
|
*/
|
|
86
95
|
private animations;
|
|
87
|
-
image:
|
|
96
|
+
image: ImageBitmap | HTMLImageElement | HTMLCanvasElement | undefined;
|
|
88
97
|
texture: any;
|
|
89
98
|
atlas: any;
|
|
90
99
|
/**
|
|
@@ -111,6 +120,13 @@ export default class TMXTileset {
|
|
|
111
120
|
* @returns {object|undefined} tile properties or undefined
|
|
112
121
|
*/
|
|
113
122
|
getTileProperties(tileId: number): object | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* return the class of the specified tile, as set on the tile in Tiled's
|
|
125
|
+
* tileset editor. A tile object with no class of its own is matched by it.
|
|
126
|
+
* @param {number} tileId - global tile ID
|
|
127
|
+
* @returns {string|undefined} the tile's class, or undefined if it has none
|
|
128
|
+
*/
|
|
129
|
+
getTileClass(tileId: number): string | undefined;
|
|
114
130
|
}
|
|
115
131
|
import { Vector2d } from "../../math/vector2d.ts";
|
|
116
132
|
//# sourceMappingURL=TMXTileset.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TMXTileset.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXTileset.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TMXTileset.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXTileset.js"],"names":[],"mappings":"AAgBA;;;GAGG;AACH;IACC;;;;OAIG;IACH,qBAJY,MAAM,iBACN,MAAM,kBACN,MAAM,EAuQjB;IApQA;;;;;OAKG;IACH,gBAJU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAIE;IAE/B;;;;;OAKG;IACH,aAJU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAID;IAE5B;;;;;OAKG;IACH,iBAJU,GAAG,CAAC,MAAM,EAAE,gBAAgB,GAAC,iBAAiB,CAAC,CAIzB;IAEhC;;;OAGG;IACH,UAFU,MAAM,CAEiB;IAEjC;;;OAGG;IACH,SAFU,MAAM,CAEY;IAe5B;;;OAGG;IACH,MAFU,MAAM,CAEQ;IAExB;;;OAGG;IACH,WAFU,MAAM,CAEmB;IAEnC;;;OAGG;IACH,YAFU,MAAM,CAEqB;IAErC;;;;OAIG;IACH,SAHU,MAAM,CAGsB;IAEtC;;;;OAIG;IACH,QAHU,MAAM,CAGoB;IAEpC;;;OAGG;IACH,YAFU,QAAQ,CAEc;IAEhC;;;OAGG;IACH,YAFU,OAAO,CAEM;IAEvB;;;OAGG;IACH,cAFU,OAAO,CAEQ;IAEzB;;;OAGG;IACH,OAFU,MAAM,CAE0B;IAE1C;;;;OAIG;IACH,gBAHU,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AI5B;IAED;;;;;;OAMG;IACH,WALW,MAAM,GACJ,OAAO,CAyBnB;IAED;;;;;;;;OAQG;IACH,mBAPW,QAAQ,MACR,MAAM,MACN,MAAM,WACN,IAAI,QAyFd;IAED;;;;;;;;;;;;;;OAcG;IACH,sBARW,QAAQ,MACR,MAAM,MACN,MAAM,OACN,MAAM,YACN,MAAM,QAmGhB;CACD;yBAp3BwB,wBAAwB;6BAIpB,8BAA8B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TMXUtils.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXUtils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TMXUtils.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXUtils.js"],"names":[],"mappings":"AASA;;;;;;;;;;;GAWG;AACH,2CANW,MAAM,WACN,MAAM,UACN,MAAM,WACN,MAAM,GACJ,MAAM,CAMlB;AAED;;;;;;GAMG;AACH,2CAFW,MAAM,QAchB;AAED;;;;;;;;;;GAUG;AACH,sCAHW,MAAM,GACJ,MAAM,CAOlB;AAED;;;;;;GAMG;AACH,wCAHW,UAAU,WACV,MAAM,QAUhB;AAED;;;;;;;GAOG;AACH,wCAHW,UAAU,aACV,MAAM,QAiBhB;AAED;;;;;;GAMG;AACH,0CAHW,MAAM,GACJ,KAAK,GAAC,SAAS,CAO3B;AAQD;;;;;;;;;;;;;GAaG;AACH,6CALW,gBAAgB,GAAC,iBAAiB,GAAC,WAAW,UAC9C,MAAM,GACJ,gBAAgB,GAAC,iBAAiB,GAAC,WAAW,CAsD1D;AA2UD;;;;GAIG;AACH,2BAHW,QAAQ,GACN,MAAM,CAIlB;AAED;;;;GAIG;AACH,wCAHW,MAAM,QACN,MAAM,QAgDhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../../../../src/level/tiled/factories/shape.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,4CALW,MAAM,GACJ,UAAU,
|
|
1
|
+
{"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../../../../src/level/tiled/factories/shape.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,4CALW,MAAM,GACJ,UAAU,CAoDtB;uBA1DsB,mCAAmC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TMXIsometricRenderer.d.ts","sourceRoot":"","sources":["../../../../src/level/tiled/renderer/TMXIsometricRenderer.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH;;;GAGG;AACH;IACC;;OAEG;IACH,iBAFW,UAAU,EAQpB;IAHA,mBAAoC;IACpC,oBAAsC;IACtC,gBAA0C;IAG3C;;;;OAIG;IACH,+BAEC;IAED;;;;OAIG;IACH,0DASC;IAED;;;;OAIG;IACH,+CAMC;IAED;;;;OAIG;IACH,+CAMC;IAED;;;;;OAKG;IACH,+
|
|
1
|
+
{"version":3,"file":"TMXIsometricRenderer.d.ts","sourceRoot":"","sources":["../../../../src/level/tiled/renderer/TMXIsometricRenderer.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH;;;GAGG;AACH;IACC;;OAEG;IACH,iBAFW,UAAU,EAQpB;IAHA,mBAAoC;IACpC,oBAAsC;IACtC,gBAA0C;IAG3C;;;;OAIG;IACH,+BAEC;IAED;;;;OAIG;IACH,0DASC;IAED;;;;OAIG;IACH,+CAMC;IAED;;;;OAIG;IACH,+CAMC;IAED;;;;;OAKG;IACH,+BAmBC;IAED;;;;OAIG;IACH,4DASC;IAED;;;;;OAKG;IACH,wFAQC;IAED;;;;OAIG;IACH,0DA8HC;CACD;wBAxQuB,kBAAkB;4BAIf,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TMXObliqueRenderer.d.ts","sourceRoot":"","sources":["../../../../src/level/tiled/renderer/TMXObliqueRenderer.js"],"names":[],"mappings":"AAKA;;;;GAIG;AACH;;;;;GAKG;AACH;IAOE;;;OAGG;IACH,OAFU,MAAM,CAEM;IAEtB;;;OAGG;IACH,OAFU,MAAM,CAEM;IAEtB;;;OAGG;IACH,QAFU,MAAM,CAEsD;IAEtE;;;OAGG;IACH,QAFU,MAAM,CAEoD;IAEpE;;;;;OAKG;IACH,MAJU,MAAM,CAIyB;
|
|
1
|
+
{"version":3,"file":"TMXObliqueRenderer.d.ts","sourceRoot":"","sources":["../../../../src/level/tiled/renderer/TMXObliqueRenderer.js"],"names":[],"mappings":"AAKA;;;;GAIG;AACH;;;;;GAKG;AACH;IAOE;;;OAGG;IACH,OAFU,MAAM,CAEM;IAEtB;;;OAGG;IACH,OAFU,MAAM,CAEM;IAEtB;;;OAGG;IACH,QAFU,MAAM,CAEsD;IAEtE;;;OAGG;IACH,QAFU,MAAM,CAEoD;IAEpE;;;;;OAKG;IACH,MAJU,MAAM,CAIyB;CAgN1C;kCAlQiC,4BAA4B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TMXOrthogonalRenderer.d.ts","sourceRoot":"","sources":["../../../../src/level/tiled/renderer/TMXOrthogonalRenderer.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH;;;GAGG;AACH;IACC;;OAEG;IACH,iBAFW,UAAU,EAIpB;IAED;;;;OAIG;IACH,+BAEC;IAED;;;;OAIG;IACH,+CAGC;IAED;;;;OAIG;IACH,+CAGC;IAED;;;;OAIG;IACH,4DASC;IAED;;;;;OAKG;IACH,wFAQC;IAED;;;;OAIG;IACH,
|
|
1
|
+
{"version":3,"file":"TMXOrthogonalRenderer.d.ts","sourceRoot":"","sources":["../../../../src/level/tiled/renderer/TMXOrthogonalRenderer.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH;;;GAGG;AACH;IACC;;OAEG;IACH,iBAFW,UAAU,EAIpB;IAED;;;;OAIG;IACH,+BAEC;IAED;;;;OAIG;IACH,+CAGC;IAED;;;;OAIG;IACH,+CAGC;IAED;;;;OAIG;IACH,4DASC;IAED;;;;;OAKG;IACH,wFAQC;IAED;;;;OAIG;IACH,0DAmFC;CACD;wBAxKuB,kBAAkB;4BAIf,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TMXRenderer.d.ts","sourceRoot":"","sources":["../../../../src/level/tiled/renderer/TMXRenderer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TMXRenderer.d.ts","sourceRoot":"","sources":["../../../../src/level/tiled/renderer/TMXRenderer.js"],"names":[],"mappings":"AAkBA;;;;;;;;;GASG;AACH;;;GAGG;AACH;IACC;;;;;OAKG;IACH,kBALW,MAAM,QACN,MAAM,aACN,MAAM,cACN,MAAM,EAQhB;IALA,aAAgB;IAChB,aAAgB;IAChB,kBAA0B;IAC1B,mBAA4B;IAC5B,eAA0B;IAG3B;;;;OAIG;IACH,qBAHW,UAAU,GAAC,QAAQ,GACjB,OAAO,CAanB;IAED;;;;OAIG;IACH,kBAHW,QAAQ,GACN,MAAM,CAWlB;IAED;;;;;;OAMG;IACH,qBALW,MAAM,KACN,MAAM,MACN,QAAQ,GACN,QAAQ,CAIpB;IAED;;;;;;OAMG;IACH,uBALW,MAAM,OACN,MAAM,MACN,QAAQ,GACN,QAAQ,CAIpB;IAED;;;;OAIG;IACH,oBAFW,MAAM,QAOhB;IAED;;;;;;;;OAQG;IACH,qBALW,MAAM,YACN,MAAM,QAqBhB;IAED;;;;;;OAMG;IAEH,mBANW,QAAQ,KACR,MAAM,KACN,MAAM,QACN,IAAI,QAGkB;IAEjC;;;;;OAKG;IAEH,wBALW,QAAQ,SACR,QAAQ,QACR,IAAI,QAGwB;CACvC;uBAjKkC,8BAA8B;4BAsBtC,kBAAkB;qBArBxB,kBAAkB;8BAuBZ,2BAA2B;0BAE7B,4BAA4B;sBAHhC,eAAe;0BAFb,kCAAkC"}
|
|
@@ -176,6 +176,36 @@ export default class Light2d extends Renderable {
|
|
|
176
176
|
*/
|
|
177
177
|
get centerY(): number;
|
|
178
178
|
set centerY(value: number);
|
|
179
|
+
/**
|
|
180
|
+
* How soft the edge of this light's hole in the stage's ambient darkness
|
|
181
|
+
* ({@link Stage#ambientLight}) is, from `0` to `1`. The light only cuts
|
|
182
|
+
* that darkness; its glow, and the shading of normal-mapped sprites, are
|
|
183
|
+
* unaffected.
|
|
184
|
+
*
|
|
185
|
+
* - `0` (the default): a hard edge. Inside the light's radius the darkness
|
|
186
|
+
* is gone, outside it is whole.
|
|
187
|
+
* - `1`: the darkness thins out from the edge all the way to the center,
|
|
188
|
+
* along the same straight falloff as the glow.
|
|
189
|
+
* - In between: a fully lit core of `1 - softness` of the radius, then the
|
|
190
|
+
* darkness comes back over the rest of it.
|
|
191
|
+
*
|
|
192
|
+
* Hard and soft lights mix in one scene, and where lights overlap, the
|
|
193
|
+
* darkness left is what each of them leaves, multiplied. The hole has the
|
|
194
|
+
* light's size: for an opening wider than a glow, add a second, bigger
|
|
195
|
+
* light with {@link Light2d#illuminationOnly} set, which cuts the darkness
|
|
196
|
+
* and draws nothing. Up to 32 soft-path lights in view at once are cut.
|
|
197
|
+
* @default 0
|
|
198
|
+
* @throws {TypeError} if set to anything but a number from 0 to 1
|
|
199
|
+
* @example
|
|
200
|
+
* // a torch whose light fades into the dark, rather than a hole with a hard rim
|
|
201
|
+
* const torch = new Light2d(x, y, 200, 200, "#ffb46a", 0.4);
|
|
202
|
+
* torch.softness = 0.8;
|
|
203
|
+
* app.world.addChild(torch);
|
|
204
|
+
* // the darkness it cuts (on your Stage)
|
|
205
|
+
* this.ambientLight.parseCSS("rgba(4, 3, 10, 0.95)");
|
|
206
|
+
*/
|
|
207
|
+
get softness(): number;
|
|
208
|
+
set softness(value: number);
|
|
179
209
|
/**
|
|
180
210
|
* Set new radii for this light.
|
|
181
211
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"light2d.d.ts","sourceRoot":"","sources":["../../src/lighting/light2d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE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OG;IACH,SAAS,EAAE,MAAM,CAAC;IAUlB;;;;;;;;;;;;;;;;OAgBG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAE1B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,WAAW,EAAE,MAAM,CAAC;IASpB;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;gBAEF,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,MAAgB,EACzB,KAAK,GAAE,KAAK,GAAG,MAAe,EAC9B,SAAS,GAAE,MAAY;IAyCxB;;;;;OAKG;IACH,IAAa,OAAO,IAAI,MAAM,CAE7B;IACD,IAAa,OAAO,CAAC,KAAK,EAAE,MAAM,EAIjC;IAED;;;OAGG;IACH,IAAa,OAAO,IAAI,MAAM,CAE7B;IACD,IAAa,OAAO,CAAC,KAAK,EAAE,MAAM,EAIjC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,IAAI,QAAQ,IAAI,MAAM,CAErB;IACD,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAYzB;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,MAAgB;IAMnD;;;;;OAKG;IACH,cAAc,IAAI,OAAO;IAOzB;;;OAGG;IACM,MAAM,IAAI,OAAO;IAI1B;;;OAGG;IACM,OAAO,CAAC,QAAQ,EAAE,cAAc,GAAG,aAAa;IAKzD;;;;;;;;OAQG;IACM,IAAI,CAAC,QAAQ,EAAE,cAAc,GAAG,aAAa;CAyCtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/particles/emitter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/particles/emitter.ts"],"names":[],"mappings":"AAIA,OAAO,SAAS,MAAM,8BAA8B,CAAC;AAMrD,OAA+B,EAC9B,KAAK,uBAAuB,EAC5B,MAAM,eAAe,CAAC;AAuKvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,SAAS;;IACrD;;OAEG;IACH,QAAQ,EAAE,uBAAuB,CAAC;IA2IlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;gBAEF,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,QAAQ,GAAE,OAAO,CAAC,uBAAuB,CAAM;IAwCvC,KAAK,CAAC,QAAQ,GAAE,OAAO,CAAC,uBAAuB,CAAM,GAAG,IAAI;IA4DrE;;;;;;;;;;;OAWG;IACH,IAAI,cAAc,IAAI,OAAO,GAAG,OAAO,GAAG,SAAS,CAElD;IAED,IAAI,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,EAQtD;IAyHD;;;OAGG;IACH,eAAe,IAAI,MAAM;IAIzB;;;OAGG;IACH,eAAe,IAAI,MAAM;IAuEzB;;;OAGG;IACH,SAAS,IAAI,OAAO;IAIpB;;;OAGG;IACH,eAAe,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI;IAQxC;;OAEG;IACH,UAAU,IAAI,IAAI;IAIlB;;;OAGG;IACH,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;CAuJpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"particle.d.ts","sourceRoot":"","sources":["../../src/particles/particle.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"particle.d.ts","sourceRoot":"","sources":["../../src/particles/particle.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAgB,MAAM,qBAAqB,CAAC;AAE7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAGnD,OAAO,UAAU,MAAM,6BAA6B,CAAC;AAIrD,OAAO,eAAe,MAAM,cAAc,CAAC;AAU3C;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,UAAU;;IAC/C;;;;;;;;OAQG;IACH,GAAG,EAAE,QAAQ,CAAC;IACd;;;;;;;OAOG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,iBAAiB,GAAG,gBAAgB,CAAC;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IAqBxB,KAAK,EAAE,OAAO,CAAC;IACf,cAAc;IACd,OAAO,CAAC,OAAO,CAAuD;IAQtE,cAAc;IACd,OAAO,CAAC,WAAW,CAAS;IAC5B,cAAc;IACd,OAAO,CAAC,cAAc,CAAU;IAEhC;;OAEG;gBACS,OAAO,EAAE,eAAe;IAqd3B,YAAY,CAAC,QAAQ,UAAO;CAqHrC;AAED,eAAO,MAAM,YAAY,kEAWxB,CAAC"}
|
|
@@ -70,8 +70,33 @@ export interface ParticleEmitterSettings {
|
|
|
70
70
|
/**
|
|
71
71
|
* Tint to be applied to particles.
|
|
72
72
|
* @default "#fff"
|
|
73
|
+
* @see {@link tintOverLife} for a tint that changes over each particle's life
|
|
73
74
|
*/
|
|
74
75
|
tint: string;
|
|
76
|
+
/**
|
|
77
|
+
* The tints a particle takes over its life: the first at birth, the last
|
|
78
|
+
* at the end, evenly spaced and blended in between, such as a flame that
|
|
79
|
+
* starts white hot and dies deep red. Give as many CSS colors as you like
|
|
80
|
+
* (one is a plain tint), and repeat a color to hold it longer. When set,
|
|
81
|
+
* it replaces {@link tint}.
|
|
82
|
+
* <br><br>
|
|
83
|
+
* It changes the color only: a particle still fades out over its life,
|
|
84
|
+
* and the alpha of a color given here is ignored. However many colors
|
|
85
|
+
* there are, the blend is taken in 32 steps, the same on every renderer,
|
|
86
|
+
* so a particle changes color at most 32 times; on the Canvas renderer,
|
|
87
|
+
* which keeps a tinted copy of the texture per color, that bounds the
|
|
88
|
+
* copies to 32.
|
|
89
|
+
* <br><br>
|
|
90
|
+
* Set it through the constructor or {@link ParticleEmitter#reset}.
|
|
91
|
+
* @default undefined
|
|
92
|
+
* @throws {TypeError} from the emitter, if not a non-empty array of strings
|
|
93
|
+
* @example
|
|
94
|
+
* new ParticleEmitter(x, y, {
|
|
95
|
+
* image: spark,
|
|
96
|
+
* tintOverLife: ["#fff3b0", "#ffb04a", "#e45414", "#501408"],
|
|
97
|
+
* });
|
|
98
|
+
*/
|
|
99
|
+
tintOverLife?: readonly string[] | undefined;
|
|
75
100
|
/**
|
|
76
101
|
* Total number of particles in the emitter.
|
|
77
102
|
* @default 50
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/particles/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,eAAe,MAAM,cAAc,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACvC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,KAAK,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,SAAS,CAAC;IAExD;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEhC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;IAEvC;;;;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;;;;;OAOG;IACH,UAAU,EAAE,CAAC,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;CAC1D;AAED;;;GAGG;AACH,QAAA,MAAM,8BAA8B,EAAE,uBA2CrC,CAAC;AAEF,eAAe,8BAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"raycast.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/raycast.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"raycast.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/raycast.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AAiLrC,wBAAgB,YAAY,CAC3B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACT,UAAU,EAAE,CAoHd"}
|
|
@@ -1,2 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* How far a renderable's drawn frame sits from its `pos`, per axis.
|
|
3
|
+
*
|
|
4
|
+
* `anchorPoint` moves where a renderable DRAWS: `updateBounds()` shifts its
|
|
5
|
+
* bounds by `-size * anchorPoint` and `preDraw` shifts its pixels by the same
|
|
6
|
+
* amount. Collision shapes have to be measured from that same corner, or the
|
|
7
|
+
* hitbox ends up somewhere the artwork is not.
|
|
8
|
+
*
|
|
9
|
+
* Zero whenever the anchor is (0, 0) — which is what `Entity` and Tiled
|
|
10
|
+
* objects set — so every legacy path is bit-for-bit unchanged.
|
|
11
|
+
*
|
|
12
|
+
* Also zero when the renderable opts out of the offset altogether via
|
|
13
|
+
* `applyAnchorTransform === false`, which is the flag `preDraw` itself reads:
|
|
14
|
+
* a {@link GLTFModel}, and a {@link Mesh} on the `Camera3d` world-space path,
|
|
15
|
+
* place themselves by their own transform and draw at `pos` with no anchor
|
|
16
|
+
* shift at all. Reading the anchor for those moved their shapes off the model
|
|
17
|
+
* by half its bounds box, and because a scene sizes that box per node, two
|
|
18
|
+
* objects that overlap on screen were pushed apart by DIFFERENT amounts and
|
|
19
|
+
* stopped colliding entirely.
|
|
20
|
+
*
|
|
21
|
+
* Guarded on `Number.isFinite` exactly as `preDraw` is: a `Container`'s
|
|
22
|
+
* default size is `Infinity`, and `Infinity * 0` is `NaN`, which would poison
|
|
23
|
+
* every position derived from it.
|
|
24
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} r - the renderable
|
|
25
|
+
* @returns {number} the x offset to subtract
|
|
26
|
+
* @ignore
|
|
27
|
+
*/
|
|
28
|
+
export function anchorOffsetX(r: Renderable | Container | Entity | Sprite | NineSliceSprite): number;
|
|
29
|
+
/**
|
|
30
|
+
* The y half of {@link anchorOffsetX}.
|
|
31
|
+
* @param {Renderable|Container|Entity|Sprite|NineSliceSprite} r - the renderable
|
|
32
|
+
* @returns {number} the y offset to subtract
|
|
33
|
+
* @ignore
|
|
34
|
+
*/
|
|
35
|
+
export function anchorOffsetY(r: Renderable | Container | Entity | Sprite | NineSliceSprite): number;
|
|
36
|
+
import type Renderable from "../../renderable/renderable.js";
|
|
37
|
+
import type Container from "../../renderable/container.js";
|
|
38
|
+
import type Entity from "../../renderable/entity/entity.js";
|
|
39
|
+
import type Sprite from "../../renderable/sprite.js";
|
|
40
|
+
import type NineSliceSprite from "../../renderable/nineslicesprite.js";
|
|
2
41
|
//# sourceMappingURL=sat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sat.d.ts","sourceRoot":"","sources":["../../../src/physics/builtin/sat.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sat.d.ts","sourceRoot":"","sources":["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7,6 +7,13 @@
|
|
|
7
7
|
export interface AnimationOptions {
|
|
8
8
|
/** called when the animation completes a cycle (each loop, or once if `loop: false`). */
|
|
9
9
|
onComplete?: (() => unknown) | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* called with the index of each frame as playback reaches it, from frame 0
|
|
12
|
+
* when the animation starts, and again at the start of each cycle. Frame
|
|
13
|
+
* animations only (a {@link Sprite}, a {@link Sprite3d}): a {@link Mesh}
|
|
14
|
+
* keyframe animation has no frames, and never calls it.
|
|
15
|
+
*/
|
|
16
|
+
onFrame?: ((frame: number) => unknown) | undefined;
|
|
10
17
|
/** name of an animation to switch to when this one finishes. */
|
|
11
18
|
next?: string | undefined;
|
|
12
19
|
/** loop forever (default) or play once and hold the last frame. */
|
|
@@ -27,6 +34,8 @@ export interface AnimationOptions {
|
|
|
27
34
|
export type AnimationOptionsInput = string | (() => unknown) | {
|
|
28
35
|
/** called when the animation completes a cycle */
|
|
29
36
|
onComplete?: () => unknown;
|
|
37
|
+
/** called with the index of each frame as playback reaches it (frame animations only) */
|
|
38
|
+
onFrame?: (frame: number) => unknown;
|
|
30
39
|
/** name of an animation to switch to when this one finishes */
|
|
31
40
|
next?: string;
|
|
32
41
|
/** loop forever (default) or play once and hold the last frame */
|
|
@@ -40,7 +49,7 @@ export type AnimationOptionsInput = string | (() => unknown) | {
|
|
|
40
49
|
* - `undefined` → loop forever
|
|
41
50
|
* - a `string` → the name of the next animation to chain to
|
|
42
51
|
* - a `function` → legacy completion callback (return `false` to hold the last frame)
|
|
43
|
-
* - an options object → `{ onComplete, next, loop, speed }`
|
|
52
|
+
* - an options object → `{ onComplete, onFrame, next, loop, speed }`
|
|
44
53
|
* @param arg - the second argument passed to `setCurrentAnimation`
|
|
45
54
|
* @returns the normalized options
|
|
46
55
|
* @category Animation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/renderable/animation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAChC,yFAAyF;IACzF,UAAU,CAAC,EAAE,CAAC,MAAM,OAAO,CAAC,GAAG,SAAS,CAAC;IACzC,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,mEAAmE;IACnE,IAAI,EAAE,OAAO,CAAC;IACd,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;CASd;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,qBAAqB,GAC9B,MAAM,GACN,CAAC,MAAM,OAAO,CAAC,GACf;IACA,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;IAC3B,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEL;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACpC,GAAG,CAAC,EACD,qBAAqB,GAGrB,IAAI,GACL,gBAAgB,
|
|
1
|
+
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/renderable/animation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAChC,yFAAyF;IACzF,UAAU,CAAC,EAAE,CAAC,MAAM,OAAO,CAAC,GAAG,SAAS,CAAC;IACzC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,SAAS,CAAC;IACnD,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,mEAAmE;IACnE,IAAI,EAAE,OAAO,CAAC;IACd,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;CASd;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,qBAAqB,GAC9B,MAAM,GACN,CAAC,MAAM,OAAO,CAAC,GACf;IACA,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC;IAC3B,yFAAyF;IACzF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;IACrC,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEL;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACpC,GAAG,CAAC,EACD,qBAAqB,GAGrB,IAAI,GACL,gBAAgB,CAkBlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorlayer.d.ts","sourceRoot":"","sources":["../../src/renderable/colorlayer.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH;;;GAGG;AACH;IACC;;;;OAIG;IACH,kBAJW,MAAM,SACN,KAAK,GAAC,MAAM,MACZ,MAAM,EAahB;IAPA;;;OAGG;IACH,OAFU,KAAK,CAE6B;IAK7C,sDAYC;IAED;;;;OAIG;IACH,eAHW,QAAQ,aACR,QAAQ,
|
|
1
|
+
{"version":3,"file":"colorlayer.d.ts","sourceRoot":"","sources":["../../src/renderable/colorlayer.js"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH;;;GAGG;AACH;IACC;;;;OAIG;IACH,kBAJW,MAAM,SACN,KAAK,GAAC,MAAM,MACZ,MAAM,EAahB;IAPA;;;OAGG;IACH,OAFU,KAAK,CAE6B;IAK7C,sDAYC;IAED;;;;OAIG;IACH,eAHW,QAAQ,aACR,QAAQ,QAWlB;IAED;;;;OAIG;IACH,gBAIC;CACD;AAED;;;;;;;;;;;GAWG;AACH,iHAQG;uBAhG8C,iBAAiB;2BAI1C,oBAAoB;0BAInB,sBAAsB;0BADtB,yBAAyB"}
|