melonjs 20.13.0 → 20.14.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 +65 -22
- package/build/application/application.d.ts +6 -1
- package/build/application/application.d.ts.map +1 -1
- package/build/application/header.d.ts.map +1 -1
- package/build/application/resize.d.ts.map +1 -1
- package/build/application/settings.d.ts +13 -8
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/audio.d.ts +8 -4
- package/build/audio/audio.d.ts.map +1 -1
- package/build/audio/backend/engine.d.ts.map +1 -1
- package/build/audio/playback.d.ts +2 -2
- package/build/audio/playback.d.ts.map +1 -1
- package/build/audio/spatial.d.ts.map +1 -1
- package/build/audio/types.d.ts +15 -5
- package/build/audio/types.d.ts.map +1 -1
- package/build/camera/camera2d.d.ts +10 -9
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/camera/camera3d.d.ts +11 -8
- package/build/camera/camera3d.d.ts.map +1 -1
- package/build/geometries/path2d.d.ts +9 -8
- package/build/geometries/path2d.d.ts.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +40993 -39738
- package/build/index.js.map +4 -4
- package/build/input/keyboard.d.ts.map +1 -1
- package/build/input/pointerevent.d.ts.map +1 -1
- package/build/level/gltf/GLTFModel.d.ts.map +1 -1
- package/build/level/level.d.ts.map +1 -1
- package/build/level/tiled/TMXLayer.d.ts +2 -1
- package/build/level/tiled/TMXLayer.d.ts.map +1 -1
- package/build/level/tiled/TMXTileMap.d.ts +13 -3
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
- package/build/level/tiled/TMXTileset.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +1 -0
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXRenderer.d.ts +7 -3
- package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
- package/build/lighting/light3d.d.ts +55 -0
- package/build/lighting/light3d.d.ts.map +1 -1
- package/build/loader/cache.d.ts +146 -97
- package/build/loader/cache.d.ts.map +1 -1
- package/build/loader/internal-types.d.ts +69 -0
- package/build/loader/internal-types.d.ts.map +1 -0
- package/build/loader/loader.d.ts +584 -292
- package/build/loader/loader.d.ts.map +1 -1
- package/build/loader/parsers/audio.d.ts.map +1 -1
- package/build/loader/parsers/fontface.d.ts.map +1 -1
- package/build/loader/parsers/gltf.d.ts.map +1 -1
- package/build/loader/parsers/tmx.d.ts.map +1 -1
- package/build/math/color.d.ts +4 -0
- package/build/math/color.d.ts.map +1 -1
- package/build/math/noise.d.ts +16 -16
- package/build/math/noise.d.ts.map +1 -1
- package/build/physics/adapter.d.ts +64 -25
- package/build/physics/adapter.d.ts.map +1 -1
- package/build/physics/builtin/body.d.ts +9 -0
- package/build/physics/builtin/body.d.ts.map +1 -1
- package/build/physics/builtin/builtin-adapter.d.ts +25 -3
- package/build/physics/builtin/builtin-adapter.d.ts.map +1 -1
- package/build/physics/builtin/detector.d.ts.map +1 -1
- package/build/physics/builtin/raycast.d.ts.map +1 -1
- package/build/physics/world.d.ts +40 -10
- package/build/physics/world.d.ts.map +1 -1
- package/build/renderable/container.d.ts +1 -0
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/draggable.d.ts.map +1 -1
- package/build/renderable/frameAnimation.d.ts.map +1 -1
- package/build/renderable/instanced_mesh.d.ts +16 -14
- package/build/renderable/instanced_mesh.d.ts.map +1 -1
- package/build/renderable/mesh.d.ts +62 -5
- package/build/renderable/mesh.d.ts.map +1 -1
- package/build/renderable/trigger.d.ts +5 -0
- package/build/renderable/trigger.d.ts.map +1 -1
- package/build/renderable/ui/uibaseelement.d.ts +8 -1
- package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
- package/build/renderable/ui/uicheckbox.d.ts.map +1 -1
- package/build/system/device.d.ts +11 -2
- package/build/system/device.d.ts.map +1 -1
- package/build/system/fullscreen.d.ts.map +1 -1
- package/build/system/pool.d.ts.map +1 -1
- package/build/utils/utils.d.ts.map +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +16 -14
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/canvas_factory.d.ts.map +1 -1
- package/build/video/effects/shadereffect.d.ts +127 -0
- package/build/video/effects/shadereffect.d.ts.map +1 -1
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/webgl/batchers/lit_mesh_batcher.d.ts.map +1 -1
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts.map +1 -1
- package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/package.json +1 -1
- package/skills/melonjs/SKILL.md +38 -14
- package/skills/melonjs-20-migration/SKILL.md +50 -7
- package/skills/melonjs-3d/SKILL.md +138 -38
- package/skills/melonjs-3d-assets/SKILL.md +83 -33
- package/skills/melonjs-audio/SKILL.md +55 -14
- package/skills/melonjs-camera-and-drawing/SKILL.md +95 -8
- package/skills/melonjs-deployment/SKILL.md +92 -14
- package/skills/melonjs-display-and-scaling/SKILL.md +8 -3
- package/skills/melonjs-effects-and-shaders/SKILL.md +46 -15
- package/skills/melonjs-events/SKILL.md +3 -2
- package/skills/melonjs-getting-started/SKILL.md +5 -0
- package/skills/melonjs-input/SKILL.md +65 -15
- package/skills/melonjs-lighting/SKILL.md +13 -1
- package/skills/melonjs-loading-assets/SKILL.md +202 -27
- package/skills/melonjs-math/SKILL.md +12 -5
- package/skills/melonjs-particles-and-trails/SKILL.md +7 -3
- package/skills/melonjs-performance/SKILL.md +18 -8
- package/skills/melonjs-physics/SKILL.md +385 -127
- package/skills/melonjs-plugins/SKILL.md +45 -11
- package/skills/melonjs-renderables/SKILL.md +24 -7
- package/skills/melonjs-renderer-backends/SKILL.md +38 -17
- package/skills/melonjs-scenes-and-state/SKILL.md +30 -5
- package/skills/melonjs-sprites-and-animation/SKILL.md +23 -2
- package/skills/melonjs-tilemaps/SKILL.md +56 -18
- package/skills/melonjs-ui-and-text/SKILL.md +120 -25
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../src/input/keyboard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../src/input/keyboard.ts"],"names":[],"mappings":"AAyGA;;GAEG;AACH,eAAO,MAAM,mBAAmB,MAAO,CAAC;AAExC,wBAAgB,iBAAiB,SAahC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,WAQ1C;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,WAEvC;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC9B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,OAAO,EACf,WAAW,CAAC,EAAE,MAAM,QAIpB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO,GACnB,SAAS,MAAM,EACf,QAAQ,MAAM,EACd,OAAO,OAAO,EACd,wBAAqC,SASrC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,UAE5C;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,QAEvC;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,QASxC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pointerevent.d.ts","sourceRoot":"","sources":["../../src/input/pointerevent.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"pointerevent.d.ts","sourceRoot":"","sources":["../../src/input/pointer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QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,GAAG,IAAI,GAC7C,IAAI,CAiCN;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAMzD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAO5C;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAMzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GLTFModel.d.ts","sourceRoot":"","sources":["../../../src/level/gltf/GLTFModel.js"],"names":[],"mappings":"AA+DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH;IACC;;;;;;;;;;;;;;;;OAgBG;IACH,kBAhBW,OAAO,8BAA8B,EAAE,QAAQ,YAEvD;QAAyB,KAAK;QACJ,WAAW;QACX,GAAG;QACH,gBAAgB;QACjB,aAAa;QACb,aAAa;QACb,WAAW;QACX,YAAY;QACZ,aAAa;QACb,gBAAgB;QAChB,gBAAgB;QACL,kBAAkB;QAC5B,WAAW;KACvC,
|
|
1
|
+
{"version":3,"file":"GLTFModel.d.ts","sourceRoot":"","sources":["../../../src/level/gltf/GLTFModel.js"],"names":[],"mappings":"AA+DA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH;IACC;;;;;;;;;;;;;;;;OAgBG;IACH,kBAhBW,OAAO,8BAA8B,EAAE,QAAQ,YAEvD;QAAyB,KAAK;QACJ,WAAW;QACX,GAAG;QACH,gBAAgB;QACjB,aAAa;QACb,aAAa;QACb,WAAW;QACX,YAAY;QACZ,aAAa;QACb,gBAAgB;QAChB,gBAAgB;QACL,kBAAkB;QAC5B,WAAW;KACvC,EAuSA;IAnSA;;;;;;;;OAQG;IACH,aAJU,MAAM,CAIqB;IAGrC;;;OAGG;IACH,eAAoD;IA0CpD;;;;OAIG;IACH,YAA8B;IAC9B;;;;OAIG;IACH,YA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3,"file":"level.d.ts","sourceRoot":"","sources":["../../src/level/level.js"],"names":[],"mappings":"AA4GA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,iCALU,aAAa,CAAC,MAAM,CAAC,CAY5B;;IAQF;;;;;;;OAOG;IACH,qBALW,MAAM,WACN,MAAM,wBAEJ,OAAO,CAkCnB;;;;;;;;;;;;;;;;;;;IAUE,uBACQ,MAAM,WACN,gBAAgB,GAAG;QAAE,KAAK,EAAE,IAAI,CAAA;KAAE,GAChC,OAAO,CAAC,OAAO,CAAC,CAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAiBA,uBACQ,MAAM;gBACuB,KAAK;qBAChC,OAAO,CACjB;IA4FH;;;;OAIG;IACH,8BAFa,MAAM,CAIlB;IAED;;;;;;OAMG;IACH,4BAFa,UAAU,GAAC,SAAS,CAIhC;;;;;;;;;;;IAKE,yBACQ,gBAAgB,GAAG;QAAE,KAAK,EAAE,IAAI,CAAA;KAAE,GAChC,OAAO,CAAC,OAAO,CAAC,CAC1B;;;;;;;;;;;IASA;gBACqC,KAAK;qBAChC,OAAO,CACjB;;;;;;;;;;;;;;;IAoBA,uBACQ,gBAAgB,GAAG;QAAE,KAAK,EAAE,IAAI,CAAA;KAAE,GAChC,OAAO,CAAC,OAAO,CAAC,CAC1B;;;;;;;;;;;;;;;IAaA;gBACqC,KAAK;qBAChC,OAAO,CACjB;;;;;;;;;;;;;;;IAsBA,2BACQ,gBAAgB,GAAG;QAAE,KAAK,EAAE,IAAI,CAAA;KAAE,GAChC,OAAO,CAAC,OAAO,CAAC,CAC1B;;;;;;;;;;;;;;;IAaA;gBACqC,KAAK;qBAChC,OAAO,CACjB;IAeH;;;;OAIG;IACH,uBAFa,MAAM,CAIlB;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"level.d.ts","sourceRoot":"","sources":["../../src/level/level.js"],"names":[],"mappings":"AA4GA;;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,OAAO;;;;aACP,OAAO;;;;0BACP,MAAM;;;;uBACN,OAAO;;;;oBACP,MAAM;;;;oBACN,MAAM;;;;kBACN,MAAM;;;;mBACN,MAAM;;;;oBACN,MAAM;;;;uBACN,MAAM;;;;uBACN,MAAM;;;;yBACN,MAAM,EAAE,GAAC,QAAQ;;;;kBACjB,OAAO;;uBArIE,uBAAuB;sBADxB,qBAAqB;2BAKjB,4BAA4B;8BAG3B,qBAAqB;6BADtB,wBAAwB"}
|
|
@@ -51,7 +51,8 @@ export default class TMXLayer extends Renderable {
|
|
|
51
51
|
isAnimated: boolean;
|
|
52
52
|
/**
|
|
53
53
|
* the order in which tiles on orthogonal tile layers are rendered.
|
|
54
|
-
* (valid values are "left-down", "left-up", "right-down", "right-up")
|
|
54
|
+
* (valid values are "left-down", "left-up", "right-down", "right-up").
|
|
55
|
+
* Tiled sets it on the map, which every layer follows
|
|
55
56
|
* @type {string}
|
|
56
57
|
* @default "right-down"
|
|
57
58
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TMXLayer.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXLayer.js"],"names":[],"mappings":"AAsJA;;;;GAIG;AACH;IACC;;;;;;;;OAQG;IACH,iBARW,MAAM,QACN,MAAM,aACN,MAAM,cACN,MAAM,eACN,MAAM,YACN,eAAe,KACf,MAAM,
|
|
1
|
+
{"version":3,"file":"TMXLayer.d.ts","sourceRoot":"","sources":["../../../src/level/tiled/TMXLayer.js"],"names":[],"mappings":"AAsJA;;;;GAIG;AACH;IACC;;;;;;;;OAQG;IACH,iBARW,MAAM,QACN,MAAM,aACN,MAAM,cACN,MAAM,eACN,MAAM,YACN,eAAe,KACf,MAAM,EAkPhB;IA3OA,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;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JW,MAAM,KACN,MAAM,GACJ,MAAM,CAKlB;IAED;;;;;;;;;;;OAWG;IACH,WAVW,MAAM,KACN,MAAM,GACJ,IAAI,CAqBhB;IAED;;;;;;;OAOG;IACH,cALW,IAAI,KACJ,MAAM,KACN,MAAM,GACJ,IAAI,CAgChB;IAED;;;;;;;;;;OAUG;IACH,oBATW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,IAAI,CAYhB;IAED;;;;;;;;;OASG;IACH,UARW,MAAM,KACN,MAAM,gBACN,MAAM,GACJ,IAAI,CAmDhB;IAED;;;;;;;;;OASG;IACH,aARW,MAAM,KACN,MAAM,QA0BhB;IAED;;;;OAIG;IACH,yBAQC;IAED;;;;OAIG;IACH,qCAsCC;CACD;uBAv9BsB,gCAAgC;iCAgBvB,sBAAsB;4BAD3B,iBAAiB;iBAN3B,cAAc;8BAQJ,wBAAwB;2BAhBxB,oCAAoC;6BAanC,2BAA2B"}
|
|
@@ -99,8 +99,6 @@ export default class TMXTileMap {
|
|
|
99
99
|
staggeraxis: any;
|
|
100
100
|
staggerindex: any;
|
|
101
101
|
bounds: Bounds;
|
|
102
|
-
width: number;
|
|
103
|
-
height: number;
|
|
104
102
|
backgroundcolor: any;
|
|
105
103
|
initialized: boolean;
|
|
106
104
|
/**
|
|
@@ -110,7 +108,19 @@ export default class TMXTileMap {
|
|
|
110
108
|
getRenderer(): TMXRenderer;
|
|
111
109
|
renderer: import("./renderer/TMXHexagonalRenderer.js").default | import("./renderer/TMXIsometricRenderer.js").default | import("./renderer/TMXOrthogonalRenderer.js").default | undefined;
|
|
112
110
|
/**
|
|
113
|
-
*
|
|
111
|
+
* the map's width in pixels: its bounds' width (see {@link TMXTileMap#getBounds})
|
|
112
|
+
* @type {number}
|
|
113
|
+
*/
|
|
114
|
+
get width(): number;
|
|
115
|
+
/**
|
|
116
|
+
* the map's height in pixels: its bounds' height (see {@link TMXTileMap#getBounds})
|
|
117
|
+
* @type {number}
|
|
118
|
+
*/
|
|
119
|
+
get height(): number;
|
|
120
|
+
/**
|
|
121
|
+
* return the map bounding rect: the area its tiles are drawn in. On an
|
|
122
|
+
* infinite map, the map's own area grown to every painted tile, which can
|
|
123
|
+
* start left of or above 0
|
|
114
124
|
* @returns {Bounds}
|
|
115
125
|
*/
|
|
116
126
|
getBounds(): Bounds;
|
|
@@ -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":"AAgOA;;;;GAIG;AACH;IACC;;;;;;;;;;;OAWG;IACH,oBAJU,aAAa,CAAC,MAAM,CAAC,CAIsC;IAErE;;;;;;;;OAQG;IACH,qBARW,MAAM,QACN,MAAM,EAgKhB;IAxJA;;;;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;IAM9C,qBAA0E;IAG1E,sBAAwC;IACxC,iBAAmC;IACnC,kBAAqC;IAGrC,eAAoD;IAGpD,qBAA2C;IAwB3C,qBAAwB;IAGzB;;;OAGG;IACH,eAFa,WAAW,CAUvB;IAHC,0LAAuC;IAKzC;;;OAGG;IACH,aAFU,MAAM,CAIf;IAED;;;OAGG;IACH,cAFU,MAAM,CAIf;IAED;;;;;OAKG;IACH,aAFa,MAAM,CASlB;IAED;;;;OAIG;IACH,gCAiEC;IAED;;;;;OAKG;IACH,4BA8BC;IAED;;;;;;;;;;;OAWG;IACH,iBATW,SAAS,YACT,OAAO,sBACP,OAAO,QAiFjB;IAED;;;;;;;;;OASG;IACH,qBAJW,OAAO,GAEL,UAAU,EAAE,CAiHxB;IAED;;;OAGG;IACH,aAFa,QAAQ,EAAE,CAMtB;IAED;;OAEG;IACH,gBAKC;CACD;4BA1wB2B,sBAAsB;4BAIzB,yBAAyB;6BAEtB,2BAA2B;sBAhBjC,+BAA+B;4BAe1B,gCAAgC;qBARtC,eAAe"}
|
|
@@ -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":"AAiBA;;;GAGG;AACH;IACC;;;;OAIG;IACH,qBAJY,MAAM,iBACN,MAAM,kBACN,MAAM,EA+QjB;IA5QA;;;;;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,MA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,iBAAiB,GAAC,SAAS,CAIxD;IAED;;;;;;;OAOG;IACH,uBAJa,YAAY,CAyCxB;IANC,4CAGC;IAKH;;;;;;OAMG;IACH,qBALW,MAAM,QACN,MAAM,QAMhB;IAED;;;;OAIG;IACH,cAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;OAIG;IACH,mBAHW,MAAM,GACJ,MAAM,CAYlB;IAED;;;;OAIG;IACH,0BAHW,MAAM,GACJ,MAAM,GAAC,SAAS,CAI5B;IAED;;;;;OAKG;IACH,qBAHW,MAAM,GACJ,MAAM,GAAC,SAAS,CAI5B;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;yBA74BwB,wBAAwB;6BAKpB,8BAA8B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TMXHexagonalRenderer.d.ts","sourceRoot":"","sources":["../../../../src/level/tiled/renderer/TMXHexagonalRenderer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TMXHexagonalRenderer.d.ts","sourceRoot":"","sources":["../../../../src/level/tiled/renderer/TMXHexagonalRenderer.js"],"names":[],"mappings":"AAsBA;;;GAGG;AACH;IACC;;OAEG;IACH,iBAFW,UAAU,EAgCpB;IA3BA,sBAA2C;IAC3C,kBAAuC;IACvC,qBAA8C;IAE9C,oBAAoB;IACpB,oBAAoB;IAUpB,oBAA0D;IAC1D,oBAA2D;IAE3D,oBAAsD;IACtD,kBAAoD;IAEpD,oBAKC;IAGF;;;;OAIG;IACH,+BAEC;IAED;;;;OAIG;IACH,0DA8BC;IAED;;;OAGG;IACH,mCAEC;IAED;;;OAGG;IACH,mCAEC;IAED;;;OAGG;IACH,qCAiBC;IAED;;;OAGG;IACH,sCAiBC;IAED;;;OAGG;IACH,wCAiBC;IAED;;;OAGG;IACH,yCAiBC;IAED;;;;OAIG;IACH,+CAqFC;IAED;;;;OAIG;IACH,+CAoBC;IAED;;;;OAIG;IACH,4DAaC;IAED;;;;;OAKG;IACH,wFAYC;IAED;;;;OAIG;IACH,0DAmKC;CACD;wBA9hBuB,kBAAkB;yBAFH,2BAA2B;4BAMvC,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TMXIsometricRenderer.d.ts","sourceRoot":"","sources":["../../../../src/level/tiled/renderer/TMXIsometricRenderer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TMXIsometricRenderer.d.ts","sourceRoot":"","sources":["../../../../src/level/tiled/renderer/TMXIsometricRenderer.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH;;;GAGG;AACH;IACC;;OAEG;IACH,iBAFW,UAAU,EAQpB;IAHA,mBAAoC;IACpC,oBAAsC;IACtC,gBAA0C;IAG3C;;;;OAIG;IACH,+BAEC;IAED;;;;OAIG;IACH,0DAeC;IAED;;;;OAIG;IACH,+CAMC;IAED;;;;OAIG;IACH,+CAMC;IAED;;;;;OAKG;IACH,+BAmBC;IAED;;;;OAIG;IACH,4DAKC;IAED;;;;;OAKG;IACH,wFAIC;IAED;;;;;;;;;;;OAWG;IACH,qBARW,MAAM,KACN,MAAM,WACN,MAAM,KACN,QAAQ,GACN,QAAQ,CAUpB;IAED;;;;OAIG;IACH,0DA8HC;CACD;wBA1RuB,kBAAkB;4BAIf,kBAAkB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TMXObliqueRenderer.d.ts","sourceRoot":"","sources":["../../../../src/level/tiled/renderer/TMXObliqueRenderer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TMXObliqueRenderer.d.ts","sourceRoot":"","sources":["../../../../src/level/tiled/renderer/TMXObliqueRenderer.js"],"names":[],"mappings":"AAIA;;;;;GAKG;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;CAgO1C;kCAnRiC,4BAA4B"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @import CanvasRenderer from "../../../video/canvas/canvas_renderer.js";
|
|
4
4
|
* @import {Rect} from "../../../geometries/rectangle.ts";
|
|
5
5
|
* @import TMXTileMap from "../TMXTileMap.js";
|
|
6
|
+
* @import TMXLayer from "../TMXLayer.js";
|
|
6
7
|
* @import Tile from "../TMXTile.js";
|
|
7
8
|
* @import {Vector2d} from "../../../math/vector2d.ts";
|
|
8
9
|
* @import WebGLRenderer from "../../../video/webgl/webgl_renderer.js";
|
|
@@ -33,10 +34,13 @@ export default class TMXRenderer {
|
|
|
33
34
|
canRender(component: TMXTileMap | TMXLayer): boolean;
|
|
34
35
|
/**
|
|
35
36
|
* return the bounding rect for this map renderer
|
|
36
|
-
* @param {TMXLayer} [layer] - calculate the bounding rect for a specific layer (will return a new bounds object), its grid drawn from its first cell
|
|
37
|
+
* @param {TMXLayer|{cols: number, rows: number}} [layer] - calculate the bounding rect for a specific layer, or any area of `cols` x `rows` cells (will return a new bounds object), its grid drawn from its first cell
|
|
37
38
|
* @returns {Bounds}
|
|
38
39
|
*/
|
|
39
|
-
getBounds(layer?: TMXLayer
|
|
40
|
+
getBounds(layer?: TMXLayer | {
|
|
41
|
+
cols: number;
|
|
42
|
+
rows: number;
|
|
43
|
+
}): Bounds;
|
|
40
44
|
/**
|
|
41
45
|
* return the tile position corresponding to the specified pixel
|
|
42
46
|
* @param {number} x - X coordinate
|
|
@@ -77,7 +81,7 @@ export default class TMXRenderer {
|
|
|
77
81
|
}
|
|
78
82
|
import { Bounds } from "./../../../physics/bounds.ts";
|
|
79
83
|
import type TMXTileMap from "../TMXTileMap.js";
|
|
80
|
-
import TMXLayer from "
|
|
84
|
+
import type TMXLayer from "../TMXLayer.js";
|
|
81
85
|
import type { Vector2d } from "../../../math/vector2d.ts";
|
|
82
86
|
import type Renderer from "../../../video/renderer.js";
|
|
83
87
|
import type Tile from "../TMXTile.js";
|
|
@@ -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":"AAiBA;;;;;;;;;;GAUG;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,GAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,GACnC,MAAM,CAUlB;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;uBAhKkC,8BAA8B;4BAqBtC,kBAAkB;0BACpB,gBAAgB;8BAEd,2BAA2B;0BAE7B,4BAA4B;sBAHhC,eAAe;0BAHb,kCAAkC"}
|
|
@@ -60,6 +60,61 @@ export interface Light3dOptions {
|
|
|
60
60
|
*/
|
|
61
61
|
outerConeAngle?: number;
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* A 3D light source for the mesh lighting path — the 3D counterpart of
|
|
65
|
+
* {@link Light2d}. Like `Light2d`, a `Light3d` is a world {@link Renderable}:
|
|
66
|
+
* add it to a container with `app.world.addChild(light)` and it auto-registers
|
|
67
|
+
* with the active {@link Stage}, so any lit mesh in that scene is shaded by it.
|
|
68
|
+
* Remove it from the world to turn it off. A light draws nothing itself.
|
|
69
|
+
*
|
|
70
|
+
* Four types are shaded:
|
|
71
|
+
* - **`"directional"`** — a sun: a world-space `direction`, no falloff. Shaded
|
|
72
|
+
* via half-Lambert diffuse.
|
|
73
|
+
* - **`"ambient"`** — a flat fill added to every lit pixel (the dark side of a
|
|
74
|
+
* mesh never goes fully black). `direction` / `position` are ignored.
|
|
75
|
+
* - **`"point"`** — radiates from `position`, fading quadratically to zero at
|
|
76
|
+
* `range` (the same stylized falloff as {@link Light2d}'s radius).
|
|
77
|
+
* - **`"spot"`** — a point light confined to a cone along `direction`, at
|
|
78
|
+
* full strength inside `innerConeAngle` and fading smoothly to zero at
|
|
79
|
+
* `outerConeAngle`.
|
|
80
|
+
*
|
|
81
|
+
* Fields are public and mutable, so a light can be animated at runtime
|
|
82
|
+
* (e.g. a day/night cycle rotating `direction`, a flickering torch fading
|
|
83
|
+
* `intensity`, a searchlight sweeping its cone).
|
|
84
|
+
* @category Lighting
|
|
85
|
+
* @see [Material Textures example](https://melonjs.github.io/melonJS/examples/#/material-textures) — a key light plus ambient over MTL materials
|
|
86
|
+
* @see [Night City example](https://melonjs.github.io/melonJS/examples/#/night-city) — many lights across an instanced scene
|
|
87
|
+
* @see {@link Light2d} for the 2D sprite equivalent, which is a separate system
|
|
88
|
+
* @example
|
|
89
|
+
* import { Light3d } from "melonjs";
|
|
90
|
+
*
|
|
91
|
+
* // a sun + a soft ambient fill, added to the world like any renderable
|
|
92
|
+
* const sun = new Light3d({ direction: [0.3, 1, 0.2], color: "#fff" });
|
|
93
|
+
* app.world.addChild(sun);
|
|
94
|
+
* app.world.addChild(new Light3d({ type: "ambient", intensity: 0.3 }));
|
|
95
|
+
*
|
|
96
|
+
* // a street lamp pool and a searchlight cone
|
|
97
|
+
* app.world.addChild(new Light3d({
|
|
98
|
+
* type: "point", position: [120, -40, 60], color: "#ffb45e", range: 300,
|
|
99
|
+
* }));
|
|
100
|
+
* app.world.addChild(new Light3d({
|
|
101
|
+
* type: "spot", position: [0, -200, 0], direction: [0, 1, 0],
|
|
102
|
+
* range: 800, innerConeAngle: 0.2, outerConeAngle: 0.45,
|
|
103
|
+
* }));
|
|
104
|
+
*
|
|
105
|
+
* // `direction` and `position` also take a Vector3d, so a value the game
|
|
106
|
+
* // already keeps can be handed over without unpacking it. It is READ, not
|
|
107
|
+
* // retained — move the vector afterwards and the light does not follow.
|
|
108
|
+
* app.world.addChild(new Light3d({
|
|
109
|
+
* type: "spot",
|
|
110
|
+
* position: torch.pos,
|
|
111
|
+
* direction: new Vector3d(0, 1, 0.4),
|
|
112
|
+
* }));
|
|
113
|
+
*
|
|
114
|
+
* // animate the sun in-game (direction is the way light travels). Y-down, so
|
|
115
|
+
* // a positive Y is a sun overhead; a negative one lights from underneath.
|
|
116
|
+
* sun.direction.set(Math.sin(t), 1, Math.cos(t)).normalize();
|
|
117
|
+
*/
|
|
63
118
|
export declare class Light3d extends Renderable {
|
|
64
119
|
/** `"directional"`, `"ambient"`, `"point"` or `"spot"`. */
|
|
65
120
|
type: "directional" | "ambient" | "point" | "spot";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"light3d.d.ts","sourceRoot":"","sources":["../../src/lighting/light3d.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK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Q,CAAC;IAChD;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC;IAC/C;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAClD,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AAwBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,qBAAa,OAAQ,SAAQ,UAAU;IACtC,2DAA2D;IAClD,IAAI,EAAE,aAAa,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;IAC5D;;;OAGG;IACH,SAAS,EAAE,QAAQ,CAAC;IACpB,oDAAoD;IACpD,QAAQ,EAAE,QAAQ,CAAC;IACnB,uBAAuB;IACvB,KAAK,EAAE,KAAK,CAAC;IACb,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,cAAc,EAAE,MAAM,CAAC;IACvB,wDAAwD;IACxD,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;gBACS,OAAO,GAAE,cAAmB;CAoExC"}
|
package/build/loader/cache.d.ts
CHANGED
|
@@ -1,64 +1,92 @@
|
|
|
1
1
|
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* Get a loaded Tiled map or tileset (a `"tmx"` or `"tsx"` asset) as parsed
|
|
4
|
+
* data: the map's JSON structure, whether it was loaded from XML or JSON.
|
|
5
|
+
* Most code never needs it: `level.load(name)` builds the level from it.
|
|
6
|
+
* @param {string} elt - the asset name
|
|
7
|
+
* @returns {object} the parsed map or tileset, or `null` if none is loaded
|
|
8
|
+
* under that name
|
|
9
|
+
* @example
|
|
10
|
+
* const map = loader.getTMX("map1");
|
|
11
|
+
* console.log(map.width, map.height, map.layers.length);
|
|
6
12
|
* @category Assets
|
|
7
13
|
*/
|
|
8
14
|
export function getTMX(elt: string): object;
|
|
9
15
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @
|
|
16
|
+
* Get the content of a loaded `"binary"` asset, decoded as UTF-8 text: what
|
|
17
|
+
* a bitmap font's `.fnt` descriptor, for one, is loaded as.
|
|
18
|
+
* @param {string} elt - the asset name
|
|
19
|
+
* @returns {object} the file's content, as a string, or `null` if none is
|
|
20
|
+
* loaded under that name
|
|
21
|
+
* @example
|
|
22
|
+
* // a bitmap font: its image, and its descriptor as "binary"
|
|
23
|
+
* await loader.preload([
|
|
24
|
+
* { name: "PressStart2P", type: "image", src: "data/fnt/PressStart2P.png" },
|
|
25
|
+
* { name: "PressStart2P", type: "binary", src: "data/fnt/PressStart2P.fnt" },
|
|
26
|
+
* ]);
|
|
27
|
+
* const fnt = loader.getBinary("PressStart2P");
|
|
13
28
|
* @category Assets
|
|
14
29
|
*/
|
|
15
30
|
export function getBinary(elt: string): object;
|
|
16
31
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
32
|
+
* Get a loaded image (an `"image"` asset, or the image of an `"aseprite"`
|
|
33
|
+
* one). Given a path, its directory and extension are ignored, so
|
|
34
|
+
* `getImage("data/img/player.png")` finds the image named `"player"`.
|
|
35
|
+
* Most engine classes take the name instead, and look it up themselves:
|
|
36
|
+
* `new Sprite(0, 0, { image: "player" })`.
|
|
37
|
+
* @param {string} image - the asset name
|
|
38
|
+
* @returns {HTMLImageElement|CompressedImage|null} the image, or `null` if
|
|
39
|
+
* none is loaded under that name
|
|
40
|
+
* @example
|
|
41
|
+
* const player = loader.getImage("player");
|
|
42
|
+
* console.log(player.width, player.height);
|
|
20
43
|
* @category Assets
|
|
21
44
|
*/
|
|
22
45
|
export function getImage(image: string): HTMLImageElement | CompressedImage | null;
|
|
23
46
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* @
|
|
47
|
+
* Get a loaded JSON file (a `"json"` asset, or the descriptor of an
|
|
48
|
+
* `"aseprite"` one), parsed.
|
|
49
|
+
* @param {string} elt - the asset name
|
|
50
|
+
* @returns {JSON} the parsed content, or `null` if none is loaded under that
|
|
51
|
+
* name
|
|
52
|
+
* @example
|
|
53
|
+
* // a texture atlas: its image and its JSON descriptor share a name
|
|
54
|
+
* const atlas = new TextureAtlas(loader.getJSON("texture"), loader.getImage("texture"));
|
|
27
55
|
* @category Assets
|
|
28
56
|
*/
|
|
29
57
|
export function getJSON(elt: string): JSON;
|
|
30
58
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* @
|
|
59
|
+
* Get a loaded Wavefront OBJ model (an `"obj"` asset), parsed. Most code
|
|
60
|
+
* never needs it: a `Mesh` takes the model's name.
|
|
61
|
+
* @param {string} elt - the asset name
|
|
62
|
+
* @returns {object} the parsed model: `vertices` (Float32Array of x, y, z),
|
|
63
|
+
* `uvs` (Float32Array of u, v), `indices` (Uint16Array of triangle vertex
|
|
64
|
+
* indices), `vertexCount`, and `groups` (the `usemtl` material groups, as
|
|
65
|
+
* `{materialName, start, count}` index ranges); or `null` if none is loaded
|
|
66
|
+
* under that name
|
|
34
67
|
* @category Assets
|
|
35
68
|
* @example
|
|
36
69
|
* // 1. preload the OBJ model and its texture
|
|
37
|
-
*
|
|
38
|
-
* { name: "cube", type: "obj",
|
|
70
|
+
* await loader.preload([
|
|
71
|
+
* { name: "cube", type: "obj", src: "models/cube.obj" },
|
|
39
72
|
* { name: "cube", type: "image", src: "models/cube_texture.png" },
|
|
40
|
-
* ]
|
|
41
|
-
* // 2. create a Mesh using the preloaded model name
|
|
42
|
-
* const mesh = new me.Mesh(400, 300, {
|
|
43
|
-
* model: "cube", // references the preloaded OBJ
|
|
44
|
-
* texture: "cube", // references the preloaded image
|
|
45
|
-
* width: 200,
|
|
46
|
-
* height: 200,
|
|
47
|
-
* });
|
|
48
|
-
* me.game.world.addChild(mesh);
|
|
73
|
+
* ]);
|
|
49
74
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* // data.groups — usemtl material groups ({materialName, start, count} index ranges)
|
|
75
|
+
* // 2. a Mesh takes the model and the texture by name
|
|
76
|
+
* const mesh = new Mesh(400, 300, {
|
|
77
|
+
* model: "cube",
|
|
78
|
+
* texture: "cube",
|
|
79
|
+
* width: 200,
|
|
80
|
+
* height: 200,
|
|
57
81
|
* });
|
|
82
|
+
* app.world.addChild(mesh);
|
|
83
|
+
*
|
|
84
|
+
* // 3. or read the parsed data directly
|
|
85
|
+
* const { vertices, uvs, indices, vertexCount } = loader.getOBJ("cube");
|
|
58
86
|
*/
|
|
59
87
|
export function getOBJ(elt: string): object;
|
|
60
88
|
/**
|
|
61
|
-
*
|
|
89
|
+
* Get a loaded glTF/GLB scene (a `"gltf"` or `"glb"` asset), parsed.
|
|
62
90
|
*
|
|
63
91
|
* The descriptor is `{ nodes, cameras, lights, bounds, graph, animations }`:
|
|
64
92
|
* - `nodes` — one entry per mesh primitive, each carrying its accumulated
|
|
@@ -74,32 +102,30 @@ export function getOBJ(elt: string): object;
|
|
|
74
102
|
* automatically (see {@link level.load} options).
|
|
75
103
|
* - `bounds` — world-space `{ min, max }` (glTF units), handy for framing.
|
|
76
104
|
*
|
|
77
|
-
* Most code never needs this: a
|
|
105
|
+
* Most code never needs this: a loaded glTF/GLB registers with the
|
|
78
106
|
* {@link level} director, so the whole scene loads into a container in one
|
|
79
|
-
* call
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* @param {string} elt -
|
|
83
|
-
* @returns {GLTFData|null} the parsed scene descriptor, or `null` if
|
|
107
|
+
* call, `level.load(name)`, exactly like a Tiled map. Reach for `getGLTF`
|
|
108
|
+
* only to inspect the raw descriptor (to frame a `Camera3d` from the
|
|
109
|
+
* embedded camera, say).
|
|
110
|
+
* @param {string} elt - the asset name
|
|
111
|
+
* @returns {GLTFData|null} the parsed scene descriptor, or `null` if none is
|
|
112
|
+
* loaded under that name
|
|
84
113
|
* @category Assets
|
|
85
114
|
* @example
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
115
|
+
* await loader.preload([
|
|
116
|
+
* { name: "diorama", type: "glb", src: "scenes/diorama.glb" },
|
|
117
|
+
* ]);
|
|
118
|
+
*
|
|
119
|
+
* // load the whole scene into the world (view it under a Camera3d)
|
|
120
|
+
* level.load("diorama", { scale: 32 });
|
|
91
121
|
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* const { min, max } = scene.bounds;
|
|
95
|
-
* },
|
|
96
|
-
* );
|
|
122
|
+
* // ...or inspect the raw descriptor for custom framing
|
|
123
|
+
* const { min, max } = loader.getGLTF("diorama").bounds;
|
|
97
124
|
*/
|
|
98
125
|
export function getGLTF(elt: string): GLTFData | null;
|
|
99
126
|
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* camera `shader` property.
|
|
127
|
+
* Get the shader compiled from a loaded `"shader"` asset — compiled once,
|
|
128
|
+
* at load time, ready to add to a renderable or a camera as a post effect.
|
|
103
129
|
*
|
|
104
130
|
* **This returns a SHARED instance**: the *same* `ShaderEffect` object on
|
|
105
131
|
* every call, owned by the loader (its `shared` flag is `true`). That means:
|
|
@@ -122,6 +148,11 @@ export function getGLTF(elt: string): GLTFData | null;
|
|
|
122
148
|
* `renderer.customShader`, a custom batcher). Same shared-instance
|
|
123
149
|
* semantics, and `GLShader.clone()` likewise yields a caller-owned copy.
|
|
124
150
|
*
|
|
151
|
+
* Unloading the asset destroys the shared instance, under whatever still
|
|
152
|
+
* draws with it: with bundles, an effect that outlives a level (a HUD's, a
|
|
153
|
+
* camera's) belongs in a bundle that outlives that level, such as
|
|
154
|
+
* `"common"`. A `clone()` is the caller's own and is not destroyed with it.
|
|
155
|
+
*
|
|
125
156
|
* Degradation is never fatal: a fragment-body asset without a body in the
|
|
126
157
|
* active renderer's language (or on Canvas) is an inert `ShaderEffect`
|
|
127
158
|
* stub, and a complete-program asset without a realization for the active
|
|
@@ -129,77 +160,95 @@ export function getGLTF(elt: string): GLTFData | null;
|
|
|
129
160
|
* built-in rendering. Note that shader assets require an initialized
|
|
130
161
|
* Application (`await app.init()`) — an inherent precondition of the
|
|
131
162
|
* preload flow, since the loading screen itself needs the renderer.
|
|
132
|
-
* @param {string} elt -
|
|
133
|
-
* @returns {ShaderEffect|GLShader|null} the shared, precompiled shader, or
|
|
163
|
+
* @param {string} elt - the asset name
|
|
164
|
+
* @returns {ShaderEffect|GLShader|null} the shared, precompiled shader, or
|
|
165
|
+
* `null` if none is loaded under that name
|
|
134
166
|
* @category Assets
|
|
135
167
|
* @example
|
|
136
|
-
*
|
|
137
|
-
* // from a file (or data: URI)
|
|
168
|
+
* await loader.preload([
|
|
169
|
+
* // from a file (or a data: URI)
|
|
138
170
|
* { name: "waterRipple", type: "shader", src: "shaders/waterRipple.frag" },
|
|
139
|
-
* // or inline GLSL
|
|
171
|
+
* // or inline GLSL, through the `data` field
|
|
140
172
|
* { name: "flash", type: "shader", data: `
|
|
141
173
|
* uniform float uIntensity;
|
|
142
174
|
* vec4 apply(vec4 color, vec2 uv) { return mix(color, vec4(1.0), uIntensity); }
|
|
143
175
|
* ` },
|
|
144
|
-
* // or a complete program
|
|
145
|
-
* //
|
|
146
|
-
* //
|
|
176
|
+
* // or a complete program: a {vertex, fragment} GLSL pair and/or a full
|
|
177
|
+
* // WGSL module, compiled into one GLShader; the active renderer hosts
|
|
178
|
+
* // the one it speaks
|
|
147
179
|
* { name: "toonMesh", type: "shader", src: {
|
|
148
180
|
* vertex: "shaders/toon.vert",
|
|
149
181
|
* fragment: "shaders/toon.frag",
|
|
150
182
|
* wgsl: "shaders/toon.wgsl",
|
|
151
183
|
* } },
|
|
152
|
-
* ]
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
184
|
+
* ]);
|
|
185
|
+
*
|
|
186
|
+
* // one shared program: the same uniform values for every user
|
|
187
|
+
* mySprite.addPostEffect(loader.getShader("waterRipple"));
|
|
188
|
+
* // a private copy with its own uniforms (caller-owned, shared = false)
|
|
189
|
+
* boss.addPostEffect(loader.getShader("flash").clone());
|
|
190
|
+
* // a complete program hosts on a mesh, replacing the built-in shading
|
|
191
|
+
* myMesh.addPostEffect(loader.getShader("toonMesh"));
|
|
160
192
|
*/
|
|
161
193
|
export function getShader(elt: string): ShaderEffect | GLShader | null;
|
|
162
194
|
/**
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
195
|
+
* Get a loaded Wavefront MTL material library (an `"mtl"` asset), parsed.
|
|
196
|
+
* Most code never needs it: a `Mesh` takes the library's name as its
|
|
197
|
+
* `material`.
|
|
198
|
+
* @param {string} elt - the asset name
|
|
199
|
+
* @returns {object} the materials by name, each with its properties (`Kd`,
|
|
200
|
+
* `d`, `Ke`, `map_Kd`...), or `null` if none is loaded under that name
|
|
166
201
|
* @category Assets
|
|
167
202
|
* @example
|
|
168
|
-
* // 1. preload
|
|
169
|
-
*
|
|
170
|
-
* { name: "fox",
|
|
171
|
-
* { name: "fox",
|
|
203
|
+
* // 1. preload the model, its materials and their texture
|
|
204
|
+
* await loader.preload([
|
|
205
|
+
* { name: "fox", type: "obj", src: "models/fox.obj" },
|
|
206
|
+
* { name: "fox", type: "mtl", src: "models/fox.mtl" },
|
|
172
207
|
* { name: "colormap", type: "image", src: "models/colormap.png" },
|
|
173
|
-
* ]
|
|
174
|
-
* // 2. create a Mesh with material — texture, tint, opacity auto-applied
|
|
175
|
-
* const mesh = new me.Mesh(400, 300, {
|
|
176
|
-
* model: "fox",
|
|
177
|
-
* material: "fox",
|
|
178
|
-
* texture: "colormap",
|
|
179
|
-
* width: 200,
|
|
180
|
-
* height: 200,
|
|
181
|
-
* });
|
|
208
|
+
* ]);
|
|
182
209
|
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
210
|
+
* // 2. a Mesh with a material: texture, tint and opacity applied for you
|
|
211
|
+
* const mesh = new Mesh(400, 300, {
|
|
212
|
+
* model: "fox",
|
|
213
|
+
* material: "fox",
|
|
214
|
+
* texture: "colormap",
|
|
215
|
+
* width: 200,
|
|
216
|
+
* height: 200,
|
|
189
217
|
* });
|
|
218
|
+
*
|
|
219
|
+
* // 3. or read the materials directly
|
|
220
|
+
* const materials = loader.getMTL("fox");
|
|
221
|
+
* // materials["colormap"].Kd — [r, g, b] diffuse color (0-1 range)
|
|
222
|
+
* // materials["colormap"].d — opacity (0-1)
|
|
223
|
+
* // materials["colormap"].Ke — [r, g, b] emissive color (applied as Mesh.emissive)
|
|
224
|
+
* // materials["colormap"].map_Kd — resolved texture URL
|
|
190
225
|
*/
|
|
191
226
|
export function getMTL(elt: string): object;
|
|
192
227
|
/**
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
* @
|
|
228
|
+
* Get a loaded video (a `"video"` asset): the `<video>` element the loader
|
|
229
|
+
* created for it.
|
|
230
|
+
* @param {string} elt - the asset name
|
|
231
|
+
* @returns {HTMLVideoElement} the video element, or `null` if none is loaded
|
|
232
|
+
* under that name
|
|
233
|
+
* @example
|
|
234
|
+
* await loader.preload([{ name: "intro", type: "video", src: "data/video/intro.mp4" }]);
|
|
235
|
+
* const intro = loader.getVideo("intro");
|
|
236
|
+
* intro.play();
|
|
196
237
|
* @category Assets
|
|
197
238
|
*/
|
|
198
239
|
export function getVideo(elt: string): HTMLVideoElement;
|
|
199
240
|
/**
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
* @
|
|
241
|
+
* Get a loaded web font (a `"fontface"` asset): the `FontFace` the loader
|
|
242
|
+
* added to `document.fonts`. Text uses it by its name, as a CSS font family.
|
|
243
|
+
* @param {string} elt - the asset name
|
|
244
|
+
* @returns {FontFace} the font face, or `null` if none is loaded under that
|
|
245
|
+
* name
|
|
246
|
+
* @example
|
|
247
|
+
* await loader.preload([
|
|
248
|
+
* { name: "kenpixel", type: "fontface", src: "data/font/kenvector_future.woff2" },
|
|
249
|
+
* ]);
|
|
250
|
+
* const label = new Text(10, 10, { font: "kenpixel", size: 16, text: "Score" });
|
|
251
|
+
* console.log(loader.getFont("kenpixel").status); // "loaded"
|
|
203
252
|
* @category Assets
|
|
204
253
|
*/
|
|
205
254
|
export function getFont(elt: string): FontFace;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/loader/cache.js"],"names":[],"mappings":"AAsFA;;;;;;;;;;GAUG;AACH,+BANW,MAAM,QACN,MAAM,GACJ,OAAO,CAOnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,kCANW,MAAM,QACN,MAAM,GACJ,OAAO,CAWnB;AAED;;;;;;;;;GASG;AACH,iCALW,MAAM,GACJ,MAAM,EAAE,CAOpB;AAeD
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/loader/cache.js"],"names":[],"mappings":"AAsFA;;;;;;;;;;GAUG;AACH,+BANW,MAAM,QACN,MAAM,GACJ,OAAO,CAOnB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,kCANW,MAAM,QACN,MAAM,GACJ,OAAO,CAWnB;AAED;;;;;;;;;GASG;AACH,iCALW,MAAM,GACJ,MAAM,EAAE,CAOpB;AAeD;;;;;;;;;;;GAWG;AACH,4BARW,MAAM,GACJ,MAAM,CAclB;AAED;;;;;;;;;;;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