melonjs 20.10.1 → 20.12.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 +4 -5
- package/build/application/application.d.ts.map +1 -1
- package/build/application/defaultApplicationSettings.d.ts +1 -0
- package/build/application/defaultApplicationSettings.d.ts.map +1 -1
- package/build/application/settings.d.ts +54 -3
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/audio.d.ts +14 -4
- package/build/audio/audio.d.ts.map +1 -1
- package/build/audio/backend/sound.d.ts.map +1 -1
- package/build/audio/playback.d.ts.map +1 -1
- package/build/audio/spatial.d.ts +13 -2
- package/build/audio/spatial.d.ts.map +1 -1
- package/build/audio/types.d.ts +44 -4
- package/build/audio/types.d.ts.map +1 -1
- package/build/camera/camera2d.d.ts +48 -4
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/camera/camera3d.d.ts.map +1 -1
- package/build/camera/effects/pixelate_transition_effect.d.ts +67 -0
- package/build/camera/effects/pixelate_transition_effect.d.ts.map +1 -0
- package/build/camera/effects/shake_effect.d.ts +3 -1
- package/build/camera/effects/shake_effect.d.ts.map +1 -1
- package/build/geometries/ellipse.d.ts +8 -4
- package/build/geometries/ellipse.d.ts.map +1 -1
- package/build/geometries/line.d.ts +2 -2
- package/build/geometries/line.d.ts.map +1 -1
- package/build/geometries/polygon.d.ts +3 -3
- package/build/geometries/polygon.d.ts.map +1 -1
- package/build/geometries/rectangle.d.ts +2 -2
- package/build/geometries/rectangle.d.ts.map +1 -1
- package/build/geometries/roundrect.d.ts +2 -2
- package/build/geometries/roundrect.d.ts.map +1 -1
- package/build/index.d.ts +5 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +9944 -6234
- package/build/index.js.map +4 -4
- package/build/input/gamepad.d.ts.map +1 -1
- package/build/input/pointerevent.d.ts.map +1 -1
- package/build/lang/console.d.ts +16 -1
- package/build/lang/console.d.ts.map +1 -1
- package/build/level/tiled/TMXLayer.d.ts +1 -1
- package/build/level/tiled/TMXLayer.d.ts.map +1 -1
- package/build/level/tiled/TMXObject.d.ts +196 -1
- package/build/level/tiled/TMXObject.d.ts.map +1 -1
- package/build/level/tiled/TMXObjectFactory.d.ts +18 -5
- package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -1
- package/build/level/tiled/TMXTile.d.ts.map +1 -1
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
- package/build/level/tiled/TMXTileset.d.ts +17 -1
- package/build/level/tiled/TMXTileset.d.ts.map +1 -1
- package/build/level/tiled/TMXUtils.d.ts.map +1 -1
- package/build/level/tiled/factories/shape.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
- package/build/lighting/light2d.d.ts +30 -0
- package/build/lighting/light2d.d.ts.map +1 -1
- package/build/loader/loadingscreen.d.ts.map +1 -1
- package/build/math/matrix2d.d.ts +3 -2
- package/build/math/matrix2d.d.ts.map +1 -1
- package/build/math/matrix3d.d.ts +4 -1
- package/build/math/matrix3d.d.ts.map +1 -1
- package/build/particles/emitter.d.ts.map +1 -1
- package/build/particles/particle.d.ts.map +1 -1
- package/build/particles/settings.d.ts +25 -0
- package/build/particles/settings.d.ts.map +1 -1
- package/build/physics/bounds.d.ts +5 -5
- package/build/physics/bounds.d.ts.map +1 -1
- package/build/physics/builtin/body.d.ts +1 -0
- 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.map +1 -1
- package/build/physics/builtin/raycast.d.ts.map +1 -1
- package/build/physics/builtin/sat.d.ts +40 -1
- package/build/physics/builtin/sat.d.ts.map +1 -1
- package/build/renderable/animation.d.ts +16 -2
- package/build/renderable/animation.d.ts.map +1 -1
- package/build/renderable/colorlayer.d.ts.map +1 -1
- package/build/renderable/container.d.ts +22 -2
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/entity/entity.d.ts.map +1 -1
- package/build/renderable/frameAnimation.d.ts.map +1 -1
- package/build/renderable/imagelayer.d.ts.map +1 -1
- package/build/renderable/instanced_mesh.d.ts.map +1 -1
- package/build/renderable/mesh.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts +69 -1
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +23 -7
- package/build/renderable/sprite.d.ts.map +1 -1
- package/build/renderable/sprite3d.d.ts +5 -3
- package/build/renderable/sprite3d.d.ts.map +1 -1
- package/build/renderable/text/text.d.ts.map +1 -1
- package/build/renderable/trail3d.d.ts.map +1 -1
- package/build/renderable/ui/uipanel.d.ts +3 -3
- package/build/renderable/ui/uipanel.d.ts.map +1 -1
- package/build/state/stage.d.ts +12 -4
- package/build/state/stage.d.ts.map +1 -1
- package/build/state/state.d.ts +31 -6
- package/build/state/state.d.ts.map +1 -1
- package/build/system/legacy_pool.d.ts.map +1 -1
- package/build/system/timer.d.ts +1 -0
- package/build/system/timer.d.ts.map +1 -1
- package/build/utils/fetchdata.d.ts.map +1 -1
- package/build/video/buffer/vertex.d.ts.map +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +8 -7
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/effects/ambientlight.d.ts +2 -0
- package/build/video/effects/ambientlight.d.ts.map +1 -0
- package/build/video/effects/bloom.d.ts +8 -9
- package/build/video/effects/bloom.d.ts.map +1 -1
- package/build/video/effects/blur.d.ts +3 -2
- package/build/video/effects/blur.d.ts.map +1 -1
- package/build/video/effects/chromaticAberration.d.ts +3 -2
- package/build/video/effects/chromaticAberration.d.ts.map +1 -1
- package/build/video/effects/dissolve.d.ts +5 -2
- package/build/video/effects/dissolve.d.ts.map +1 -1
- package/build/video/effects/dropShadow.d.ts +15 -3
- package/build/video/effects/dropShadow.d.ts.map +1 -1
- package/build/video/effects/flash.d.ts +6 -2
- package/build/video/effects/flash.d.ts.map +1 -1
- package/build/video/effects/frame.d.ts +48 -0
- package/build/video/effects/frame.d.ts.map +1 -0
- package/build/video/effects/glow.d.ts +8 -4
- package/build/video/effects/glow.d.ts.map +1 -1
- package/build/video/effects/glsl_realization.d.ts.map +1 -1
- package/build/video/effects/hologram.d.ts +5 -2
- package/build/video/effects/hologram.d.ts.map +1 -1
- package/build/video/effects/local_space.d.ts +19 -0
- package/build/video/effects/local_space.d.ts.map +1 -0
- package/build/video/effects/mesh_splice.d.ts.map +1 -1
- package/build/video/effects/outline.d.ts +8 -4
- package/build/video/effects/outline.d.ts.map +1 -1
- package/build/video/effects/pixelate.d.ts +3 -2
- package/build/video/effects/pixelate.d.ts.map +1 -1
- package/build/video/effects/radialGradient.d.ts +13 -16
- package/build/video/effects/radialGradient.d.ts.map +1 -1
- package/build/video/effects/rgba.d.ts +2 -0
- package/build/video/effects/rgba.d.ts.map +1 -0
- package/build/video/effects/scanline.d.ts.map +1 -1
- package/build/video/effects/shadereffect.d.ts +13 -0
- package/build/video/effects/shadereffect.d.ts.map +1 -1
- package/build/video/effects/shine.d.ts +10 -2
- package/build/video/effects/shine.d.ts.map +1 -1
- package/build/video/effects/squish.d.ts.map +1 -1
- package/build/video/effects/sway.d.ts +69 -0
- package/build/video/effects/sway.d.ts.map +1 -0
- package/build/video/effects/tintPulse.d.ts +5 -2
- package/build/video/effects/tintPulse.d.ts.map +1 -1
- package/build/video/effects/vignette.d.ts.map +1 -1
- package/build/video/effects/wave.d.ts +21 -2
- package/build/video/effects/wave.d.ts.map +1 -1
- package/build/video/effects/wgsl/parse.d.ts.map +1 -1
- package/build/video/effects/wgsl/scaffold.d.ts.map +1 -1
- package/build/video/effects/wgsl_realization.d.ts.map +1 -1
- package/build/video/gpu/frame.d.ts +2 -0
- package/build/video/gpu/frame.d.ts.map +1 -0
- package/build/video/renderer.d.ts +37 -12
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/rendertarget/canvasrendertarget.d.ts +14 -4
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/rendertarget.d.ts +12 -16
- package/build/video/rendertarget/rendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/webgpurendertarget.d.ts +1 -0
- package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
- package/build/video/texture/atlas.d.ts +47 -28
- package/build/video/texture/atlas.d.ts.map +1 -1
- package/build/video/texture/cache.d.ts.map +1 -1
- package/build/video/utils/pixel_snap.d.ts +44 -0
- package/build/video/utils/pixel_snap.d.ts.map +1 -0
- package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/quad_batcher.d.ts +2 -1
- package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/glshader.d.ts.map +1 -1
- package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
- package/build/video/webgl/shaders/frameclamp.d.ts +2 -0
- package/build/video/webgl/shaders/frameclamp.d.ts.map +1 -0
- package/build/video/webgl/shaders/multitexture-lit.d.ts.map +1 -1
- package/build/video/webgl/shaders/multitexture.d.ts.map +1 -1
- package/build/video/webgl/utils/uniforms.d.ts.map +1 -1
- package/build/video/webgl/webgl_renderer.d.ts +0 -21
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts +2 -1
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/mesh_batcher.d.ts +0 -1
- package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/quad_batcher.d.ts +2 -2
- package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/buffer/uniformring.d.ts.map +1 -1
- package/build/video/webgpu/effect_binding.d.ts.map +1 -1
- package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
- package/build/video/webgpu/webgpu_renderer.d.ts +3 -4
- package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/package.json +21 -19
- package/skills/AGENTS.md +2 -1
- package/skills/melonjs/SKILL.md +1 -0
- package/skills/melonjs-audio/SKILL.md +47 -5
- package/skills/melonjs-camera-and-drawing/SKILL.md +63 -1
- package/skills/melonjs-display-and-scaling/SKILL.md +117 -7
- package/skills/melonjs-effects-and-shaders/SKILL.md +136 -19
- package/skills/melonjs-input/SKILL.md +24 -2
- package/skills/melonjs-lighting/SKILL.md +43 -8
- package/skills/melonjs-loading-assets/SKILL.md +4 -3
- package/skills/melonjs-math/SKILL.md +21 -1
- package/skills/melonjs-particles-and-trails/SKILL.md +36 -2
- package/skills/melonjs-performance/SKILL.md +4 -0
- package/skills/melonjs-plugins/SKILL.md +20 -1
- package/skills/melonjs-renderables/SKILL.md +46 -6
- package/skills/melonjs-renderer-backends/SKILL.md +2 -2
- package/skills/melonjs-scenes-and-state/SKILL.md +17 -2
- package/skills/melonjs-sprites-and-animation/SKILL.md +19 -3
- package/skills/melonjs-tilemaps/SKILL.md +126 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trail3d.d.ts","sourceRoot":"","sources":["../../src/renderable/trail3d.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"trail3d.d.ts","sourceRoot":"","sources":["../../src/renderable/trail3d.js"],"names":[],"mappings":"AA6BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH;IACC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,eAzBW,MAAM,KAEN,MAAM,aAEd;QAAuC,MAAM;QACnB,MAAM;QAIN,QAAQ;QACR,WAAW;Q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,CAuBlB;IAED;;;;;;OAMG;IACH,eALW,QAAQ,aACR,QAAQ,QA0BlB;IAED;;;;;OAKG;IACH,sBAJW,QAAQ,QA2FlB;IAED;;;;;;;OAOG;IACH,kBAJa,MAAM,GAAC,IAAI,CAsCvB;IAwBD;;;;;;;OAOG;IACH,uBAJa,MAAM,CAwBlB;CAmBD;iBAptBgB,WAAW;4BAMD,iBAAiB;yBATnB,qBAAqB;8BAQnB,sBAAsB;2BADzB,kBAAkB;0BAGjB,sBAAsB;qBAd1B,uBAAuB"}
|
|
@@ -112,9 +112,9 @@ export default class UIPanel extends UIBaseElement {
|
|
|
112
112
|
* covers twice it over a cycle; 2 to 4 is the usual range, and it starts
|
|
113
113
|
* by rising rather than sinking.
|
|
114
114
|
*
|
|
115
|
-
* Do not go much below 2. The
|
|
116
|
-
*
|
|
117
|
-
*
|
|
115
|
+
* Do not go much below 2. The offset is a whole number of pixels, so an
|
|
116
|
+
* amplitude of 1 has three positions to move between and the panel
|
|
117
|
+
* twitches rather than drifts.
|
|
118
118
|
*
|
|
119
119
|
* The panel is CLICKABLE where it is drawn: the offset goes into
|
|
120
120
|
* {@link UIPanel#getAbsolutePosition}, which is what the bounds pipeline
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uipanel.d.ts","sourceRoot":"","sources":["../../../src/renderable/ui/uipanel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,0BAA0B,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,QAAQ,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,mCAAmC;IACnC,KAAK,EAAE,M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C,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe;IA8D3D;;;;OAIG;IACM,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAmBpC;;;;OAIG;IACM,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,QAAQ;IA6CrD;;;;;;;;;;;;;;;;;;OAkBG;IACM,mBAAmB,IAAI,QAAQ;IAMxC;;;;;;;;OAQG;cACgB,iBAAiB,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ;IAS7D;;;;;;;;;;;;;;;;;;OAkBG;IACM,YAAY,CAAC,QAAQ,UAAO;IAQrC;;;;;;;;OAQG;IACM,OAAO,IAAI,OAAO;IAI3B;;;;;;;;;OASG;IACM,SAAS,IAAI,OAAO;IAI7B;;;;;;OAMG;IACM,MAAM,IAAI,OAAO;IAI1B;;;OAGG;IACM,cAAc;CAIvB"}
|
package/build/state/stage.d.ts
CHANGED
|
@@ -58,6 +58,9 @@ export default class Stage {
|
|
|
58
58
|
* an ambient light that will be added to the stage rendering. Its alpha
|
|
59
59
|
* is what gates the lighting pass: at alpha 0 (the default) `drawLighting`
|
|
60
60
|
* returns early and the lights still draw as additive glows.
|
|
61
|
+
*
|
|
62
|
+
* Every active {@link Light2d} cuts a hole in it, hard-edged unless the
|
|
63
|
+
* light has a {@link Light2d#softness}.
|
|
61
64
|
* @default rgba(0,0,0,0)
|
|
62
65
|
* @see Light2d
|
|
63
66
|
* @see {@link Stage#ambientLightingColor} for the other, easily confused knob
|
|
@@ -132,15 +135,20 @@ export default class Stage {
|
|
|
132
135
|
* Renderables); this pass only paints the dark fill that the lights cut
|
|
133
136
|
* holes through.
|
|
134
137
|
*
|
|
138
|
+
* A light with a {@link Light2d#softness} takes the whole pass to the
|
|
139
|
+
* renderer's soft path, which fades each hole along the light's falloff.
|
|
140
|
+
*
|
|
135
141
|
* Subclasses can override this method to implement custom lighting (e.g.
|
|
136
|
-
* per-pixel normal-mapped lighting via a custom shader)
|
|
137
|
-
* camera per
|
|
142
|
+
* per-pixel normal-mapped lighting via a custom shader), or to skip a
|
|
143
|
+
* camera (a minimap showing the level lit). Called once per camera per
|
|
144
|
+
* frame.
|
|
138
145
|
* @param renderer - the active renderer
|
|
139
146
|
* @param camera - the camera currently rendering this stage
|
|
140
147
|
* @param translateX - the same world-to-screen X translate that
|
|
141
148
|
* `Camera2d.draw()` applies to the world container (i.e.
|
|
142
|
-
* `camera.pos.x + camera.offset.x` for the default camera,
|
|
143
|
-
* the container's own offset for
|
|
149
|
+
* `camera.pos.x + camera.offset.x` for the default camera, on a whole
|
|
150
|
+
* pixel unless `subPixel` is set, plus the container's own offset for
|
|
151
|
+
* non-default cameras)
|
|
144
152
|
* @param translateY - the world-to-screen Y translate (see `translateX`)
|
|
145
153
|
*/
|
|
146
154
|
drawLighting(renderer: Renderer, camera: Camera2d, translateX?: number, translateY?: number): void;
|
|
@@ -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;
|
|
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,uBAA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,GACrE,IAAI;IAwGP;;;;;;;OAOG;IACH,YAAY,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAOxD;;;;OAIG;IACH,cAAc,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;CAMtC"}
|
package/build/state/state.d.ts
CHANGED
|
@@ -156,10 +156,18 @@ declare const state: {
|
|
|
156
156
|
current(): Stage | undefined;
|
|
157
157
|
/**
|
|
158
158
|
* specify a global transition effect
|
|
159
|
-
* @param effect - "fade" for a color fade, "mask" for a shape-based mask
|
|
160
|
-
*
|
|
161
|
-
*
|
|
162
|
-
* @
|
|
159
|
+
* @param effect - "fade" for a color fade, "mask" for a shape-based mask
|
|
160
|
+
* transition, "pixelate" for the screen breaking up into ever larger
|
|
161
|
+
* blocks, changing behind the largest, and coming back sharp (see
|
|
162
|
+
* {@link PixelateTransitionEffect}). A pixelate transition is a shader
|
|
163
|
+
* effect: on the Canvas renderer it does nothing, and the state changes
|
|
164
|
+
* directly.
|
|
165
|
+
* @param color - a CSS color value (not used by "pixelate")
|
|
166
|
+
* @param [duration=1000] - expressed in milliseconds, for each half: the
|
|
167
|
+
* cover, then the reveal
|
|
168
|
+
* @param [shape] - an Ellipse or Polygon defining the mask shape (required
|
|
169
|
+
* when effect is "mask"), or for "pixelate" the size of the largest
|
|
170
|
+
* blocks, in screen pixels (32 by default)
|
|
163
171
|
* @example
|
|
164
172
|
* // classic fade to black
|
|
165
173
|
* state.transition("fade", "#000", 500);
|
|
@@ -172,8 +180,13 @@ declare const state: {
|
|
|
172
180
|
* { x: 0, y: -1 }, { x: 1, y: 0 },
|
|
173
181
|
* { x: 0, y: 1 }, { x: -1, y: 0 },
|
|
174
182
|
* ]));
|
|
183
|
+
* @example
|
|
184
|
+
* // the screen breaks up into 32 pixel blocks, and comes back
|
|
185
|
+
* state.transition("pixelate", "#000", 300);
|
|
186
|
+
* // into 16 pixel blocks
|
|
187
|
+
* state.transition("pixelate", "#000", 300, 16);
|
|
175
188
|
*/
|
|
176
|
-
transition(effect: "fade" | "mask", color: string, duration?: number, shape?: import("../geometries/ellipse.ts").Ellipse | import("../geometries/polygon.ts").Polygon): void;
|
|
189
|
+
transition(effect: "fade" | "mask" | "pixelate", color: string, duration?: number, shape?: import("../geometries/ellipse.ts").Ellipse | import("../geometries/polygon.ts").Polygon | number): void;
|
|
177
190
|
/**
|
|
178
191
|
* enable/disable the transition to a particular state (by default enabled for all)
|
|
179
192
|
* @param stateId - State ID (see constants)
|
|
@@ -182,13 +195,25 @@ declare const state: {
|
|
|
182
195
|
setTransition(stateId: number, enable: boolean): void;
|
|
183
196
|
/**
|
|
184
197
|
* change the game/app state
|
|
198
|
+
*
|
|
199
|
+
* With a transition (see {@link state.transition}), the state changes once
|
|
200
|
+
* the transition covers the screen. A change asked for until then is made
|
|
201
|
+
* by that same transition rather than a second one: it switches to the
|
|
202
|
+
* last state asked for, with the last arguments given. A change to a state
|
|
203
|
+
* whose transition is off (see {@link state.setTransition}) does not wait
|
|
204
|
+
* for it, and the cover comes down as the state changes.
|
|
185
205
|
* @param stateId - State ID (see constants)
|
|
186
|
-
* @param [forceChange=false] - if true the state will be changed immediately (without waiting for the next frame)
|
|
206
|
+
* @param [forceChange=false] - if true the state will be changed immediately (without waiting for the next frame); ignored when a transition makes the change
|
|
187
207
|
* @param extraArgs - extra arguments to be passed to the reset functions
|
|
188
208
|
* @example
|
|
189
209
|
* // The onResetEvent method on the play screen will receive two args:
|
|
190
210
|
* // "level_1" and the number 3
|
|
191
211
|
* state.change(state.PLAY, false, "level_1", 3);
|
|
212
|
+
* @example
|
|
213
|
+
* // asked twice, by a key pressed twice on a menu: one transition, to PLAY
|
|
214
|
+
* state.transition("fade", "#000", 250);
|
|
215
|
+
* state.change(state.PLAY);
|
|
216
|
+
* state.change(state.PLAY);
|
|
192
217
|
*/
|
|
193
218
|
change(stateId: number, forceChange?: boolean, ...extraArgs: unknown[]): void;
|
|
194
219
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/state/state.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../src/state/state.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,MAAM,qBAAqB,CAAC;AA8YxC;;GAEG;AACH,QAAA,MAAM,KAAK;IACV;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;;;;;;OAOG;;IAGH;;;OAGG;4BACoB,OAAO,GAAW,IAAI;IAqB7C;;;OAGG;kBACU,OAAO,GAAW,IAAI;IAkBnC;;;OAGG;oBACY,OAAO,GAAW,IAAI;IAiBrC;;;OAGG;mBACW,OAAO,GAAW,IAAI;IAmBpC;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;qBACc,MAAM,UAAS,OAAO,GAAW,OAAO,CAAC,IAAI,CAAC;IAkC/D;;;OAGG;iBACU,OAAO;IAKpB;;;OAGG;gBACS,OAAO;IAInB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;iBACU,MAAM,SAAS,KAAK,UAAS,OAAO,GAAW,IAAI;IAchE;;;;;OAKG;kBACU,MAAM,GAAY,KAAK,GAAG,SAAS;IAQhD;;;;OAIG;eACQ,KAAK,GAAG,SAAS;IAI5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;uBAEM,MAAM,GAAG,MAAM,GAAG,UAAU,SAC7B,MAAM,aACH,MAAM,UAEb,OAAO,0BAA0B,EAAE,OAAO,GAC1C,OAAO,0BAA0B,EAAE,OAAO,GAC1C,MAAM,GACP,IAAI;IAQP;;;;OAIG;2BACoB,MAAM,UAAU,OAAO,GAAG,IAAI;IAIrD;;;;;;;;;;;;;;;;;;;;;OAqBG;oBAEO,MAAM,gBACF,OAAO,gBACN,OAAO,EAAE,GACrB,IAAI;IAuMP;;;;OAIG;uBACgB,MAAM,GAAG,OAAO;CAGnC,CAAC;AACF,eAAe,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legacy_pool.d.ts","sourceRoot":"","sources":["../../src/system/legacy_pool.js"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,kEAEC;;
|
|
1
|
+
{"version":3,"file":"legacy_pool.d.ts","sourceRoot":"","sources":["../../src/system/legacy_pool.js"],"names":[],"mappings":"AAUA;;;;;GAKG;AACH,kEAEC;;AA6PD;;;;;;;;;;;;;;GAcG;AACH,+BAA8B;AAvP9B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;IAEE,gBAAqB;IACrB,yBAAyB;IAEzB;;;;;;;;;;;;;;OAcG;IACH,mBARU,OAAO,CAQY;IAG9B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,oBAhBW,MAAM,YACN,MAAM,cACN,OAAO,QAuCjB;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,WAnBW,MAAM,WACH,GAAC,EAAA,GACF,MAAM,CAuClB;IAED;;;;OAIG;IACH,cAOC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,UALW,MAAM,iBACN,OAAO,GAEL,OAAO,CAiBnB;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/timer.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timer.d.ts","sourceRoot":"","sources":["../../src/system/timer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"timer.d.ts","sourceRoot":"","sources":["../../src/system/timer.ts"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,cAAM,KAAK;IACV,IAAI,EAAE,MA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OAAc,CAAC;AAE1B;;;;;;;;;;;;GAYG;AACH,eAAe,KAAK,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchdata.d.ts","sourceRoot":"","sources":["../../src/utils/fetchdata.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,oCANW,MAAM,aACN,MAAM,GACJ,OAAO,CAMnB;
|
|
1
|
+
{"version":3,"file":"fetchdata.d.ts","sourceRoot":"","sources":["../../src/utils/fetchdata.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,oCANW,MAAM,aACN,MAAM,GACJ,OAAO,CAMnB;AA0FD;;;;;;;;;;GAUG;AACH,mCALW,MAAM,gBA4DhB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,+BAfW,MAAM,gBACN,MAAM,aACN,MAAM,gBAwDhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vertex.d.ts","sourceRoot":"","sources":["../../../src/video/buffer/vertex.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vertex.d.ts","sourceRoot":"","sources":["../../../src/video/buffer/vertex.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH;IACC,6CAyBC;IAvBA,gBAA4B;IAE5B,eAA0B;IAE1B,oBAAoB;IAGpB,oBAEC;IAED,qCAA8C;IAC9C,oCAA6C;IAU7C,kCAA2C;IAG5C;;;;OAIG;IACH,cAEC;IAED;;;;OAIG;IACH,6BAEC;IAED;;;;;;;;;;;;;OAaG;IACH,QAVW,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,QACN,MAAM,GACJ,iBAAiB,CAiB7B;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,cAfW,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,KACN,MAAM,QACN,MAAM,aACN,MAAM,UACN,MAAM,UACN,MAAM,WACN,MAAM,WACN,MAAM,GACJ,iBAAiB,CA4B7B;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,mBAjBW;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,MACjC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,MACjC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,MACjC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,MACjC,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,QACN,MAAM,aACN,MAAM,UACN,OAAO,WACP,MAAM,WACN,MAAM,GACJ,iBAAiB,CA4E7B;IAED;;;;;;;OAOG;IACH,iBANW,SAAS,CAAC,MAAM,CAAC,aACjB,MAAM,SACN,MAAM,QAchB;IAED;;;;;;;;;OASG;IACH,kEAgBC;IAED;;;;;;OAMG;IACH,gGAoBC;IAED;;;;OAIG;IACH,2DAMC;IAED;;;;OAIG;IACH,yDAMC;IAED;;;;;;;OAOG;IACH,+DAMC;CACD"}
|
|
@@ -20,6 +20,13 @@
|
|
|
20
20
|
*/
|
|
21
21
|
export default class CanvasRenderer extends Renderer {
|
|
22
22
|
onGameReset: () => void;
|
|
23
|
+
/**
|
|
24
|
+
* sets or returns the shape used to join two line segments where they meet.
|
|
25
|
+
* There are three possible values for this property: "round", "bevel", and "miter"
|
|
26
|
+
* @type {string}
|
|
27
|
+
* @default "miter"
|
|
28
|
+
*/
|
|
29
|
+
get lineJoin(): string;
|
|
23
30
|
/**
|
|
24
31
|
* Capture the current frame into a {@link Texture2d} — the Canvas-renderer
|
|
25
32
|
* counterpart of {@link WebGLRenderer#toFrameTexture}, keeping the
|
|
@@ -299,13 +306,6 @@ export default class CanvasRenderer extends Renderer {
|
|
|
299
306
|
* @returns {number} global alpha value
|
|
300
307
|
*/
|
|
301
308
|
getGlobalAlpha(): number;
|
|
302
|
-
/**
|
|
303
|
-
* sets or returns the shape used to join two line segments where they meet.
|
|
304
|
-
* There are three possible values for this property: "round", "bevel", and "miter"
|
|
305
|
-
* @type {string}
|
|
306
|
-
* @default "miter"
|
|
307
|
-
*/
|
|
308
|
-
get lineJoin(): string;
|
|
309
309
|
/**
|
|
310
310
|
* Reset (overrides) the renderer transformation matrix to the
|
|
311
311
|
* identity one, and then apply the given transformation matrix.
|
|
@@ -328,6 +328,7 @@ export default class CanvasRenderer extends Renderer {
|
|
|
328
328
|
* @param {number} [f] - the f component to multiply the current matrix by; omitted when `a` is a matrix
|
|
329
329
|
*/
|
|
330
330
|
transform(a: Matrix2d | Matrix3d | number, b?: number, c?: number, d?: number, e?: number, f?: number): void;
|
|
331
|
+
#private;
|
|
331
332
|
}
|
|
332
333
|
import Renderer from "./../renderer.js";
|
|
333
334
|
import type { default as Texture2d } from "../texture/texture2d.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvas_renderer.d.ts","sourceRoot":"","sources":["../../../src/video/canvas/canvas_renderer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"canvas_renderer.d.ts","sourceRoot":"","sources":["../../../src/video/canvas/canvas_renderer.js"],"names":[],"mappings":"AA+CA;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACH;IAiBE;;;OAGG;IACH,oBAAmC;IA4BnC,wBAEC;IA+/CF;;;OAGG;IACH,oBAXU,MAAM,EAcf;IAjBD;;;;;OAKG;IACH,gBAHU,MAAM,CAKf;IAz8CA;;;OAGG;IACH,8CAA4B;IAG7B;;;;;;;;;;;;;;;;;OAiBG;IACH,yBATG;QAAiC,MAAM;QAIwC,MAAM;eAAlE,MAAM;eAAK,MAAM;mBAAS,MAAM;oBAAU,MAAM;;KAGnE,GAAU,SAAS,CA8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;IACH,2CAAkC;;CA6GpC;qBA94DoB,kBAAkB;yBACd,uBAAuB;0CA4CT,yBAAyB;4BADvC,yBAAyB;sBAvD5B,uBAAuB;sBA0DxB,0BAA0B;6BAPrB,6BAA6B;8BAG5B,wBAAwB;8BAGxB,wBAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ambientlight.d.ts","sourceRoot":"","sources":["../../../src/video/effects/ambientlight.js"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH;;;;;GAKG;AACH,iCAAkC,EAAE,CAAC;AAErC;;;;;;;;;;;;;;;;GAgBG;AACH;IACC;;OAEG;IACH,sBAFW,QAAQ,EA0ElB;IAjBA;;;;OAIG;IACH,mCAAuD;IACvD;;;;OAIG;IACH,mCAAuD;IACvD;;;OAGG;IACH,iCAAgC;IAGjC;;;;;;;;;OASG;IACH,kBARW,QAAQ,CAAC,OAAO,CAAC,KACjB,MAAM,KACN,MAAM,SACN,MAAM,UACN,MAAM,QA0ChB;CACD;yBAhKwB,mBAAmB;yBAKpB,2BAA2B;0BAD1B,gBAAgB"}
|
|
@@ -10,10 +10,9 @@
|
|
|
10
10
|
* Not to be confused with {@link GlowEffect}, which draws an outline OUTSIDE a
|
|
11
11
|
* sprite's silhouette and does nothing at all on an opaque frame.
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* {@link event.ONRESIZE} handler, or after applying it to something smaller.
|
|
13
|
+
* Its reach is in texels of what it filters: the screen for a camera's
|
|
14
|
+
* effect, the sprite's texture on a sprite (alone or with other effects, at
|
|
15
|
+
* any scale or zoom), so it follows a resize by itself.
|
|
17
16
|
* @category Effects
|
|
18
17
|
* @see {@link Renderable#addPostEffect} for usage
|
|
19
18
|
* @example
|
|
@@ -33,7 +32,7 @@ export default class BloomEffect extends ShaderEffect {
|
|
|
33
32
|
* @param {number} [options.threshold=0.75] - luminance a pixel must pass before it blooms, `0` (everything blooms) to `1` (only white does)
|
|
34
33
|
* @param {number} [options.intensity=1.0] - how much of the gathered light is added back
|
|
35
34
|
* @param {number} [options.radius=2.0] - halo reach, in texels
|
|
36
|
-
* @param {number[]} [options.textureSize] -
|
|
35
|
+
* @param {number[]} [options.textureSize] - the size, `[width, height]`, of the texture its reach is measured in; by default the texture it draws: a sprite's own, alone or with other effects and at any scale or zoom, the screen for a camera's effect
|
|
37
36
|
*/
|
|
38
37
|
constructor(renderer: Renderer, options?: {
|
|
39
38
|
threshold?: number | undefined;
|
|
@@ -60,10 +59,10 @@ export default class BloomEffect extends ShaderEffect {
|
|
|
60
59
|
*/
|
|
61
60
|
setRadius(radius: number): void;
|
|
62
61
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* @param {number} width - width in pixels
|
|
66
|
-
* @param {number} height - height in pixels
|
|
62
|
+
* Measure the effect's reach in the texels of a texture of this size,
|
|
63
|
+
* rather than of the texture it draws (the default)
|
|
64
|
+
* @param {number} width - texture width in pixels
|
|
65
|
+
* @param {number} height - texture height in pixels
|
|
67
66
|
*/
|
|
68
67
|
setTextureSize(width: number, height: number): void;
|
|
69
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bloom.d.ts","sourceRoot":"","sources":["../../../src/video/effects/bloom.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bloom.d.ts","sourceRoot":"","sources":["../../../src/video/effects/bloom.js"],"names":[],"mappings":"AA+HA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;IACC;;;;;;;OAOG;IACH,sBAPW,QAAQ,YAEhB;QAAyB,SAAS;QACT,SAAS;QACT,MAAM;QACJ,WAAW;KACxC,EAgBA;IAZA,kBAA0C;IAC1C,kBAAyC;IACzC,eAAmC;IAYpC;;;OAGG;IACH,wBAFW,MAAM,QAKhB;IAED;;;OAGG;IACH,wBAFW,MAAM,QAKhB;IAED;;;OAGG;IACH,kBAFW,MAAM,QAKhB;IAED;;;;;OAKG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;CACD;yBAvNwB,mBAAmB;0BAOnB,gBAAgB"}
|
|
@@ -13,7 +13,7 @@ export default class BlurEffect extends ShaderEffect {
|
|
|
13
13
|
* @param {Renderer} renderer - the current renderer instance
|
|
14
14
|
* @param {object} [options] - effect options
|
|
15
15
|
* @param {number} [options.strength=1.0] - blur strength in texels
|
|
16
|
-
* @param {number[]} [options.textureSize
|
|
16
|
+
* @param {number[]} [options.textureSize] - the size, `[width, height]`, of the texture its strength is measured in; by default the texture it draws: a sprite's own, alone or with other effects and at any scale or zoom, the screen for a camera's effect
|
|
17
17
|
*/
|
|
18
18
|
constructor(renderer: Renderer, options?: {
|
|
19
19
|
strength?: number | undefined;
|
|
@@ -26,7 +26,8 @@ export default class BlurEffect extends ShaderEffect {
|
|
|
26
26
|
*/
|
|
27
27
|
setStrength(strength: number): void;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Measure the effect's strength in the texels of a texture of this size,
|
|
30
|
+
* rather than of the texture it draws (the default)
|
|
30
31
|
* @param {number} width - texture width in pixels
|
|
31
32
|
* @param {number} height - texture height in pixels
|
|
32
33
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../src/video/effects/blur.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"blur.d.ts","sourceRoot":"","sources":["../../../src/video/effects/blur.js"],"names":[],"mappings":"AAoCA;;;;;;;;;GASG;AACH;IACC;;;;;OAKG;IACH,sBALW,QAAQ,YAEhB;QAAyB,QAAQ;QACN,WAAW;KACxC,EA+BA;IALA,iBAAuC;IAOxC;;;OAGG;IACH,sBAFW,MAAM,QAKhB;IAED;;;;;OAKG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;CACD;yBAtGwB,mBAAmB;0BAOnB,gBAAgB"}
|
|
@@ -16,7 +16,7 @@ export default class ChromaticAberrationEffect extends ShaderEffect {
|
|
|
16
16
|
* @param {Renderer} renderer - the current renderer instance
|
|
17
17
|
* @param {object} [options] - effect options
|
|
18
18
|
* @param {number} [options.offset=3.0] - channel offset in texels
|
|
19
|
-
* @param {number[]} [options.textureSize
|
|
19
|
+
* @param {number[]} [options.textureSize] - the size, `[width, height]`, of the texture its offset is measured in; by default the texture it draws: a sprite's own, alone or with other effects and at any scale or zoom, the screen for a camera's effect
|
|
20
20
|
*/
|
|
21
21
|
constructor(renderer: Renderer, options?: {
|
|
22
22
|
offset?: number | undefined;
|
|
@@ -29,7 +29,8 @@ export default class ChromaticAberrationEffect extends ShaderEffect {
|
|
|
29
29
|
*/
|
|
30
30
|
setOffset(offset: number): void;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Measure the effect's offset in the texels of a texture of this size,
|
|
33
|
+
* rather than of the texture it draws (the default)
|
|
33
34
|
* @param {number} width - texture width in pixels
|
|
34
35
|
* @param {number} height - texture height in pixels
|
|
35
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chromaticAberration.d.ts","sourceRoot":"","sources":["../../../src/video/effects/chromaticAberration.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chromaticAberration.d.ts","sourceRoot":"","sources":["../../../src/video/effects/chromaticAberration.js"],"names":[],"mappings":"AA6BA;;;;;;;;;;;;GAYG;AACH;IACC;;;;;OAKG;IACH,sBALW,QAAQ,YAEhB;QAAyB,MAAM;QACJ,WAAW;KACxC,EAwBA;IALA,eAAmC;IAOpC;;;OAGG;IACH,kBAFW,MAAM,QAKhB;IAED;;;;;OAKG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;CACD;yBA3FwB,mBAAmB;0BAOnB,gBAAgB"}
|
|
@@ -12,13 +12,16 @@
|
|
|
12
12
|
*
|
|
13
13
|
* // animate the dissolve (0 = fully visible, 1 = fully dissolved)
|
|
14
14
|
* dissolve.setProgress(0.5);
|
|
15
|
+
* @example
|
|
16
|
+
* // a dissolve whose edge glows only faintly over the sprite
|
|
17
|
+
* mySprite.addPostEffect(new DissolveEffect(renderer, { edgeColor: [1.0, 0.5, 0.0, 0.4] }));
|
|
15
18
|
*/
|
|
16
19
|
export default class DissolveEffect extends ShaderEffect {
|
|
17
20
|
/**
|
|
18
21
|
* @param {Renderer} renderer - the current renderer instance
|
|
19
22
|
* @param {object} [options] - effect options
|
|
20
23
|
* @param {number} [options.progress=0.0] - dissolve progress (0.0 = visible, 1.0 = dissolved)
|
|
21
|
-
* @param {number[]} [options.edgeColor=[1.0, 0.5, 0.0]] - color of the dissolve edge
|
|
24
|
+
* @param {number[]} [options.edgeColor=[1.0, 0.5, 0.0]] - color of the dissolve edge as [r, g, b] or [r, g, b, a] (0.0–1.0); the alpha is the edge's opacity
|
|
22
25
|
* @param {number} [options.edgeWidth=0.1] - width of the colored edge (0.0–1.0)
|
|
23
26
|
*/
|
|
24
27
|
constructor(renderer: Renderer, options?: {
|
|
@@ -34,7 +37,7 @@ export default class DissolveEffect extends ShaderEffect {
|
|
|
34
37
|
setProgress(value: number): void;
|
|
35
38
|
/**
|
|
36
39
|
* set the edge color
|
|
37
|
-
* @param {number[]} color - edge color as [r, g, b] (0.0–1.0)
|
|
40
|
+
* @param {number[]} color - edge color as [r, g, b] or [r, g, b, a] (0.0–1.0); the alpha is the edge's opacity
|
|
38
41
|
*/
|
|
39
42
|
setEdgeColor(color: number[]): void;
|
|
40
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dissolve.d.ts","sourceRoot":"","sources":["../../../src/video/effects/dissolve.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dissolve.d.ts","sourceRoot":"","sources":["../../../src/video/effects/dissolve.js"],"names":[],"mappings":"AAwEA;;;;;;;;;;;;;;;;;GAiBG;AACH;IACC;;;;;;OAMG;IACH,sBANW,QAAQ,YAEhB;QAAyB,QAAQ;QACN,SAAS;QACX,SAAS;KACpC,EAyDA;IAJA,iBAAuC;IAMxC;;;OAGG;IACH,mBAFW,MAAM,QAKhB;IAED;;;OAGG;IACH,oBAFW,MAAM,EAAE,QAIlB;CACD;yBA3KwB,mBAAmB;0BAOnB,gBAAgB"}
|
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
* color: [0.0, 0.0, 0.0],
|
|
13
13
|
* opacity: 0.5,
|
|
14
14
|
* }));
|
|
15
|
+
* @example
|
|
16
|
+
* // a soft blue shadow: the color's alpha scales `opacity`
|
|
17
|
+
* mySprite.addPostEffect(new DropShadowEffect(renderer, {
|
|
18
|
+
* color: [0.1, 0.2, 0.6, 0.5],
|
|
19
|
+
* opacity: 0.8,
|
|
20
|
+
* }));
|
|
15
21
|
*/
|
|
16
22
|
export default class DropShadowEffect extends ShaderEffect {
|
|
17
23
|
/**
|
|
@@ -19,9 +25,9 @@ export default class DropShadowEffect extends ShaderEffect {
|
|
|
19
25
|
* @param {object} [options] - effect options
|
|
20
26
|
* @param {number} [options.offsetX=2.0] - shadow x offset in texels
|
|
21
27
|
* @param {number} [options.offsetY=2.0] - shadow y offset in texels
|
|
22
|
-
* @param {number[]} [options.color=[0.0, 0.0, 0.0]] - shadow color as [r, g, b] (0.0–1.0)
|
|
28
|
+
* @param {number[]} [options.color=[0.0, 0.0, 0.0]] - shadow color as [r, g, b] or [r, g, b, a] (0.0–1.0); the alpha scales `opacity`
|
|
23
29
|
* @param {number} [options.opacity=0.5] - shadow opacity (0.0–1.0)
|
|
24
|
-
* @param {number[]} [options.textureSize
|
|
30
|
+
* @param {number[]} [options.textureSize] - the size, `[width, height]`, of the texture its offset is measured in; by default the texture it draws: a sprite's own, alone or with other effects and at any scale or zoom, the screen for a camera's effect
|
|
25
31
|
*/
|
|
26
32
|
constructor(renderer: Renderer, options?: {
|
|
27
33
|
offsetX?: number | undefined;
|
|
@@ -37,7 +43,13 @@ export default class DropShadowEffect extends ShaderEffect {
|
|
|
37
43
|
*/
|
|
38
44
|
setOffset(x: number, y: number): void;
|
|
39
45
|
/**
|
|
40
|
-
* set the
|
|
46
|
+
* set the shadow color
|
|
47
|
+
* @param {number[]} color - shadow color as [r, g, b] or [r, g, b, a] (0.0–1.0); the alpha scales the opacity
|
|
48
|
+
*/
|
|
49
|
+
setColor(color: number[]): void;
|
|
50
|
+
/**
|
|
51
|
+
* Measure the effect's offset in the texels of a texture of this size,
|
|
52
|
+
* rather than of the texture it draws (the default)
|
|
41
53
|
* @param {number} width - texture width in pixels
|
|
42
54
|
* @param {number} height - texture height in pixels
|
|
43
55
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropShadow.d.ts","sourceRoot":"","sources":["../../../src/video/effects/dropShadow.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dropShadow.d.ts","sourceRoot":"","sources":["../../../src/video/effects/dropShadow.js"],"names":[],"mappings":"AA6CA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IACC;;;;;;;;OAQG;IACH,sBARW,QAAQ,YAEhB;QAAyB,OAAO;QACP,OAAO;QACL,KAAK;QACP,OAAO;QACL,WAAW;KACxC,EA0CA;IAED;;;;OAIG;IACH,aAHW,MAAM,KACN,MAAM,QAIhB;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAIlB;IAED;;;;;OAKG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;CACD;yBA/IwB,mBAAmB;0BAOnB,gBAAgB"}
|
|
@@ -18,12 +18,16 @@
|
|
|
18
18
|
* @example
|
|
19
19
|
* // red flash
|
|
20
20
|
* const flash = new FlashEffect(renderer, { color: [1.0, 0.0, 0.0] });
|
|
21
|
+
* @example
|
|
22
|
+
* // a hit flash that only half covers the sprite, even at full intensity
|
|
23
|
+
* const hit = new FlashEffect(renderer, { color: [1.0, 1.0, 1.0, 0.5] });
|
|
24
|
+
* hit.setIntensity(1.0);
|
|
21
25
|
*/
|
|
22
26
|
export default class FlashEffect extends ShaderEffect {
|
|
23
27
|
/**
|
|
24
28
|
* @param {Renderer} renderer - the current renderer instance
|
|
25
29
|
* @param {object} [options] - effect options
|
|
26
|
-
* @param {number[]} [options.color=[1.0, 1.0, 1.0]] - flash color as [r, g, b] (0.0–1.0)
|
|
30
|
+
* @param {number[]} [options.color=[1.0, 1.0, 1.0]] - flash color as [r, g, b] or [r, g, b, a] (0.0–1.0); the alpha scales the intensity
|
|
27
31
|
* @param {number} [options.intensity=0.0] - initial flash intensity (0.0–1.0)
|
|
28
32
|
*/
|
|
29
33
|
constructor(renderer: Renderer, options?: {
|
|
@@ -38,7 +42,7 @@ export default class FlashEffect extends ShaderEffect {
|
|
|
38
42
|
setIntensity(value: number): void;
|
|
39
43
|
/**
|
|
40
44
|
* set the flash color
|
|
41
|
-
* @param {number[]} color - flash color as [r, g, b] (0.0–1.0)
|
|
45
|
+
* @param {number[]} color - flash color as [r, g, b] or [r, g, b, a] (0.0–1.0); the alpha scales the intensity
|
|
42
46
|
*/
|
|
43
47
|
setColor(color: number[]): void;
|
|
44
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flash.d.ts","sourceRoot":"","sources":["../../../src/video/effects/flash.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flash.d.ts","sourceRoot":"","sources":["../../../src/video/effects/flash.js"],"names":[],"mappings":"AAyBA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH;IACC;;;;;OAKG;IACH,sBALW,QAAQ,YAEhB;QAA2B,KAAK;QACP,SAAS;KACpC,EAmBA;IAJA,kBAAyC;IAM1C;;;OAGG;IACH,oBAFW,MAAM,QAKhB;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAIlB;CACD;yBA5FwB,mBAAmB;0BAOnB,gBAAgB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeping an effect's samples inside the sprite's own frame.
|
|
3
|
+
*
|
|
4
|
+
* A sprite drawn from an atlas or a tileset shows one frame of a bigger
|
|
5
|
+
* texture, and the texture goes on past that frame into the neighbouring
|
|
6
|
+
* ones. An effect that samples away from the fragment it shades (a glow, an
|
|
7
|
+
* outline, a blur, a shadow, a distortion) reads those neighbours along the
|
|
8
|
+
* frame's edge, and draws them. `frameTexel()` reads a texel of the frame
|
|
9
|
+
* the effect draws, `ME_frame` (its UV rect: left, top, right, bottom):
|
|
10
|
+
* transparent outside it, and kept half a texel (`ME_frame_half`, in UV)
|
|
11
|
+
* inside it, so filtering never reaches over the edge. Only where another
|
|
12
|
+
* frame could be: a side of the frame that is the texture's own edge is
|
|
13
|
+
* left unbounded, and so is a pass over a whole texture (a render target
|
|
14
|
+
* blit, a mesh). There, sampling is what it always was.
|
|
15
|
+
*
|
|
16
|
+
* On a sprite, `ME_frame` comes with the quad: every sprite vertex carries
|
|
17
|
+
* the UV of its quad's opposite corner (`aFrame`), and the effect's vertex
|
|
18
|
+
* stage turns it into the frame. Sprites drawn from different frames
|
|
19
|
+
* through the same effect so share one draw. Only `ME_frame_half`, which
|
|
20
|
+
* changes with the texture, is a uniform (`ShaderEffect#_setFrameTexel`).
|
|
21
|
+
* On a mesh, which carries no frame, `ME_frame` is a uniform, left
|
|
22
|
+
* unbounded.
|
|
23
|
+
* @ignore
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* the frame, the half texel and `frameTexel()`, for a GLSL effect body. The
|
|
27
|
+
* sprite program defines `ME_SPRITE_FRAME` and computes the varying in its
|
|
28
|
+
* vertex stage (see glsl_realization.js); a mesh hosting the body reads the
|
|
29
|
+
* uniform
|
|
30
|
+
* @ignore
|
|
31
|
+
*/
|
|
32
|
+
export const FRAME_GLSL: "\n#ifdef ME_SPRITE_FRAME\nvarying vec4 ME_frame;\n#else\nuniform vec4 ME_frame;\n#endif\nuniform vec2 ME_frame_half;\nvec4 frameTexel(vec2 p) {\n\tvec2 inside = step(ME_frame.xy, p) * step(p, ME_frame.zw);\n\tvec2 q = clamp(p, ME_frame.xy + ME_frame_half, ME_frame.zw - ME_frame_half);\n\treturn texture2D(uSampler, q) * (inside.x * inside.y);\n}\n";
|
|
33
|
+
/**
|
|
34
|
+
* the members to add to a WGSL effect's uniform struct, which `frameTexel()`
|
|
35
|
+
* reads through the effect's `fx` binding. On a sprite the scaffold reads
|
|
36
|
+
* the frame from the quad instead of `fx.ME_frame` (see wgsl/scaffold.js),
|
|
37
|
+
* which a mesh hosting the body still reads
|
|
38
|
+
* @ignore
|
|
39
|
+
*/
|
|
40
|
+
export const FRAME_WGSL_MEMBERS: "\n\tME_frame : vec4f,\n\tME_frame_half : vec2f,";
|
|
41
|
+
/**
|
|
42
|
+
* `frameTexel()` for a WGSL effect body, sampling with implicit derivatives
|
|
43
|
+
* (uniform control flow only), and `frameTexelLevel()`, sampling level 0,
|
|
44
|
+
* which works anywhere
|
|
45
|
+
* @ignore
|
|
46
|
+
*/
|
|
47
|
+
export const FRAME_WGSL: "\nfn frameUV(p : vec2f) -> vec2f {\n\treturn clamp(p, fx.ME_frame.xy + fx.ME_frame_half, fx.ME_frame.zw - fx.ME_frame_half);\n}\nfn frameInside(p : vec2f) -> f32 {\n\tlet inside = step(fx.ME_frame.xy, p) * step(p, fx.ME_frame.zw);\n\treturn inside.x * inside.y;\n}\nfn frameTexel(p : vec2f) -> vec4f {\n\treturn textureSample(uTexture, uSampler, frameUV(p)) * frameInside(p);\n}\nfn frameTexelLevel(p : vec2f) -> vec4f {\n\treturn textureSampleLevel(uTexture, uSampler, frameUV(p), 0.0) * frameInside(p);\n}\n";
|
|
48
|
+
//# sourceMappingURL=frame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../../src/video/effects/frame.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;GAMG;AACH,wXAYE;AAEF;;;;;;GAMG;AACH,mFAEyB;AAEzB;;;;;GAKG;AACH,yhBAcE"}
|
|
@@ -10,15 +10,18 @@
|
|
|
10
10
|
* color: [0.2, 0.5, 1.0],
|
|
11
11
|
* intensity: 1.5,
|
|
12
12
|
* }));
|
|
13
|
+
* @example
|
|
14
|
+
* // a faint white halo: the color's alpha is the halo's opacity
|
|
15
|
+
* mySprite.addPostEffect(new GlowEffect(renderer, { color: [1.0, 1.0, 1.0, 0.5] }));
|
|
13
16
|
*/
|
|
14
17
|
export default class GlowEffect extends ShaderEffect {
|
|
15
18
|
/**
|
|
16
19
|
* @param {Renderer} renderer - the current renderer instance
|
|
17
20
|
* @param {object} [options] - effect options
|
|
18
|
-
* @param {number[]} [options.color=[1.0, 1.0, 1.0]] - glow color as [r, g, b] (0.0–1.0)
|
|
21
|
+
* @param {number[]} [options.color=[1.0, 1.0, 1.0]] - glow color as [r, g, b] or [r, g, b, a] (0.0–1.0); the alpha is the halo's opacity
|
|
19
22
|
* @param {number} [options.width=3.0] - glow spread in pixels
|
|
20
23
|
* @param {number} [options.intensity=1.0] - glow brightness multiplier
|
|
21
|
-
* @param {number[]} [options.textureSize
|
|
24
|
+
* @param {number[]} [options.textureSize] - the size, `[width, height]`, of the texture its spread is measured in; by default the texture it draws: a sprite's own, alone or with other effects and at any scale or zoom, the screen for a camera's effect
|
|
22
25
|
*/
|
|
23
26
|
constructor(renderer: Renderer, options?: {
|
|
24
27
|
color?: number[] | undefined;
|
|
@@ -29,7 +32,7 @@ export default class GlowEffect extends ShaderEffect {
|
|
|
29
32
|
intensity: number;
|
|
30
33
|
/**
|
|
31
34
|
* set the glow color
|
|
32
|
-
* @param {number[]} color - glow color as [r, g, b] (0.0–1.0)
|
|
35
|
+
* @param {number[]} color - glow color as [r, g, b] or [r, g, b, a] (0.0–1.0); the alpha is the halo's opacity
|
|
33
36
|
*/
|
|
34
37
|
setColor(color: number[]): void;
|
|
35
38
|
/**
|
|
@@ -38,7 +41,8 @@ export default class GlowEffect extends ShaderEffect {
|
|
|
38
41
|
*/
|
|
39
42
|
setIntensity(value: number): void;
|
|
40
43
|
/**
|
|
41
|
-
*
|
|
44
|
+
* Measure the effect's spread in the texels of a texture of this size,
|
|
45
|
+
* rather than of the texture it draws (the default)
|
|
42
46
|
* @param {number} width - texture width in pixels
|
|
43
47
|
* @param {number} height - texture height in pixels
|
|
44
48
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glow.d.ts","sourceRoot":"","sources":["../../../src/video/effects/glow.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"glow.d.ts","sourceRoot":"","sources":["../../../src/video/effects/glow.js"],"names":[],"mappings":"AA2CA;;;;;;;;;;;;;;;GAeG;AACH;IACC;;;;;;;OAOG;IACH,sBAPW,QAAQ,YAEhB;QAA2B,KAAK;QACP,KAAK;QACL,SAAS;QACP,WAAW;KACxC,EAyCA;IAPA,kBAAyC;IAS1C;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAIlB;IAED;;;OAGG;IACH,oBAFW,MAAM,QAKhB;IAED;;;;;OAKG;IACH,sBAHW,MAAM,UACN,MAAM,QAIhB;CACD;yBAtIwB,mBAAmB;0BAOnB,gBAAgB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glsl_realization.d.ts","sourceRoot":"","sources":["../../../src/video/effects/glsl_realization.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"glsl_realization.d.ts","sourceRoot":"","sources":["../../../src/video/effects/glsl_realization.js"],"names":[],"mappings":"AAqKA;;;;;;;;GAQG;AACH,+CALW,MAAM,GACJ;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAC,CAuCvH"}
|
|
@@ -10,12 +10,15 @@
|
|
|
10
10
|
* mySprite.addPostEffect(holo);
|
|
11
11
|
* // update each frame
|
|
12
12
|
* holo.setTime(performance.now() / 1000);
|
|
13
|
+
* @example
|
|
14
|
+
* // a faint cyan tint, the scan lines and flicker unchanged
|
|
15
|
+
* mySprite.addPostEffect(new HologramEffect(renderer, { color: [0.1, 0.7, 1.0, 0.4] }));
|
|
13
16
|
*/
|
|
14
17
|
export default class HologramEffect extends ShaderEffect {
|
|
15
18
|
/**
|
|
16
19
|
* @param {Renderer} renderer - the current renderer instance
|
|
17
20
|
* @param {object} [options] - effect options
|
|
18
|
-
* @param {number[]} [options.color=[0.1, 0.7, 1.0]] - hologram tint color [r, g, b]
|
|
21
|
+
* @param {number[]} [options.color=[0.1, 0.7, 1.0]] - hologram tint color as [r, g, b] or [r, g, b, a] (0.0–1.0); the alpha scales the intensity
|
|
19
22
|
* @param {number} [options.intensity=0.5] - effect intensity (0.0–1.0)
|
|
20
23
|
*/
|
|
21
24
|
constructor(renderer: Renderer, options?: {
|
|
@@ -24,7 +27,7 @@ export default class HologramEffect extends ShaderEffect {
|
|
|
24
27
|
});
|
|
25
28
|
/**
|
|
26
29
|
* set the hologram tint color
|
|
27
|
-
* @param {number[]} color - color as [r, g, b] (0.0–1.0)
|
|
30
|
+
* @param {number[]} color - color as [r, g, b] or [r, g, b, a] (0.0–1.0); the alpha scales the intensity
|
|
28
31
|
*/
|
|
29
32
|
setColor(color: number[]): void;
|
|
30
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hologram.d.ts","sourceRoot":"","sources":["../../../src/video/effects/hologram.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hologram.d.ts","sourceRoot":"","sources":["../../../src/video/effects/hologram.js"],"names":[],"mappings":"AAkCA;;;;;;;;;;;;;;;GAeG;AACH;IACC;;;;;OAKG;IACH,sBALW,QAAQ,YAEhB;QAA2B,KAAK;QACP,SAAS;KACpC,EA2BA;IAED;;;OAGG;IACH,gBAFW,MAAM,EAAE,QAIlB;CACD;yBA3FwB,mBAAmB;0BAOnB,gBAAgB"}
|