melonjs 20.6.0 → 20.8.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 +6 -3
- package/build/application/defaultApplicationSettings.d.ts +5 -0
- package/build/application/defaultApplicationSettings.d.ts.map +1 -1
- package/build/application/header.d.ts.map +1 -1
- package/build/application/settings.d.ts +88 -0
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/backend/engine.d.ts +0 -1
- package/build/audio/backend/sound.d.ts +0 -1
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/camera/camera3d.d.ts +95 -8
- package/build/camera/camera3d.d.ts.map +1 -1
- package/build/geometries/box3d.d.ts +24 -6
- package/build/geometries/box3d.d.ts.map +1 -1
- package/build/geometries/ellipse.d.ts +14 -0
- package/build/geometries/ellipse.d.ts.map +1 -1
- package/build/geometries/polygon.d.ts +14 -0
- package/build/geometries/polygon.d.ts.map +1 -1
- package/build/geometries/sphere.d.ts +35 -6
- package/build/geometries/sphere.d.ts.map +1 -1
- package/build/index.d.ts +10 -3
- package/build/index.d.ts.map +1 -1
- package/build/index.js +23361 -20195
- package/build/index.js.map +4 -4
- package/build/input/pointerevent.d.ts +8 -0
- package/build/input/pointerevent.d.ts.map +1 -1
- package/build/lang/deprecated.d.ts.map +1 -1
- package/build/level/gltf/GLTFModel.d.ts +17 -31
- package/build/level/gltf/GLTFModel.d.ts.map +1 -1
- package/build/level/gltf/GLTFScene.d.ts +40 -1
- package/build/level/gltf/GLTFScene.d.ts.map +1 -1
- package/build/level/level.d.ts +36 -0
- package/build/level/level.d.ts.map +1 -1
- package/build/level/tiled/TMXLayer.d.ts +5 -2
- package/build/level/tiled/TMXLayer.d.ts.map +1 -1
- package/build/level/tiled/TMXObject.d.ts +0 -1
- package/build/level/tiled/TMXTile.d.ts +2 -1
- package/build/level/tiled/TMXTile.d.ts.map +1 -1
- package/build/level/tiled/TMXTileMap.d.ts +7 -4
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
- package/build/level/tiled/TMXTileset.d.ts +1 -1
- package/build/level/tiled/TMXTileset.d.ts.map +1 -1
- package/build/level/tiled/TMXTilesetGroup.d.ts +5 -0
- package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -1
- package/build/level/tiled/factories/shape.d.ts +0 -1
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts +6 -5
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts +5 -0
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +8 -7
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +5 -0
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXRenderer.d.ts +19 -4
- package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/autodetect.d.ts +0 -4
- package/build/level/tiled/renderer/autodetect.d.ts.map +1 -1
- package/build/lighting/light2d.d.ts +68 -2
- package/build/lighting/light2d.d.ts.map +1 -1
- package/build/lighting/light3d.d.ts.map +1 -1
- package/build/loader/loader.d.ts +63 -0
- package/build/loader/loader.d.ts.map +1 -1
- package/build/loader/loadingscreen.d.ts +1 -2
- package/build/loader/loadingscreen.d.ts.map +1 -1
- package/build/loader/parsers/fontface.d.ts +2 -0
- package/build/loader/parsers/fontface.d.ts.map +1 -1
- package/build/loader/parsers/mtl.d.ts.map +1 -1
- package/build/loader/parsers/shader.d.ts +0 -2
- package/build/math/color.d.ts +27 -4
- package/build/math/color.d.ts.map +1 -1
- package/build/particles/emitter.d.ts.map +1 -1
- package/build/particles/particle.d.ts +22 -1
- package/build/particles/particle.d.ts.map +1 -1
- package/build/particles/settings.d.ts +69 -0
- package/build/particles/settings.d.ts.map +1 -1
- package/build/physics/adapter.d.ts +152 -3
- package/build/physics/adapter.d.ts.map +1 -1
- package/build/physics/builtin/body.d.ts +9 -18
- package/build/physics/builtin/body.d.ts.map +1 -1
- package/build/physics/builtin/builtin-adapter.d.ts.map +1 -1
- package/build/physics/builtin/detector.d.ts +0 -1
- package/build/physics/builtin/detector.d.ts.map +1 -1
- package/build/physics/builtin/sat.d.ts +0 -7
- package/build/physics/builtin/sat.d.ts.map +1 -1
- package/build/physics/builtin/sat3d.d.ts +46 -0
- package/build/physics/builtin/sat3d.d.ts.map +1 -1
- package/build/physics/physicseditor.d.ts +2 -0
- package/build/physics/physicseditor.d.ts.map +1 -0
- package/build/physics/response.d.ts +45 -62
- package/build/physics/response.d.ts.map +1 -1
- package/build/renderable/collectable.d.ts +6 -1
- package/build/renderable/collectable.d.ts.map +1 -1
- package/build/renderable/colorlayer.d.ts +4 -4
- package/build/renderable/colorlayer.d.ts.map +1 -1
- package/build/renderable/container.d.ts +23 -17
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/entity/entity.d.ts +14 -16
- package/build/renderable/entity/entity.d.ts.map +1 -1
- package/build/renderable/frameAnimation.d.ts +1 -1
- package/build/renderable/groundshadow.d.ts +1 -0
- package/build/renderable/groundshadow.d.ts.map +1 -1
- package/build/renderable/imagelayer.d.ts +12 -5
- package/build/renderable/imagelayer.d.ts.map +1 -1
- package/build/renderable/instanced_mesh.d.ts +2 -9
- package/build/renderable/instanced_mesh.d.ts.map +1 -1
- package/build/renderable/mesh.d.ts +306 -5
- package/build/renderable/mesh.d.ts.map +1 -1
- package/build/renderable/nineslicesprite.d.ts +3 -13
- package/build/renderable/nineslicesprite.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts +129 -28
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +77 -19
- package/build/renderable/sprite.d.ts.map +1 -1
- package/build/renderable/sprite3d.d.ts +27 -16
- package/build/renderable/sprite3d.d.ts.map +1 -1
- package/build/renderable/text/bitmaptext.d.ts +13 -3
- package/build/renderable/text/bitmaptext.d.ts.map +1 -1
- package/build/renderable/text/bitmaptextdata.d.ts +0 -4
- package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
- package/build/renderable/text/text.d.ts +5 -3
- package/build/renderable/text/text.d.ts.map +1 -1
- package/build/renderable/text/textmetrics.d.ts +2 -0
- package/build/renderable/text/textmetrics.d.ts.map +1 -1
- package/build/renderable/trail.d.ts +0 -1
- package/build/renderable/trail.d.ts.map +1 -1
- package/build/renderable/trigger.d.ts +39 -14
- package/build/renderable/trigger.d.ts.map +1 -1
- package/build/renderable/ui/progressbar.d.ts +194 -0
- package/build/renderable/ui/progressbar.d.ts.map +1 -0
- package/build/renderable/ui/uibaseelement.d.ts +48 -3
- package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
- package/build/renderable/ui/uispriteelement.d.ts +19 -3
- package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
- package/build/state/stage.d.ts +22 -0
- package/build/state/stage.d.ts.map +1 -1
- package/build/system/legacy_pool.d.ts +2 -2
- package/build/system/legacy_pool.d.ts.map +1 -1
- package/build/system/pool.d.ts +10 -0
- package/build/system/pool.d.ts.map +1 -1
- package/build/tweens/tween.d.ts +49 -2
- package/build/tweens/tween.d.ts.map +1 -1
- package/build/video/buffer/vertex.d.ts.map +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +34 -23
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/effects/blendEffect.d.ts +0 -1
- package/build/video/effects/bloom.d.ts +72 -0
- package/build/video/effects/bloom.d.ts.map +1 -0
- 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/colorMatrix.d.ts +3 -2
- package/build/video/effects/colorMatrix.d.ts.map +1 -1
- package/build/video/effects/desaturate.d.ts +10 -2
- package/build/video/effects/desaturate.d.ts.map +1 -1
- package/build/video/effects/dissolve.d.ts +3 -2
- package/build/video/effects/dissolve.d.ts.map +1 -1
- package/build/video/effects/dropShadow.d.ts +3 -2
- package/build/video/effects/dropShadow.d.ts.map +1 -1
- package/build/video/effects/flash.d.ts +3 -2
- package/build/video/effects/flash.d.ts.map +1 -1
- package/build/video/effects/glow.d.ts +3 -2
- package/build/video/effects/glow.d.ts.map +1 -1
- package/build/video/effects/hologram.d.ts +3 -2
- package/build/video/effects/hologram.d.ts.map +1 -1
- package/build/video/effects/invert.d.ts +10 -2
- package/build/video/effects/invert.d.ts.map +1 -1
- package/build/video/effects/outline.d.ts +3 -2
- 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 +8 -3
- package/build/video/effects/radialGradient.d.ts.map +1 -1
- package/build/video/effects/scanline.d.ts +3 -2
- package/build/video/effects/scanline.d.ts.map +1 -1
- package/build/video/effects/sepia.d.ts +10 -2
- package/build/video/effects/sepia.d.ts.map +1 -1
- package/build/video/effects/shadereffect.d.ts +10 -4
- package/build/video/effects/shadereffect.d.ts.map +1 -1
- package/build/video/effects/shine.d.ts +3 -2
- package/build/video/effects/shine.d.ts.map +1 -1
- package/build/video/effects/tintPulse.d.ts +3 -2
- package/build/video/effects/tintPulse.d.ts.map +1 -1
- package/build/video/effects/tonemap.d.ts +121 -0
- package/build/video/effects/tonemap.d.ts.map +1 -0
- package/build/video/effects/vignette.d.ts +3 -2
- package/build/video/effects/vignette.d.ts.map +1 -1
- package/build/video/effects/wave.d.ts +3 -2
- package/build/video/effects/wave.d.ts.map +1 -1
- package/build/video/gpu/meshmaterial.d.ts +2 -0
- package/build/video/gpu/meshmaterial.d.ts.map +1 -0
- package/build/video/gpu/vertexformat.d.ts +26 -0
- package/build/video/gpu/vertexformat.d.ts.map +1 -1
- package/build/video/gradient.d.ts +0 -1
- package/build/video/gradient.d.ts.map +1 -1
- package/build/video/renderer.d.ts +111 -7
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/renderstate.d.ts +2 -0
- package/build/video/renderstate.d.ts.map +1 -1
- package/build/video/rendertarget/canvasrendertarget.d.ts +3 -4
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/render_target_pool.d.ts +0 -1
- package/build/video/rendertarget/webglrendertarget.d.ts +0 -1
- package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/webgpurendertarget.d.ts +18 -2
- package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
- package/build/video/texture/atlas.d.ts +1 -0
- package/build/video/texture/atlas.d.ts.map +1 -1
- package/build/video/texture/cache.d.ts +1 -3
- package/build/video/texture/frametexture.d.ts +0 -1
- package/build/video/texture/frametexture.d.ts.map +1 -1
- package/build/video/texture/noise_texture2d.d.ts +1 -0
- package/build/video/texture/noise_texture2d.d.ts.map +1 -1
- package/build/video/utils/autodetect.d.ts +0 -2
- package/build/video/webgl/batchers/batcher.d.ts +0 -9
- package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts +13 -1
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/material_batcher.d.ts +4 -2
- package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/mesh_batcher.d.ts +2 -3
- package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/quad_batcher.d.ts +4 -0
- package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/buffer/index.d.ts +0 -1
- package/build/video/webgl/buffer/retained_geometry.d.ts +0 -1
- package/build/video/webgl/glshader.d.ts +5 -3
- package/build/video/webgl/glshader.d.ts.map +1 -1
- package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts +0 -4
- package/build/video/webgl/shaders/multitexture-lit.d.ts.map +1 -1
- package/build/video/webgl/texture/store.d.ts +0 -1
- package/build/video/webgl/webgl_renderer.d.ts +63 -24
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts +17 -0
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/mesh_batcher.d.ts +0 -3
- package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/quad_batcher.d.ts +0 -2
- package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/webgpu_batcher.d.ts +0 -2
- package/build/video/webgpu/batchers/webgpu_batcher.d.ts.map +1 -1
- package/build/video/webgpu/pipeline/cache.d.ts.map +1 -1
- package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts +0 -2
- package/build/video/webgpu/texture/frametexture.d.ts +0 -2
- package/build/video/webgpu/texture/frametexture.d.ts.map +1 -1
- package/build/video/webgpu/texture/store.d.ts +0 -1
- package/build/video/webgpu/texture/store.d.ts.map +1 -1
- package/build/video/webgpu/webgpu_renderer.d.ts +8 -75
- package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/package.json +1 -1
- package/skills/melonjs-3d/SKILL.md +293 -19
- package/skills/melonjs-3d-assets/SKILL.md +123 -13
- package/skills/melonjs-camera-and-drawing/SKILL.md +57 -1
- package/skills/melonjs-effects-and-shaders/SKILL.md +341 -29
- package/skills/melonjs-input/SKILL.md +48 -4
- package/skills/melonjs-lighting/SKILL.md +45 -1
- package/skills/melonjs-loading-assets/SKILL.md +1 -1
- package/skills/melonjs-particles-and-trails/SKILL.md +106 -4
- package/skills/melonjs-performance/SKILL.md +79 -2
- package/skills/melonjs-physics/SKILL.md +420 -29
- package/skills/melonjs-renderables/SKILL.md +15 -1
- package/skills/melonjs-scenes-and-state/SKILL.md +121 -1
- package/skills/melonjs-tilemaps/SKILL.md +9 -0
- package/skills/melonjs-ui-and-text/SKILL.md +165 -4
- package/build/level/gltf/srgb.d.ts +0 -20
- package/build/level/gltf/srgb.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/renderable/text/text.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/renderable/text/text.js"],"names":[],"mappings":"AAgDA;;;;;;;;;;;;;;GAcG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6DG;IACH,eA7DW,MAAM,KACN,MAAM,YAEd;QAAyB,IAAI,EAArB,MAAM;QACkB,IAAI,EAA5B,MAAM,GAAC,MAAM;QACoB,SAAS;QACvB,eAAe;QACV,WAAW;QACjB,SAAS;QACT,SAAS;QACT,YAAY;QACZ,UAAU;QACmB,WAAW;eAAvC,MAAM;eAAG,MAAM;;QAChB,aAAa;QACZ,IAAI;QACJ,MAAM;QACI,IAAI;KACzC,EAsHF;IAtEA;;;;OAIG;IACH,WAHU,KAAK,CAGwB;IAEvC;;;;OAIG;IACH,aAHU,KAAK,CAG0B;IAEzC;;;;OAIG;IACH,WAHU,MAAM,CAGE;IAElB;;;;;OAKG;IACH,WAHU,MAAM,CAGO;IAEvB;;;;;OAKG;IACH,cAHU,MAAM,CAGS;IAEzB;;;;;OAKG;IACH,YAHU,MAAM,CAGK;IAErB;;;;;OAKG;IACH,eAHU,MAAM,CAGO;IAEvB;;;;OAIG;IACH,UAHU,MAAM,CAGE;IAElB;;;;;OAKG;IACH,cAAe;IAMhB;;;OAGG;IACH,kDAgIC;IA3HA;;;;;;;;;;;;;;;;OAgBG;IACH,cARU,QAAQ,GAAC,SAAS,CAQC;IAE7B;;;;;;;;;;;;;;OAcG;IACH,qCAA2B;IA0E3B,8CAEE;IAEF;;;OAGG;IACH,wBAA4B;IAG5B,iCAAoC;IAMrC;;;OAGG;IACH,QAFa,IAAI,CAWhB;IAJC,UAA+B;IAMjC;;;OAGG;IACH,UAFa,IAAI,CAWhB;IAED;;;;;;;;OAQG;IACH,cAPW,MAAM,SACN,MAAM,GAAC,MAAM,GACX,IAAI,CAwChB;IAED;;;;OAIG;IACH,gBAHW,MAAM,GAAC,MAAM,GAAC,MAAM,EAAE,GACpB,IAAI,CAkFhB;IAkBD,oCAZU,MAAM,EAiBf;IArBD;;;;;;;;;;;OAWG;IACH,gCARU,MAAM,CAUf;IAkCD,+BAlBU,MAAM,EA4Bf;IAnCD;;;;;;;;;;;;;;OAcG;IACH,2BARU,MAAM,CAgBf;IAiED;;;;;;;;;;;;OAYG;IACH,mBAXW,MAAM,GACJ,WAAW,CAYvB;IAED;;;OAGG;IACH,eAFW,QAAQ,QA0ClB;IAED;;;OAGG;IACH,4EA+GC;IAED;;;;OAIG;IACH,gBAWC;CACD;uBAjyBsB,kBAAkB;sBALR,qBAAqB;yBAC7B,yBAAyB;+BAEnB,gDAAgD;wBAGvD,kBAAkB;0BASjB,yBAAyB;8BAHvB,wBAAwB"}
|
|
@@ -46,5 +46,7 @@ declare class TextMetrics extends Bounds {
|
|
|
46
46
|
wordWrap(text: string | string[], width: number, context?: CanvasRenderingContext2D): string[];
|
|
47
47
|
}
|
|
48
48
|
import { Bounds } from "../../physics/bounds.ts";
|
|
49
|
+
import type Renderable from "../renderable.js";
|
|
49
50
|
import Text from "./text.js";
|
|
51
|
+
import type BitmapText from "./bitmaptext.js";
|
|
50
52
|
//# sourceMappingURL=textmetrics.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textmetrics.d.ts","sourceRoot":"","sources":["../../../src/renderable/text/textmetrics.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"textmetrics.d.ts","sourceRoot":"","sources":["../../../src/renderable/text/textmetrics.js"],"names":[],"mappings":";AA+BA;;GAEG;AACH;IACC;;OAEG;IACH,sBAFW,IAAI,GAAC,UAAU,EAczB;IARA;;;;OAIG;IACH,UAHU,UAAU,CAGI;IAKzB;;;OAGG;IACH,cAFa,MAAM,CAalB;IAED;;;;;OAKG;IACH,gBAJW,MAAM,YACN,wBAAwB,GACtB,MAAM,CA4BlB;IAED;;;;;OAKG;IACH,kBAJW,MAAM,YACN,wBAAwB,GACtB,WAAW,CAiHvB;IA/EA,iCAAqB;IACrB,mCAAuB;IAmCvB,8BAAkB;IAClB,iCAAqB;IA4CtB;;;;;;;;;;;;;;;OAeG;IACH,gBAJa,WAAW,CAoBvB;IAED;;;;;;OAMG;IACH,eALW,MAAM,GAAC,MAAM,EAAE,SACf,MAAM,YACN,wBAAwB,GACtB,MAAM,EAAE,CAyCpB;CACD;uBA/SsB,yBAAyB;4BAOrB,kBAAkB;iBAN5B,WAAW;4BAKD,iBAAiB"}
|
|
@@ -86,6 +86,5 @@ export default class Trail extends Renderable {
|
|
|
86
86
|
}
|
|
87
87
|
import Renderable from "./renderable.js";
|
|
88
88
|
import type { Vector2d } from "../math/vector2d.ts";
|
|
89
|
-
import { Gradient } from "../video/gradient.js";
|
|
90
89
|
import type { Color } from "../math/color.ts";
|
|
91
90
|
//# sourceMappingURL=trail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trail.d.ts","sourceRoot":"","sources":["../../src/renderable/trail.js"],"names":[],"mappings":"AAMA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH;IACC;;;;;;;;;;;;OAYG;IACH,sBAXG;QAAsC,MAAM;QACnB,MAAM;QACN,QAAQ;QACR,WAAW;QACX,KAAK;QACH,UAAU;QACN,KAAK;QACkC,QAAQ;iBAAlD,MAAM;mBAAS,KAAK,GAAC,MAAM;;QAC9B,OAAO;QACP,SAAS;KACpC,
|
|
1
|
+
{"version":3,"file":"trail.d.ts","sourceRoot":"","sources":["../../src/renderable/trail.js"],"names":[],"mappings":"AAMA;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH;IACC;;;;;;;;;;;;OAYG;IACH,sBAXG;QAAsC,MAAM;QACnB,MAAM;QACN,QAAQ;QACR,WAAW;QACX,KAAK;QACH,UAAU;QACN,KAAK;QACkC,QAAQ;iBAAlD,MAAM;mBAAS,KAAK,GAAC,MAAM;;QAC9B,OAAO;QACP,SAAS;KACpC,EA6DA;IAzDA,uCAAuC;IACvC,QADW,UAAU,GAAC,QAAQ,GAAC,IAAI,CACC;IACpC,qBAAqB;IACrB,WADW,MAAM,CACoB;IACrC,qBAAqB;IACrB,UADW,MAAM,CACsB;IACvC,qBAAqB;IACrB,aADW,MAAM,CAC0B;IAG3C,uBAAuB;IACvB,YADW,MAAM,EAAE,CAIT;IAYV,oBAA6C;IAC7C;;;OAGG;IACH,eAAiB;IACjB;;;OAGG;IACH,qBAAoC;IACpC;;;OAGG;IACH;;;MAAyB;IACzB;;;OAGG;IACH;;;MAAyB;IAa1B;;;;OAIG;IACH,YAHW,MAAM,KACN,MAAM,QAehB;IAED;;;OAGG;IACH,yBAsBC;IAED;;;OAGG;IACH,0BAiDC;IAED,6BAA6B;IAC7B,cAEC;IAED;;;;;;OAMG;IACH,wBALW,MAAM,GACJ,QAAQ,CAiCpB;IAED;;;OAGG;IACH,gBAMC;CACD;uBAlRsB,iBAAiB;8BAIb,qBAAqB;yBALvB,sBAAsB;2BAIvB,kBAAkB"}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* additional import for TypeScript
|
|
3
|
-
* @import ResponseObject from "./../physics/response.js";
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Trigger an event when colliding with another object.
|
|
7
|
-
* Supports both fade and mask-based transitions when loading a new level.
|
|
8
|
-
* @category Game Objects
|
|
9
|
-
*/
|
|
10
1
|
export default class Trigger extends Renderable {
|
|
11
2
|
/**
|
|
12
3
|
* @param {number} x - the x coordinates of the trigger area
|
|
@@ -25,6 +16,20 @@ export default class Trigger extends Renderable {
|
|
|
25
16
|
* @param {Function} [settings.onLoaded] - Level loaded callback. See {@link level.load}
|
|
26
17
|
* @param {boolean} [settings.flatten] - Flatten all objects into the target container. See {@link level.load}
|
|
27
18
|
* @param {boolean} [settings.setViewportBounds] - Resize the viewport to match the level. See {@link level.load}
|
|
19
|
+
* @param {number} [settings.scale] - Pixels per glTF unit. See {@link level.load}
|
|
20
|
+
* @param {boolean} [settings.rightHanded] - Convert the glTF scene to the engine's Y-down coordinates. See {@link level.load}
|
|
21
|
+
* @param {boolean} [settings.lights] - Load the glTF scene's lights. See {@link level.load}
|
|
22
|
+
* @param {number} [settings.lightIntensityScale] - Scale the glTF lights' authored intensity. See {@link level.load}
|
|
23
|
+
* @param {boolean} [settings.castGroundShadow] - Enable ground shadows for glTF meshes. See {@link level.load}
|
|
24
|
+
* @param {number} [settings.shadowGroundY] - World Y for glTF ground shadows. See {@link level.load}
|
|
25
|
+
* @param {number} [settings.shadowOpacity] - How dark those blobs are. See {@link level.load}
|
|
26
|
+
* @param {number} [settings.shadowScale] - Blob footprint multiplier. See {@link level.load}
|
|
27
|
+
* @param {number} [settings.shadowOffset] - Slide them along the light, in blob radii. See {@link level.load}
|
|
28
|
+
* @param {number} [settings.shadowStretch] - Lengthen them along it. See {@link level.load}
|
|
29
|
+
* @param {number} [settings.shadowDirectionX] - X of the ground direction they are cast along. See {@link level.load}
|
|
30
|
+
* @param {number} [settings.shadowDirectionZ] - Z of that direction. See {@link level.load}
|
|
31
|
+
* @param {number[]|Vector3d} [settings.shadowGroundNormal] - Up normal of the floor, for a scene that is not level. See {@link level.load}
|
|
32
|
+
* @param {Light3d} [settings.shadowLight] - A light to take the shadow direction from. See {@link level.load}
|
|
28
33
|
* @example
|
|
29
34
|
* // fade transition (default)
|
|
30
35
|
* world.addChild(new Trigger(x, y, {
|
|
@@ -62,20 +67,34 @@ export default class Trigger extends Renderable {
|
|
|
62
67
|
height?: number | undefined;
|
|
63
68
|
shapes?: Rect[] | Polygon[] | Line[] | Ellipse[] | undefined;
|
|
64
69
|
duration?: number | undefined;
|
|
65
|
-
color?: string | Color;
|
|
70
|
+
color?: string | Color | undefined;
|
|
66
71
|
transition?: string | undefined;
|
|
67
|
-
shape?: Ellipse |
|
|
72
|
+
shape?: Polygon | Ellipse | undefined;
|
|
68
73
|
event?: string | undefined;
|
|
69
74
|
to?: string | undefined;
|
|
70
|
-
container?: string | Container;
|
|
75
|
+
container?: string | Container | undefined;
|
|
71
76
|
onLoaded?: Function | undefined;
|
|
72
77
|
flatten?: boolean | undefined;
|
|
73
78
|
setViewportBounds?: boolean | undefined;
|
|
79
|
+
scale?: number | undefined;
|
|
80
|
+
rightHanded?: boolean | undefined;
|
|
81
|
+
lights?: boolean | undefined;
|
|
82
|
+
lightIntensityScale?: number | undefined;
|
|
83
|
+
castGroundShadow?: boolean | undefined;
|
|
84
|
+
shadowGroundY?: number | undefined;
|
|
85
|
+
shadowOpacity?: number | undefined;
|
|
86
|
+
shadowScale?: number | undefined;
|
|
87
|
+
shadowOffset?: number | undefined;
|
|
88
|
+
shadowStretch?: number | undefined;
|
|
89
|
+
shadowDirectionX?: number | undefined;
|
|
90
|
+
shadowDirectionZ?: number | undefined;
|
|
91
|
+
shadowGroundNormal?: number[] | Vector3d;
|
|
92
|
+
shadowLight?: any;
|
|
74
93
|
});
|
|
75
94
|
color: any;
|
|
76
95
|
duration: number | undefined;
|
|
77
96
|
transition: string;
|
|
78
|
-
transitionShape:
|
|
97
|
+
transitionShape: Polygon | Ellipse | undefined;
|
|
79
98
|
fading: boolean;
|
|
80
99
|
type: any;
|
|
81
100
|
id: any;
|
|
@@ -85,7 +104,7 @@ export default class Trigger extends Renderable {
|
|
|
85
104
|
};
|
|
86
105
|
bodyDef: {
|
|
87
106
|
type: string;
|
|
88
|
-
shapes:
|
|
107
|
+
shapes: undefined[] | Polygon[] | Ellipse[];
|
|
89
108
|
collisionType: number;
|
|
90
109
|
collisionMask: number;
|
|
91
110
|
isSensor: boolean;
|
|
@@ -104,4 +123,10 @@ export default class Trigger extends Renderable {
|
|
|
104
123
|
onCollisionStart(): void;
|
|
105
124
|
}
|
|
106
125
|
import Renderable from "./renderable.js";
|
|
126
|
+
import type { Polygon } from "../geometries/polygon.ts";
|
|
127
|
+
import type { Ellipse } from "../geometries/ellipse.ts";
|
|
128
|
+
import type { Rect } from "../geometries/rectangle.ts";
|
|
129
|
+
import type { Line } from "../geometries/line.ts";
|
|
130
|
+
import type { Color } from "../math/color.ts";
|
|
131
|
+
import type Container from "./container.js";
|
|
107
132
|
//# sourceMappingURL=trigger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../src/renderable/trigger.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../src/renderable/trigger.js"],"names":[],"mappings":"AAiEA;IACC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8DG;IACH,eA9DW,MAAM,KACN,MAAM,YAEd;QAA0B,KAAK;QACL,MAAM;QACqB,MAAM;QACjC,QAAQ;QACF,KAAK;QACX,UAAU;QACD,KAAK;QACd,KAAK;QACL,EAAE;QACQ,SAAS;QACjB,QAAQ;QACT,OAAO;QACP,iBAAiB;QAClB,KAAK;QACJ,WAAW;QACX,MAAM;QACP,mBAAmB;QAClB,gBAAgB;QACjB,aAAa;QACb,aAAa;QACb,WAAW;QACX,YAAY;QACZ,aAAa;QACb,gBAAgB;QAChB,gBAAgB;QACL,kBAAkB,GAA/C,MAAM,EAAE,GAAC,QAAQ;QACE,WAAW;KACtC,EAyFF;IApDA,WAA4C;IAC5C,6BAAiC;IACjC,mBAA+C;IAC/C,+CAAqC;IACrC,gBAAmB;IAInB,UAAyB;IACzB,QAAqB;IACrB,8BAA4B;IAG5B;;MAEC;IAwBD;;;;;;MAMC;IASF;;;OAGG;IACH;;MAQC;IAED;;;OAGG;IACH,+BAwFC;IAED;;;;;OAKG;IACH,yBAIC;CACD;uBA3SsB,iBAAiB;6BASd,0BAA0B;6BAF1B,0BAA0B;0BAG7B,4BAA4B;0BAF5B,uBAAuB;2BAHtB,kBAAkB;2BAChB,gBAAgB"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { Color } from "../../math/color.ts";
|
|
2
|
+
import { on } from "../../system/event.ts";
|
|
3
|
+
import type { Gradient } from "../../video/gradient.js";
|
|
4
|
+
import type Renderer from "../../video/renderer.js";
|
|
5
|
+
import Renderable from "../renderable.js";
|
|
6
|
+
import Text from "../text/text.js";
|
|
7
|
+
/**
|
|
8
|
+
* The name of any event the engine knows about.
|
|
9
|
+
*
|
|
10
|
+
* Derived from `on` rather than naming the `Events` map, which is internal to
|
|
11
|
+
* the event module; this gets the same set without widening that surface.
|
|
12
|
+
*/
|
|
13
|
+
type EventName = Parameters<typeof on>[0];
|
|
14
|
+
/** anything {@link Renderer#setColor} will take */
|
|
15
|
+
type Paint = Color | string | Gradient;
|
|
16
|
+
/** which way the fill grows */
|
|
17
|
+
export type ProgressBarDirection = "left-to-right" | "right-to-left" | "top-to-bottom" | "bottom-to-top";
|
|
18
|
+
/**
|
|
19
|
+
* Everything {@link ProgressBar} takes.
|
|
20
|
+
*/
|
|
21
|
+
export interface ProgressBarSettings {
|
|
22
|
+
/** the bar's full width, in pixels */
|
|
23
|
+
width: number;
|
|
24
|
+
/** the bar's full height, in pixels */
|
|
25
|
+
height: number;
|
|
26
|
+
/** the value that reads as empty */
|
|
27
|
+
min?: number;
|
|
28
|
+
/** the value that reads as full */
|
|
29
|
+
max?: number;
|
|
30
|
+
/** where to start */
|
|
31
|
+
value?: number;
|
|
32
|
+
/** which edge the fill grows from */
|
|
33
|
+
direction?: ProgressBarDirection;
|
|
34
|
+
/** behind the fill; `null` leaves it hollow, showing whatever is behind */
|
|
35
|
+
trackColor?: Paint | null;
|
|
36
|
+
/**
|
|
37
|
+
* the fill itself. A {@link Color} is re-read every frame, so mutating the
|
|
38
|
+
* one you passed animates the bar
|
|
39
|
+
*/
|
|
40
|
+
fillColor?: Paint;
|
|
41
|
+
/** drawn around the track; `null` for none */
|
|
42
|
+
borderColor?: Paint | null;
|
|
43
|
+
/** how thick that border is */
|
|
44
|
+
borderWidth?: number;
|
|
45
|
+
/** how far the fill sits inside the track, per side */
|
|
46
|
+
padding?: number;
|
|
47
|
+
/** corner radius; `0` is square */
|
|
48
|
+
radius?: number;
|
|
49
|
+
/** called whenever the value actually moves */
|
|
50
|
+
onChange?: (value: number, ratio: number) => void;
|
|
51
|
+
/** draw a label over the bar */
|
|
52
|
+
showLabel?: boolean;
|
|
53
|
+
/** the label's font family */
|
|
54
|
+
font?: string;
|
|
55
|
+
/** the label's font size, in pixels */
|
|
56
|
+
fontSize?: number;
|
|
57
|
+
/** the label's colour */
|
|
58
|
+
labelFillStyle?: Paint;
|
|
59
|
+
/** what the label says; the default is a rounded percentage */
|
|
60
|
+
labelFormat?: (value: number, ratio: number) => string;
|
|
61
|
+
/**
|
|
62
|
+
* an event to take the value from, instead of setting it by hand.
|
|
63
|
+
*
|
|
64
|
+
* The bar subscribes for as long as it exists and unsubscribes when it is
|
|
65
|
+
* destroyed, which is the point: a subscription that outlives what it
|
|
66
|
+
* drives is a listener writing into a freed object.
|
|
67
|
+
*/
|
|
68
|
+
bindEvent?: EventName;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A bar that shows one value between two bounds.
|
|
72
|
+
*
|
|
73
|
+
* A health bar, a shield gauge, a cooldown, a loading bar: all the same
|
|
74
|
+
* object, and the engine's own loading screen is built on this one. Set
|
|
75
|
+
* {@link ProgressBar#value} and it redraws.
|
|
76
|
+
*
|
|
77
|
+
* It draws the track, the fill, the border and the label itself, in that
|
|
78
|
+
* order, which is the point of it being ONE renderable rather than a track
|
|
79
|
+
* sprite with a fill sprite on top. Two renderables at the same place have to
|
|
80
|
+
* be told which is in front, and that question has to be answered again every
|
|
81
|
+
* time either one moves.
|
|
82
|
+
*
|
|
83
|
+
* ## The colour can follow the value
|
|
84
|
+
*
|
|
85
|
+
* `fillColor` is read at draw time rather than copied, so passing a
|
|
86
|
+
* {@link Color} you keep hold of and mutating it is all a value-driven colour
|
|
87
|
+
* takes. That is deliberately not built in, because every game wants a
|
|
88
|
+
* different rule and most want the colour somewhere else too, next to a shader
|
|
89
|
+
* uniform or a glow:
|
|
90
|
+
*
|
|
91
|
+
* ```js
|
|
92
|
+
* const full = new Color().parseCSS("#7fe0ff");
|
|
93
|
+
* const empty = new Color().parseCSS("#ff2a1e");
|
|
94
|
+
* const mixed = new Color();
|
|
95
|
+
*
|
|
96
|
+
* const shield = new ProgressBar(x, y, {
|
|
97
|
+
* width: 190, height: 13,
|
|
98
|
+
* trackColor: null, // a hollow frame
|
|
99
|
+
* borderColor: "rgba(122, 190, 235, 0.8)",
|
|
100
|
+
* padding: 2,
|
|
101
|
+
* fillColor: mixed, // kept, not copied
|
|
102
|
+
* });
|
|
103
|
+
*
|
|
104
|
+
* // each frame
|
|
105
|
+
* mixed.copy(empty).lerp(full, hp);
|
|
106
|
+
* shield.value = hp;
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* Blinking is the same story: {@link Renderable#setOpacity} already does it,
|
|
110
|
+
* on whatever clock the game is already keeping.
|
|
111
|
+
* @category UI
|
|
112
|
+
* @example
|
|
113
|
+
* // a loading bar
|
|
114
|
+
* const bar = new ProgressBar(0, 100, {
|
|
115
|
+
* width: renderer.width, height: 4,
|
|
116
|
+
* trackColor: "black", fillColor: "#55aa00",
|
|
117
|
+
* });
|
|
118
|
+
* event.on(event.LOADER_PROGRESS, (progress) => { bar.value = progress; });
|
|
119
|
+
* @example
|
|
120
|
+
* // a label, and a value that is not a fraction
|
|
121
|
+
* const hp = new ProgressBar(20, 20, {
|
|
122
|
+
* width: 200, height: 24,
|
|
123
|
+
* min: 0, max: 100, value: 100,
|
|
124
|
+
* fillColor: "#c0392b", radius: 6,
|
|
125
|
+
* showLabel: true,
|
|
126
|
+
* labelFormat: (v) => `${Math.round(v)} HP`,
|
|
127
|
+
* });
|
|
128
|
+
*/
|
|
129
|
+
export default class ProgressBar extends Renderable {
|
|
130
|
+
/** the value that reads as empty */
|
|
131
|
+
min: number;
|
|
132
|
+
/** the value that reads as full */
|
|
133
|
+
max: number;
|
|
134
|
+
/** which edge the fill grows from */
|
|
135
|
+
direction: ProgressBarDirection;
|
|
136
|
+
/** behind the fill; `null` leaves it hollow */
|
|
137
|
+
trackColor: Paint | null;
|
|
138
|
+
/** the fill. A {@link Color} here is re-read every frame */
|
|
139
|
+
fillColor: Paint;
|
|
140
|
+
/** drawn around the track; `null` for none */
|
|
141
|
+
borderColor: Paint | null;
|
|
142
|
+
/** how thick that border is */
|
|
143
|
+
borderWidth: number;
|
|
144
|
+
/** how far the fill sits inside the track, per side */
|
|
145
|
+
padding: number;
|
|
146
|
+
/** corner radius; `0` is square */
|
|
147
|
+
radius: number;
|
|
148
|
+
/** called whenever the value actually moves */
|
|
149
|
+
onChange?: ((value: number, ratio: number) => void) | undefined;
|
|
150
|
+
/** what the label says */
|
|
151
|
+
labelFormat: (value: number, ratio: number) => string;
|
|
152
|
+
/** the label, when `showLabel` was asked for */
|
|
153
|
+
label?: Text | undefined;
|
|
154
|
+
/** the event the value is taken from, if any */
|
|
155
|
+
readonly bindEvent?: EventName | undefined;
|
|
156
|
+
/**
|
|
157
|
+
* @param x - position of the bar's left edge
|
|
158
|
+
* @param y - position of its top edge
|
|
159
|
+
* @param settings - see {@link ProgressBarSettings}
|
|
160
|
+
*/
|
|
161
|
+
constructor(x: number, y: number, settings: ProgressBarSettings);
|
|
162
|
+
/**
|
|
163
|
+
* Where the bar is now, between {@link ProgressBar#min} and
|
|
164
|
+
* {@link ProgressBar#max}.
|
|
165
|
+
*
|
|
166
|
+
* Writing a value outside that range clamps rather than throwing, since
|
|
167
|
+
* the usual source is a health or a timer that has just gone past its own
|
|
168
|
+
* limit. Writing the value it already has does nothing at all, so
|
|
169
|
+
* `onChange` means the value MOVED.
|
|
170
|
+
*/
|
|
171
|
+
get value(): number;
|
|
172
|
+
set value(v: number);
|
|
173
|
+
/**
|
|
174
|
+
* The value as a fraction, `0` at `min` and `1` at `max`.
|
|
175
|
+
*
|
|
176
|
+
* This is what the fill is drawn from, and what a caller usually wants for
|
|
177
|
+
* anything else keyed to the same number. Read only; set
|
|
178
|
+
* {@link ProgressBar#value}.
|
|
179
|
+
*/
|
|
180
|
+
get ratio(): number;
|
|
181
|
+
/**
|
|
182
|
+
* Set the value, for chaining.
|
|
183
|
+
* @param v - the new value, clamped to the bar's bounds
|
|
184
|
+
* @returns this bar
|
|
185
|
+
*/
|
|
186
|
+
setValue(v: number): this;
|
|
187
|
+
/**
|
|
188
|
+
* Draw the track, the fill, the border and the label, in that order.
|
|
189
|
+
* @param renderer - the renderer to draw with
|
|
190
|
+
*/
|
|
191
|
+
draw(renderer: Renderer): void;
|
|
192
|
+
}
|
|
193
|
+
export {};
|
|
194
|
+
//# sourceMappingURL=progressbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progressbar.d.ts","sourceRoot":"","sources":["../../../src/renderable/ui/progressbar.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAa,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAO,EAAE,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AACpD,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,IAAI,MAAM,iBAAiB,CAAC;AAEnC;;;;;GAKG;AACH,KAAK,SAAS,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAE1C,mDAAmD;AACnD,KAAK,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,QA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IAII,MAAM,CAFlB;IAED,IAAI,KAAK,CAAC,CAAC,EAAE,MAAM,EAWlB;IAED;;;;;;OAMG;IACH,IAAI,KAAK,WAGR;IAYD;;;;OAIG;IACH,QAAQ,CAAC,CAAC,EAAE,MAAM;IA8FlB;;;OAGG;IACM,IAAI,CAAC,QAAQ,EAAE,QAAQ;CAoHhC"}
|
|
@@ -4,7 +4,36 @@ import Container from "../container.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* This is a basic clickable and draggable container which you can use in your game UI.
|
|
6
6
|
* Use this for example if you want to display a panel that contains text, images or other UI elements.
|
|
7
|
+
*
|
|
8
|
+
* Regions under the pointer are asked in the order they are drawn, topmost
|
|
9
|
+
* first, and the walk carries on downwards until a handler returns `false`. An
|
|
10
|
+
* element that can overlap another one is therefore not opaque until it says
|
|
11
|
+
* so: by default a widget it covers still answers clicks and still lights up on
|
|
12
|
+
* hover. {@link UIBaseElement#onClick}, {@link UIBaseElement#onRelease} and
|
|
13
|
+
* {@link UIBaseElement#onOver} each consume by returning `false`.
|
|
7
14
|
* @category UI
|
|
15
|
+
* @example
|
|
16
|
+
* // a panel that is opaque to the pointer and comes to the front when picked
|
|
17
|
+
* class Panel extends UIBaseElement {
|
|
18
|
+
* onClick() {
|
|
19
|
+
* this.ancestor.moveToTop(this);
|
|
20
|
+
* return false;
|
|
21
|
+
* }
|
|
22
|
+
* // the frame the pointer crosses in
|
|
23
|
+
* onOver() {
|
|
24
|
+
* return false;
|
|
25
|
+
* }
|
|
26
|
+
* // and every frame after that, when the pointer is already inside and
|
|
27
|
+
* // `onOver` no longer fires
|
|
28
|
+
* onActivateEvent() {
|
|
29
|
+
* super.onActivateEvent();
|
|
30
|
+
* me.input.registerPointerEvent("pointermove", this, () => false);
|
|
31
|
+
* }
|
|
32
|
+
* onDeactivateEvent() {
|
|
33
|
+
* me.input.releasePointerEvent("pointermove", this);
|
|
34
|
+
* super.onDeactivateEvent();
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
8
37
|
*/
|
|
9
38
|
export default class UIBaseElement extends Container {
|
|
10
39
|
/**
|
|
@@ -65,12 +94,28 @@ export default class UIBaseElement extends Container {
|
|
|
65
94
|
*/
|
|
66
95
|
onMove(_event?: Pointer): void;
|
|
67
96
|
/**
|
|
68
|
-
* function called when the pointer is over the object
|
|
97
|
+
* function called when the pointer is over the object.
|
|
98
|
+
*
|
|
99
|
+
* Fires once, on the frame the pointer crosses into the element. To stay
|
|
100
|
+
* opaque for as long as the pointer rests on it, an element also wants a
|
|
101
|
+
* `"pointermove"` callback registered through
|
|
102
|
+
* {@link input.registerPointerEvent} returning `false`, since by then the
|
|
103
|
+
* pointer is already inside and this no longer runs.
|
|
69
104
|
* @param _event - the event object
|
|
105
|
+
* @returns return false if we need to stop propagating the event, so that an
|
|
106
|
+
* element covered by this one does not also light up on hover
|
|
70
107
|
*/
|
|
71
|
-
onOver(_event?: Pointer): void;
|
|
108
|
+
onOver(_event?: Pointer): boolean | void;
|
|
72
109
|
/**
|
|
73
|
-
* function called when the pointer is leaving the object area
|
|
110
|
+
* function called when the pointer is leaving the object area.
|
|
111
|
+
*
|
|
112
|
+
* Fires when the pointer leaves the element's bounds, and also when it is
|
|
113
|
+
* still inside them but something drawn above has consumed the move, since
|
|
114
|
+
* the pointer is then over that instead.
|
|
115
|
+
*
|
|
116
|
+
* Unlike {@link UIBaseElement#onOver} this one cannot consume the event, on
|
|
117
|
+
* purpose: an element that suppressed its own leave would stay in its hover
|
|
118
|
+
* state after the pointer had gone.
|
|
74
119
|
* @param _event - the event object
|
|
75
120
|
*/
|
|
76
121
|
onOut(_event?: Pointer): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uibaseelement.d.ts","sourceRoot":"","sources":["../../../src/renderable/ui/uibaseelement.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAIvD,OA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CAAC,EAAE,OAAO,GAAG,OAAO;IAkBpC;;;OAGG;IACH,MAAM,IAAI,IAAI;CA4Dd"}
|
|
@@ -74,12 +74,28 @@ export default class UISpriteElement extends Sprite {
|
|
|
74
74
|
*/
|
|
75
75
|
onClick(_event?: Pointer): boolean;
|
|
76
76
|
/**
|
|
77
|
-
* function called when the pointer is over the object
|
|
77
|
+
* function called when the pointer is over the object.
|
|
78
|
+
*
|
|
79
|
+
* Fires once, on the frame the pointer crosses into the element. To stay
|
|
80
|
+
* opaque for as long as the pointer rests on it, an element also wants a
|
|
81
|
+
* `"pointermove"` callback registered through
|
|
82
|
+
* {@link input.registerPointerEvent} returning `false`, since by then the
|
|
83
|
+
* pointer is already inside and this no longer runs.
|
|
78
84
|
* @param _event - the event object
|
|
85
|
+
* @returns return false if we need to stop propagating the event, so that an
|
|
86
|
+
* element covered by this one does not also light up on hover
|
|
79
87
|
*/
|
|
80
|
-
onOver(_event?: Pointer): void;
|
|
88
|
+
onOver(_event?: Pointer): boolean | void;
|
|
81
89
|
/**
|
|
82
|
-
* function called when the pointer is leaving the object area
|
|
90
|
+
* function called when the pointer is leaving the object area.
|
|
91
|
+
*
|
|
92
|
+
* Fires when the pointer leaves the element's bounds, and also when it is
|
|
93
|
+
* still inside them but something drawn above has consumed the move, since
|
|
94
|
+
* the pointer is then over that instead.
|
|
95
|
+
*
|
|
96
|
+
* Unlike {@link UISpriteElement#onOver} this one cannot consume the event, on
|
|
97
|
+
* purpose: an element that suppressed its own leave would stay in its hover
|
|
98
|
+
* state after the pointer had gone.
|
|
83
99
|
* @param _event - the event object
|
|
84
100
|
*/
|
|
85
101
|
onOut(_event?: Pointer): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uispriteelement.d.ts","sourceRoot":"","sources":["../../../src/renderable/ui/uispriteelement.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAC;AAEpD,OAAO,MAAM,MAAM,gBAAgB,CAA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,QAAQ,EAAE;QAAE,KAAK,EAAE,GAAG,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE;IAyC7C;;;;OAIG;IAEH,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAelC;;;;;;;;;;;OAWG;IAEH,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI;IAgBxC;;;;;;;;;;;OAWG;IAEH,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI;IAmB7B;;;;OAIG;IAEH,SAAS,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAkBpC;;;OAGG;IACH,MAAM,IAAI,IAAI;CAyCd"}
|
package/build/state/stage.d.ts
CHANGED
|
@@ -60,6 +60,17 @@ export default class Stage {
|
|
|
60
60
|
* returns early and the lights still draw as additive glows.
|
|
61
61
|
* @default rgba(0,0,0,0)
|
|
62
62
|
* @see Light2d
|
|
63
|
+
* @see {@link Stage#ambientLightingColor} for the other, easily confused knob
|
|
64
|
+
* @see [Lights example](https://melonjs.github.io/melonJS/examples/#/lights)
|
|
65
|
+
* @example
|
|
66
|
+
* class PlayScene extends Stage {
|
|
67
|
+
* onResetEvent() {
|
|
68
|
+
* // near-black night. The alpha is what turns the pass ON:
|
|
69
|
+
* // leave it at 0 and lights still glow, but nothing darkens
|
|
70
|
+
* this.ambientLight.parseCSS("#0a0a1ee0");
|
|
71
|
+
* this.addChild(new Light2d(x, y, 200, 200, "#ffcc88", 1));
|
|
72
|
+
* }
|
|
73
|
+
* }
|
|
63
74
|
*/
|
|
64
75
|
ambientLight: Color;
|
|
65
76
|
/**
|
|
@@ -70,6 +81,17 @@ export default class Stage {
|
|
|
70
81
|
* black. Defaults to black (0, 0, 0) — sprites without a
|
|
71
82
|
* `normalMap` ignore it entirely.
|
|
72
83
|
* @default "#000000"
|
|
84
|
+
* @see {@link Stage#ambientLight} for the darkness overlay, which is a
|
|
85
|
+
* different knob with a confusingly similar name
|
|
86
|
+
* @see [Normal Map example](https://melonjs.github.io/melonJS/examples/#/normal-map)
|
|
87
|
+
* @example
|
|
88
|
+
* class PlayScene extends Stage {
|
|
89
|
+
* onResetEvent() {
|
|
90
|
+
* // without this the hemisphere facing away from every light
|
|
91
|
+
* // renders pure black, which reads as a hole in the sprite
|
|
92
|
+
* this.ambientLightingColor.setColor(60, 60, 70);
|
|
93
|
+
* }
|
|
94
|
+
* }
|
|
73
95
|
*/
|
|
74
96
|
ambientLightingColor: Color;
|
|
75
97
|
/**
|
|
@@ -1 +1 @@
|
|
|
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,KAAK,OAAO,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,uBAAuB,CAAC;AAE/C,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AAEnD,UAAU,aAAa;IACtB,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,KACb,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,KACR,QAAQ,CAAC;IACd,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,CAA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AAQ,EAAE,aAAa,CAAC;IAExB;;;;;OAKG;gBACS,QAAQ,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC;IA2K7C;;;;;OAKG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAgB3B;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IAM5C;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,CACX,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,QAAQ,EAChB,UAAU,GAAE,MAAuC,EACnD,UAAU,GAAE,MAAuC,GACjD,IAAI;IAuEP;;;;;;;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"}
|
|
@@ -76,7 +76,7 @@ declare class ObjectPool {
|
|
|
76
76
|
/**
|
|
77
77
|
* Pull a new instance of the requested object (if added into the object pool)
|
|
78
78
|
* @param {string} name - as used in {@link pool.register}
|
|
79
|
-
* @param {...*}
|
|
79
|
+
* @param {...*} args - arguments to be passed when instantiating/reinitializing the object
|
|
80
80
|
* @returns {object} the instance of the requested object
|
|
81
81
|
* @example
|
|
82
82
|
* me.pool.register("bullet", BulletEntity, true);
|
|
@@ -94,7 +94,7 @@ declare class ObjectPool {
|
|
|
94
94
|
* app.world.removeChild(enemy);
|
|
95
95
|
* app.world.removeChild(bullet);
|
|
96
96
|
*/
|
|
97
|
-
pull(name: string, ...args
|
|
97
|
+
pull(name: string, ...args: any[]): object;
|
|
98
98
|
/**
|
|
99
99
|
* purge the object pool from any inactive object <br>
|
|
100
100
|
* Object pooling must be enabled for this function to work<br>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy_pool.d.ts","sourceRoot":"","sources":["../../src/system/legacy_pool.js"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,kEAEC;;AAmND;;;;;;;;;;;;;;GAcG;AACH,+BAA8B;AAhO9B;;;;;;;;;;;;GAYG;AACH;IAEE,gBAAqB;IACrB,yBAAyB;IAEzB;;;;;;;;;;;;;;OAcG;IACH,mBARU,OAAO,CAQY;IAG9B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,oBAhBW,MAAM,YACN,MAAM,cACN,OAAO,QAsCjB;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,WAnBW,MAAM,
|
|
1
|
+
{"version":3,"file":"legacy_pool.d.ts","sourceRoot":"","sources":["../../src/system/legacy_pool.js"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,kEAEC;;AAmND;;;;;;;;;;;;;;GAcG;AACH,+BAA8B;AAhO9B;;;;;;;;;;;;GAYG;AACH;IAEE,gBAAqB;IACrB,yBAAyB;IAEzB;;;;;;;;;;;;;;OAcG;IACH,mBARU,OAAO,CAQY;IAG9B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,oBAhBW,MAAM,YACN,MAAM,cACN,OAAO,QAsCjB;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,WAnBW,MAAM,WACH,GAAC,EAAA,GACF,MAAM,CAsClB;IAED;;;;OAIG;IACH,cAOC;IAED;;;;;;;;;OASG;IACH,UAJW,MAAM,iBACN,OAAO,GACL,OAAO,CAgBnB;IAED;;;;OAIG;IACH,aAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;;;;;;;OAUG;IACH,cAPW,MAAM,GACJ,OAAO,CAcnB;IAED;;;OAGG;IACH,oBAFa,MAAM,CAIlB;CACD"}
|
package/build/system/pool.d.ts
CHANGED
|
@@ -12,6 +12,16 @@ export interface CreatePoolOptions<T, A extends unknown[]> {
|
|
|
12
12
|
reset?: Reset<A>;
|
|
13
13
|
release?: Release;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Register a pool instance to the pool registry.
|
|
17
|
+
*
|
|
18
|
+
* Public because `pool.js` re-exports it. Marked internal it was stripped
|
|
19
|
+
* from the declarations while that re-export kept naming it, which left the
|
|
20
|
+
* public `pool` module exporting something no longer declared.
|
|
21
|
+
* @param key - the name this pool is reachable by
|
|
22
|
+
* @param pool - the pool instance to register under it
|
|
23
|
+
*/
|
|
24
|
+
export declare const registerPool: (key: string, pool: Pool<any, any[]>) => void;
|
|
15
25
|
export declare const createPool: <T, A extends unknown[]>(options: (...args: A) => CreatePoolOptions<T, A>) => Pool<T, A>;
|
|
16
26
|
export {};
|
|
17
27
|
//# sourceMappingURL=pool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../src/system/pool.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,IAAI,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,EAAE;IAC3C,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;IACzB,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,MAAM,CAAC;IACf,IAAI,IAAI,MAAM,CAAC;CACf;AAED,KAAK,KAAK,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;AACrE,KAAK,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;AAExC,MAAM,WAAW,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,EAAE;IACxD,QAAQ,EAAE,CAAC,CAAC;IACZ,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../../src/system/pool.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,IAAI,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,EAAE;IAC3C,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;IACzB,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,MAAM,CAAC;IACf,IAAI,IAAI,MAAM,CAAC;CACf;AAED,KAAK,KAAK,CAAC,CAAC,SAAS,OAAO,EAAE,IAAI,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;AACrE,KAAK,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;AAExC,MAAM,WAAW,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,EAAE;IACxD,QAAQ,EAAE,CAAC,CAAC;IACZ,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAKD;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,EAAE,MAAM,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,SAE/D,CAAC;AAQF,eAAO,MAAM,UAAU,GAAI,CAAC,EAAE,CAAC,SAAS,OAAO,EAAE,EAChD,SAAS,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,KAC9C,IAAI,CAAC,CAAC,EAAE,CAAC,CA0EX,CAAC"}
|
package/build/tweens/tween.d.ts
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import { EasingFunction } from "./easing.js";
|
|
2
2
|
import { InterpolationFunction } from "./interpolation.js";
|
|
3
|
+
/**
|
|
4
|
+
* Called once when a tween starts, with `this` bound to the tweened object.
|
|
5
|
+
* @see Tween#onStart
|
|
6
|
+
*/
|
|
7
|
+
export type OnStartCallback<T> = (this: T) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Called on every tween step with the eased progress in `[0, 1]`, and `this`
|
|
10
|
+
* bound to the tweened object.
|
|
11
|
+
* @see Tween#onUpdate
|
|
12
|
+
*/
|
|
13
|
+
export type OnUpdateCallback<T> = (this: T, value: number) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Called once when a tween finishes, with `this` bound to the tweened object.
|
|
16
|
+
* @see Tween#onComplete
|
|
17
|
+
*/
|
|
18
|
+
export type OnCompleteCallback<T> = (this: T) => void;
|
|
3
19
|
/**
|
|
4
20
|
* A tweening engine for smoothly interpolating object properties over time.
|
|
5
21
|
* Based on <a href="https://github.com/sole/Tween.js">tween.js</a> with
|
|
@@ -140,12 +156,43 @@ export default class Tween {
|
|
|
140
156
|
onComplete(onCompleteCallback: OnCompleteCallback<object>): this;
|
|
141
157
|
/**
|
|
142
158
|
* Available easing functions, accessed via `Tween.Easing`.
|
|
143
|
-
*
|
|
144
|
-
*
|
|
159
|
+
*
|
|
160
|
+
* Eleven families, each providing `In`, `Out` and `InOut`. `In` applies the
|
|
161
|
+
* curve at the start, `Out` at the end, and `InOut` at both. `Out` is what
|
|
162
|
+
* most UI wants: the value arrives decisively rather than creeping in.
|
|
163
|
+
*
|
|
164
|
+
* | family | shape | reach for it when |
|
|
165
|
+
* | --- | --- | --- |
|
|
166
|
+
* | `Linear.None` | no curve at all | the value IS the progress, e.g. a loading bar |
|
|
167
|
+
* | `Quadratic` `Cubic` `Quartic` `Quintic` | progressively sharper power curves | general motion; higher powers start slower and finish harder |
|
|
168
|
+
* | `Sinusoidal` | gentlest of all | a drift or a breath that should not call attention |
|
|
169
|
+
* | `Exponential` | extreme, near-instant at one end | something that snaps |
|
|
170
|
+
* | `Circular` | hard, like the quarter of a circle | a mechanical slide |
|
|
171
|
+
* | `Back` | **overshoots past the target and settles back** | impact: a stamp, a button press, anything that should land rather than arrive |
|
|
172
|
+
* | `Elastic` | overshoots repeatedly, oscillating | springy, cartoon motion |
|
|
173
|
+
* | `Bounce` | lands and bounces, settling | something falling onto a surface |
|
|
174
|
+
*
|
|
175
|
+
* `Back` and `Elastic` overshoot, so the value LEAVES the range between
|
|
176
|
+
* your start and end: clamp anything that cannot take it, an opacity or a
|
|
177
|
+
* colour channel in particular. Note the direction of the overshoot follows
|
|
178
|
+
* the direction of travel, so a value tweened DOWN to its target overshoots
|
|
179
|
+
* below it.
|
|
180
|
+
* @see https://easings.net/ for a visual reference of every curve
|
|
145
181
|
* @example
|
|
146
182
|
* me.Tween.Easing.Quadratic.InOut
|
|
147
183
|
* me.Tween.Easing.Bounce.Out
|
|
148
184
|
* me.Tween.Easing.Elastic.In
|
|
185
|
+
* @example
|
|
186
|
+
* // a stamp: scale falls to 1 and springs through it
|
|
187
|
+
* const driver = { scale: 5 };
|
|
188
|
+
* new me.Tween(driver)
|
|
189
|
+
* .to({ scale: 1 }, { duration: 420 })
|
|
190
|
+
* .easing(me.Tween.Easing.Back.Out)
|
|
191
|
+
* .onUpdate(() => {
|
|
192
|
+
* label.currentTransform.identity();
|
|
193
|
+
* label.scale(driver.scale);
|
|
194
|
+
* })
|
|
195
|
+
* .start();
|
|
149
196
|
*/
|
|
150
197
|
static get Easing(): {
|
|
151
198
|
Linear: {
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;;;GAGG;AACH,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,I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