melonjs 20.2.0 → 20.4.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 +86 -8
- package/build/application/application.d.ts +0 -17
- package/build/application/application.d.ts.map +1 -1
- package/build/application/settings.d.ts +6 -2
- package/build/application/settings.d.ts.map +1 -1
- package/build/audio/audio.d.ts +2 -2
- package/build/audio/audio.d.ts.map +1 -1
- package/build/audio/backend/buffer.d.ts +26 -0
- package/build/audio/backend/buffer.d.ts.map +1 -0
- package/build/audio/backend/cache.d.ts +2 -0
- package/build/audio/backend/cache.d.ts.map +1 -0
- package/build/audio/backend/core.d.ts +24 -0
- package/build/audio/backend/core.d.ts.map +1 -0
- package/build/audio/backend/engine.d.ts +35 -0
- package/build/audio/backend/engine.d.ts.map +1 -0
- package/build/audio/backend/sound.d.ts +29 -0
- package/build/audio/backend/sound.d.ts.map +1 -0
- package/build/audio/backend/spatial.d.ts +191 -0
- package/build/audio/backend/spatial.d.ts.map +1 -0
- package/build/audio/backend/types.d.ts +107 -0
- package/build/audio/backend/types.d.ts.map +1 -0
- package/build/audio/backend/voice.d.ts +8 -0
- package/build/audio/backend/voice.d.ts.map +1 -0
- package/build/audio/playback.d.ts +49 -4
- package/build/audio/playback.d.ts.map +1 -1
- package/build/audio/procedural.d.ts.map +1 -1
- package/build/audio/state.d.ts +69 -0
- package/build/audio/state.d.ts.map +1 -0
- package/build/audio/types.d.ts +93 -1
- package/build/audio/types.d.ts.map +1 -1
- package/build/camera/camera2d.d.ts +0 -68
- package/build/camera/camera2d.d.ts.map +1 -1
- package/build/camera/camera3d.d.ts +91 -84
- package/build/camera/camera3d.d.ts.map +1 -1
- package/build/camera/effects/fade_effect.d.ts +0 -5
- package/build/camera/effects/fade_effect.d.ts.map +1 -1
- package/build/camera/effects/mask_effect.d.ts +0 -5
- package/build/camera/effects/mask_effect.d.ts.map +1 -1
- package/build/camera/fog.d.ts +118 -0
- package/build/camera/fog.d.ts.map +1 -0
- package/build/const.d.ts +2 -2
- package/build/geometries/box3d.d.ts +0 -28
- package/build/geometries/box3d.d.ts.map +1 -1
- package/build/geometries/ellipse.d.ts +0 -20
- package/build/geometries/ellipse.d.ts.map +1 -1
- package/build/geometries/observablePoint.d.ts +0 -3
- package/build/geometries/observablePoint.d.ts.map +1 -1
- package/build/geometries/path2d.d.ts +0 -19
- package/build/geometries/path2d.d.ts.map +1 -1
- package/build/geometries/polygon.d.ts +0 -12
- package/build/geometries/polygon.d.ts.map +1 -1
- package/build/geometries/roundrect.d.ts +0 -18
- package/build/geometries/roundrect.d.ts.map +1 -1
- package/build/geometries/sphere.d.ts +0 -9
- package/build/geometries/sphere.d.ts.map +1 -1
- package/build/geometries/toarccanvas.d.ts.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +12150 -11289
- package/build/index.js.map +4 -4
- package/build/input/gamepad.d.ts.map +1 -1
- package/build/input/input.d.ts +19 -0
- package/build/input/input.d.ts.map +1 -1
- package/build/input/pointer.d.ts +0 -4
- package/build/input/pointer.d.ts.map +1 -1
- package/build/input/pointerevent.d.ts +0 -6
- package/build/input/pointerevent.d.ts.map +1 -1
- package/build/lang/deprecated.d.ts +4 -2
- package/build/lang/deprecated.d.ts.map +1 -1
- package/build/level/gltf/GLTFModel.d.ts +0 -81
- package/build/level/gltf/GLTFModel.d.ts.map +1 -1
- package/build/level/gltf/GLTFScene.d.ts +13 -44
- package/build/level/gltf/GLTFScene.d.ts.map +1 -1
- package/build/level/gltf/gltf_sampler.d.ts +1 -48
- package/build/level/gltf/gltf_sampler.d.ts.map +1 -1
- package/build/level/level.d.ts +195 -113
- package/build/level/level.d.ts.map +1 -1
- package/build/level/tiled/TMXGroup.d.ts +1 -65
- package/build/level/tiled/TMXGroup.d.ts.map +1 -1
- package/build/level/tiled/TMXLayer.d.ts +0 -44
- package/build/level/tiled/TMXLayer.d.ts.map +1 -1
- package/build/level/tiled/TMXObject.d.ts +1 -136
- package/build/level/tiled/TMXObject.d.ts.map +1 -1
- package/build/level/tiled/TMXObjectFactory.d.ts +1 -40
- package/build/level/tiled/TMXObjectFactory.d.ts.map +1 -1
- package/build/level/tiled/TMXTile.d.ts +1 -30
- package/build/level/tiled/TMXTile.d.ts.map +1 -1
- package/build/level/tiled/TMXTileMap.d.ts +0 -10
- package/build/level/tiled/TMXTileMap.d.ts.map +1 -1
- package/build/level/tiled/TMXTileset.d.ts +0 -113
- package/build/level/tiled/TMXTileset.d.ts.map +1 -1
- package/build/level/tiled/TMXTilesetGroup.d.ts +0 -1
- package/build/level/tiled/TMXTilesetGroup.d.ts.map +1 -1
- package/build/level/tiled/TMXUtils.d.ts +1 -43
- package/build/level/tiled/TMXUtils.d.ts.map +1 -1
- package/build/level/tiled/factories/shape.d.ts +1 -7
- package/build/level/tiled/factories/shape.d.ts.map +1 -1
- package/build/level/tiled/factories/text.d.ts +1 -7
- package/build/level/tiled/factories/text.d.ts.map +1 -1
- package/build/level/tiled/factories/tile.d.ts +1 -7
- package/build/level/tiled/factories/tile.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts +0 -60
- package/build/level/tiled/renderer/TMXHexagonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts +0 -42
- package/build/level/tiled/renderer/TMXIsometricRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts +0 -5
- package/build/level/tiled/renderer/TMXObliqueRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts +0 -31
- package/build/level/tiled/renderer/TMXOrthogonalRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXRenderer.d.ts +2 -2
- package/build/level/tiled/renderer/TMXRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/TMXStaggeredRenderer.d.ts.map +1 -1
- package/build/level/tiled/renderer/autodetect.d.ts +1 -6
- package/build/level/tiled/renderer/autodetect.d.ts.map +1 -1
- package/build/lighting/light2d.d.ts +0 -25
- package/build/lighting/light2d.d.ts.map +1 -1
- package/build/lighting/light3d.d.ts +0 -16
- package/build/lighting/light3d.d.ts.map +1 -1
- package/build/loader/loader.d.ts +46 -73
- package/build/loader/loader.d.ts.map +1 -1
- package/build/loader/loadingscreen.d.ts +0 -33
- package/build/loader/loadingscreen.d.ts.map +1 -1
- package/build/loader/parsers/aseprite.d.ts +0 -13
- package/build/loader/parsers/aseprite.d.ts.map +1 -1
- package/build/loader/parsers/audio.d.ts +2 -0
- package/build/loader/parsers/audio.d.ts.map +1 -0
- package/build/loader/parsers/binary.d.ts +1 -10
- package/build/loader/parsers/binary.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/compressed_image.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parseDDS.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parseDDS.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parseKTX.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parseKTX.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parseKTX2.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parseKTX2.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parsePKM.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parsePKM.d.ts.map +1 -1
- package/build/loader/parsers/compressed_textures/parsePVR.d.ts +1 -7
- package/build/loader/parsers/compressed_textures/parsePVR.d.ts.map +1 -1
- package/build/loader/parsers/fontface.d.ts +1 -13
- package/build/loader/parsers/fontface.d.ts.map +1 -1
- package/build/loader/parsers/gltf.d.ts +1 -70
- package/build/loader/parsers/gltf.d.ts.map +1 -1
- package/build/loader/parsers/image.d.ts +1 -22
- package/build/loader/parsers/image.d.ts.map +1 -1
- package/build/loader/parsers/json.d.ts +1 -10
- package/build/loader/parsers/json.d.ts.map +1 -1
- package/build/loader/parsers/mtl.d.ts +1 -28
- package/build/loader/parsers/mtl.d.ts.map +1 -1
- package/build/loader/parsers/obj.d.ts +1 -59
- package/build/loader/parsers/obj.d.ts.map +1 -1
- package/build/loader/parsers/pbr.d.ts +1 -62
- package/build/loader/parsers/pbr.d.ts.map +1 -1
- package/build/loader/parsers/script.d.ts +1 -10
- package/build/loader/parsers/script.d.ts.map +1 -1
- package/build/loader/parsers/shader.d.ts +1 -52
- package/build/loader/parsers/shader.d.ts.map +1 -1
- package/build/loader/parsers/tmx.d.ts +1 -10
- package/build/loader/parsers/tmx.d.ts.map +1 -1
- package/build/loader/parsers/video.d.ts +1 -10
- package/build/loader/parsers/video.d.ts.map +1 -1
- package/build/math/color.d.ts.map +1 -1
- package/build/math/noise.d.ts +0 -40
- package/build/math/noise.d.ts.map +1 -1
- package/build/math/observableVector2d.d.ts +0 -3
- package/build/math/observableVector2d.d.ts.map +1 -1
- package/build/math/observableVector3d.d.ts +0 -3
- package/build/math/observableVector3d.d.ts.map +1 -1
- package/build/math/vector2d.d.ts +0 -6
- package/build/math/vector2d.d.ts.map +1 -1
- package/build/math/vertex.d.ts +25 -0
- package/build/math/vertex.d.ts.map +1 -1
- package/build/particles/emitter.d.ts +0 -65
- package/build/particles/emitter.d.ts.map +1 -1
- package/build/particles/particle.d.ts +0 -81
- package/build/particles/particle.d.ts.map +1 -1
- package/build/physics/adapter.d.ts +3 -3
- package/build/physics/bounds.d.ts +0 -1
- package/build/physics/bounds.d.ts.map +1 -1
- package/build/physics/broadphase/broadphase.d.ts +0 -7
- package/build/physics/broadphase/broadphase.d.ts.map +1 -1
- package/build/physics/broadphase/octree.d.ts +0 -91
- package/build/physics/broadphase/octree.d.ts.map +1 -1
- package/build/physics/broadphase/quadtree.d.ts +0 -47
- package/build/physics/broadphase/quadtree.d.ts.map +1 -1
- package/build/physics/builtin/body.d.ts +5 -69
- package/build/physics/builtin/body.d.ts.map +1 -1
- package/build/physics/builtin/detector.d.ts +0 -312
- package/build/physics/builtin/detector.d.ts.map +1 -1
- package/build/physics/builtin/sat.d.ts +1 -48
- package/build/physics/builtin/sat.d.ts.map +1 -1
- package/build/physics/builtin/sat3d.d.ts +1 -56
- package/build/physics/builtin/sat3d.d.ts.map +1 -1
- package/build/physics/collision.d.ts +0 -2
- package/build/physics/collision.d.ts.map +1 -1
- package/build/physics/response.d.ts +0 -1
- package/build/physics/response.d.ts.map +1 -1
- package/build/physics/world.d.ts.map +1 -1
- package/build/plugin/plugin.d.ts +9 -1
- package/build/plugin/plugin.d.ts.map +1 -1
- package/build/polyfill/index.d.ts +1 -4
- package/build/polyfill/index.d.ts.map +1 -1
- package/build/renderable/anchorPoint.d.ts +1 -73
- package/build/renderable/anchorPoint.d.ts.map +1 -1
- package/build/renderable/animation.d.ts +0 -7
- package/build/renderable/animation.d.ts.map +1 -1
- package/build/renderable/colorlayer.d.ts +0 -5
- package/build/renderable/colorlayer.d.ts.map +1 -1
- package/build/renderable/container.d.ts +0 -55
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/draggable.d.ts +0 -5
- package/build/renderable/draggable.d.ts.map +1 -1
- package/build/renderable/dragndrop.d.ts +1 -12
- package/build/renderable/dragndrop.d.ts.map +1 -1
- package/build/renderable/entity/entity.d.ts +0 -8
- package/build/renderable/entity/entity.d.ts.map +1 -1
- package/build/renderable/frameAnimation.d.ts +0 -41
- package/build/renderable/frameAnimation.d.ts.map +1 -1
- package/build/renderable/groundshadow.d.ts +1 -91
- package/build/renderable/groundshadow.d.ts.map +1 -1
- package/build/renderable/imagelayer.d.ts +0 -29
- package/build/renderable/imagelayer.d.ts.map +1 -1
- package/build/renderable/instanced_mesh.d.ts +26 -104
- package/build/renderable/instanced_mesh.d.ts.map +1 -1
- package/build/renderable/mesh.d.ts +145 -140
- package/build/renderable/mesh.d.ts.map +1 -1
- package/build/renderable/nineslicesprite.d.ts +0 -4
- package/build/renderable/nineslicesprite.d.ts.map +1 -1
- package/build/renderable/renderable.d.ts +17 -54
- package/build/renderable/renderable.d.ts.map +1 -1
- package/build/renderable/sprite.d.ts +7 -52
- package/build/renderable/sprite.d.ts.map +1 -1
- package/build/renderable/sprite3d.d.ts +0 -95
- package/build/renderable/sprite3d.d.ts.map +1 -1
- package/build/renderable/text/bitmaptext.d.ts +0 -14
- package/build/renderable/text/bitmaptext.d.ts.map +1 -1
- package/build/renderable/text/bitmaptextdata.d.ts +0 -22
- package/build/renderable/text/bitmaptextdata.d.ts.map +1 -1
- package/build/renderable/text/glyph.d.ts +1 -39
- package/build/renderable/text/glyph.d.ts.map +1 -1
- package/build/renderable/text/text.d.ts +0 -20
- package/build/renderable/text/text.d.ts.map +1 -1
- package/build/renderable/text/textstyle.d.ts +1 -5
- package/build/renderable/text/textstyle.d.ts.map +1 -1
- package/build/renderable/trail.d.ts +0 -29
- package/build/renderable/trail.d.ts.map +1 -1
- package/build/renderable/trigger.d.ts +0 -6
- package/build/renderable/trigger.d.ts.map +1 -1
- package/build/renderable/ui/uibaseelement.d.ts +0 -40
- package/build/renderable/ui/uibaseelement.d.ts.map +1 -1
- package/build/renderable/ui/uispriteelement.d.ts +0 -35
- package/build/renderable/ui/uispriteelement.d.ts.map +1 -1
- package/build/state/stage.d.ts +4 -68
- package/build/state/stage.d.ts.map +1 -1
- package/build/state/state.d.ts.map +1 -1
- package/build/system/device.d.ts +0 -12
- package/build/system/device.d.ts.map +1 -1
- package/build/system/dom.d.ts +1 -8
- package/build/system/dom.d.ts.map +1 -1
- package/build/system/event.d.ts +1 -1
- package/build/system/legacy_pool.d.ts +1 -6
- package/build/system/legacy_pool.d.ts.map +1 -1
- package/build/system/platform.d.ts +21 -2
- package/build/system/platform.d.ts.map +1 -1
- package/build/system/pool.d.ts +0 -9
- package/build/system/pool.d.ts.map +1 -1
- package/build/system/save.d.ts.map +1 -1
- package/build/system/timer.d.ts +0 -20
- package/build/system/timer.d.ts.map +1 -1
- package/build/tweens/tween.d.ts +0 -62
- package/build/tweens/tween.d.ts.map +1 -1
- package/build/utils/array-multimap.d.ts +1 -13
- package/build/utils/array-multimap.d.ts.map +1 -1
- package/build/utils/decode.d.ts.map +1 -1
- package/build/utils/fetchdata.d.ts +2 -0
- package/build/utils/fetchdata.d.ts.map +1 -0
- package/build/utils/utils.d.ts +0 -13
- package/build/utils/utils.d.ts.map +1 -1
- package/build/video/blendmodes.d.ts +1 -106
- package/build/video/blendmodes.d.ts.map +1 -1
- package/build/video/buffer/index.d.ts +1 -39
- package/build/video/buffer/index.d.ts.map +1 -1
- package/build/video/buffer/vertex.d.ts +1 -82
- package/build/video/buffer/vertex.d.ts.map +1 -1
- package/build/video/canvas/canvas_renderer.d.ts +7 -25
- package/build/video/canvas/canvas_renderer.d.ts.map +1 -1
- package/build/video/canvas_factory.d.ts +1 -24
- package/build/video/canvas_factory.d.ts.map +1 -1
- package/build/video/effects/blendEffect.d.ts +0 -54
- package/build/video/effects/blendEffect.d.ts.map +1 -1
- package/build/video/effects/blur.d.ts +4 -4
- package/build/video/effects/blur.d.ts.map +1 -1
- package/build/video/effects/chromaticAberration.d.ts +5 -5
- package/build/video/effects/chromaticAberration.d.ts.map +1 -1
- package/build/video/effects/colorMatrix.d.ts +5 -15
- package/build/video/effects/colorMatrix.d.ts.map +1 -1
- package/build/video/effects/desaturate.d.ts +5 -5
- package/build/video/effects/desaturate.d.ts.map +1 -1
- package/build/video/effects/dissolve.d.ts +4 -4
- package/build/video/effects/dissolve.d.ts.map +1 -1
- package/build/video/effects/dropShadow.d.ts +5 -5
- package/build/video/effects/dropShadow.d.ts.map +1 -1
- package/build/video/effects/flash.d.ts +4 -4
- package/build/video/effects/flash.d.ts.map +1 -1
- package/build/video/effects/glow.d.ts +5 -5
- package/build/video/effects/glow.d.ts.map +1 -1
- package/build/video/effects/glsl_realization.d.ts +1 -17
- package/build/video/effects/glsl_realization.d.ts.map +1 -1
- package/build/video/effects/hologram.d.ts +4 -4
- package/build/video/effects/hologram.d.ts.map +1 -1
- package/build/video/effects/invert.d.ts +5 -5
- package/build/video/effects/invert.d.ts.map +1 -1
- package/build/video/effects/outline.d.ts +6 -6
- package/build/video/effects/outline.d.ts.map +1 -1
- package/build/video/effects/pixelate.d.ts +4 -4
- package/build/video/effects/pixelate.d.ts.map +1 -1
- package/build/video/effects/radialGradient.d.ts +2 -3
- package/build/video/effects/radialGradient.d.ts.map +1 -1
- package/build/video/effects/scanline.d.ts +6 -6
- package/build/video/effects/scanline.d.ts.map +1 -1
- package/build/video/effects/sepia.d.ts +5 -5
- package/build/video/effects/sepia.d.ts.map +1 -1
- package/build/video/effects/shadereffect.d.ts +12 -123
- package/build/video/effects/shadereffect.d.ts.map +1 -1
- package/build/video/effects/shine.d.ts +3 -3
- package/build/video/effects/shine.d.ts.map +1 -1
- package/build/video/effects/tintPulse.d.ts +4 -4
- package/build/video/effects/tintPulse.d.ts.map +1 -1
- package/build/video/effects/vignette.d.ts +6 -6
- package/build/video/effects/vignette.d.ts.map +1 -1
- package/build/video/effects/wave.d.ts +4 -4
- package/build/video/effects/wave.d.ts.map +1 -1
- package/build/video/effects/wgsl/layout.d.ts +1 -27
- package/build/video/effects/wgsl/layout.d.ts.map +1 -1
- package/build/video/effects/wgsl/parse.d.ts +1 -8
- package/build/video/effects/wgsl/parse.d.ts.map +1 -1
- package/build/video/effects/wgsl/scaffold.d.ts +1 -42
- package/build/video/effects/wgsl/scaffold.d.ts.map +1 -1
- package/build/video/effects/wgsl_realization.d.ts +1 -82
- package/build/video/effects/wgsl_realization.d.ts.map +1 -1
- package/build/video/gpu/batcher.d.ts +1 -13
- package/build/video/gpu/batcher.d.ts.map +1 -1
- package/build/video/gpu/instancerecord.d.ts +1 -163
- package/build/video/gpu/instancerecord.d.ts.map +1 -1
- package/build/video/gpu/meshchunk.d.ts +1 -48
- package/build/video/gpu/meshchunk.d.ts.map +1 -1
- package/build/video/gpu/meshvertex.d.ts +1 -53
- package/build/video/gpu/meshvertex.d.ts.map +1 -1
- package/build/video/gpu/primitives.d.ts +1 -59
- package/build/video/gpu/primitives.d.ts.map +1 -1
- package/build/video/gpu/quadcorners.d.ts +1 -10
- package/build/video/gpu/quadcorners.d.ts.map +1 -1
- package/build/video/gpu/textureslots.d.ts +1 -121
- package/build/video/gpu/textureslots.d.ts.map +1 -1
- package/build/video/gpu/texturestore.d.ts +1 -138
- package/build/video/gpu/texturestore.d.ts.map +1 -1
- package/build/video/gpu/topology.d.ts.map +1 -1
- package/build/video/gpu/vertexformat.d.ts +0 -28
- package/build/video/gpu/vertexformat.d.ts.map +1 -1
- package/build/video/gradient.d.ts +0 -81
- package/build/video/gradient.d.ts.map +1 -1
- package/build/video/renderer.d.ts +21 -102
- package/build/video/renderer.d.ts.map +1 -1
- package/build/video/renderstate.d.ts +0 -51
- package/build/video/renderstate.d.ts.map +1 -1
- package/build/video/rendertarget/canvasrendertarget.d.ts +0 -10
- package/build/video/rendertarget/canvasrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/render_target_pool.d.ts +1 -82
- package/build/video/rendertarget/render_target_pool.d.ts.map +1 -1
- package/build/video/rendertarget/webglrendertarget.d.ts +1 -64
- package/build/video/rendertarget/webglrendertarget.d.ts.map +1 -1
- package/build/video/rendertarget/webgpurendertarget.d.ts +0 -8
- package/build/video/rendertarget/webgpurendertarget.d.ts.map +1 -1
- package/build/video/texture/atlas.d.ts +2 -76
- package/build/video/texture/atlas.d.ts.map +1 -1
- package/build/video/texture/cache.d.ts +0 -136
- package/build/video/texture/cache.d.ts.map +1 -1
- package/build/video/texture/frametexture.d.ts +1 -71
- package/build/video/texture/frametexture.d.ts.map +1 -1
- package/build/video/texture/noise_texture2d.d.ts +0 -43
- package/build/video/texture/noise_texture2d.d.ts.map +1 -1
- package/build/video/texture/parser/aseprite.d.ts +1 -8
- package/build/video/texture/parser/aseprite.d.ts.map +1 -1
- package/build/video/texture/parser/spritesheet.d.ts +1 -8
- package/build/video/texture/parser/spritesheet.d.ts.map +1 -1
- package/build/video/texture/parser/texturepacker.d.ts +1 -8
- package/build/video/texture/parser/texturepacker.d.ts.map +1 -1
- package/build/video/texture/resource.d.ts +0 -9
- package/build/video/texture/resource.d.ts.map +1 -1
- package/build/video/texture/texture2d.d.ts +0 -11
- package/build/video/texture/texture2d.d.ts.map +1 -1
- package/build/video/utils/autodetect.d.ts +1 -5
- package/build/video/utils/autodetect.d.ts.map +1 -1
- package/build/video/webgl/batchers/batcher.d.ts +0 -55
- package/build/video/webgl/batchers/batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/lit_mesh_batcher.d.ts +0 -14
- package/build/video/webgl/batchers/lit_mesh_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts +0 -72
- package/build/video/webgl/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/material_batcher.d.ts +0 -89
- package/build/video/webgl/batchers/material_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/mesh_batcher.d.ts +14 -343
- package/build/video/webgl/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/primitive_batcher.d.ts +0 -10
- package/build/video/webgl/batchers/primitive_batcher.d.ts.map +1 -1
- package/build/video/webgl/batchers/quad_batcher.d.ts +0 -30
- package/build/video/webgl/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgl/buffer/index.d.ts +1 -36
- package/build/video/webgl/buffer/index.d.ts.map +1 -1
- package/build/video/webgl/buffer/instance_buffer.d.ts +1 -53
- package/build/video/webgl/buffer/instance_buffer.d.ts.map +1 -1
- package/build/video/webgl/buffer/retained_geometry.d.ts +1 -81
- package/build/video/webgl/buffer/retained_geometry.d.ts.map +1 -1
- package/build/video/webgl/buffer/uniformblock.d.ts +1 -80
- package/build/video/webgl/buffer/uniformblock.d.ts.map +1 -1
- package/build/video/webgl/buffer/vertexstate.d.ts +1 -100
- package/build/video/webgl/buffer/vertexstate.d.ts.map +1 -1
- package/build/video/webgl/glshader.d.ts +2 -51
- package/build/video/webgl/glshader.d.ts.map +1 -1
- package/build/video/webgl/lighting/pack3d.d.ts +1 -47
- package/build/video/webgl/lighting/pack3d.d.ts.map +1 -1
- package/build/video/webgl/lighting/std140.d.ts +1 -109
- package/build/video/webgl/lighting/std140.d.ts.map +1 -1
- package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts +1 -103
- package/build/video/webgl/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
- package/build/video/webgl/shaders/multitexture-lit.d.ts +1 -26
- package/build/video/webgl/shaders/multitexture-lit.d.ts.map +1 -1
- package/build/video/webgl/shaders/multitexture.d.ts +1 -9
- package/build/video/webgl/shaders/multitexture.d.ts.map +1 -1
- package/build/video/webgl/texture/store.d.ts +1 -50
- package/build/video/webgl/texture/store.d.ts.map +1 -1
- package/build/video/webgl/utils/attributes.d.ts +1 -11
- package/build/video/webgl/utils/attributes.d.ts.map +1 -1
- package/build/video/webgl/utils/maxtextures.d.ts +1 -36
- package/build/video/webgl/utils/maxtextures.d.ts.map +1 -1
- package/build/video/webgl/utils/precision.d.ts +1 -14
- package/build/video/webgl/utils/precision.d.ts.map +1 -1
- package/build/video/webgl/utils/program.d.ts +1 -5
- package/build/video/webgl/utils/program.d.ts.map +1 -1
- package/build/video/webgl/utils/samplercache.d.ts +1 -68
- package/build/video/webgl/utils/samplercache.d.ts.map +1 -1
- package/build/video/webgl/utils/string.d.ts +1 -21
- package/build/video/webgl/utils/string.d.ts.map +1 -1
- package/build/video/webgl/utils/topology.d.ts +1 -23
- package/build/video/webgl/utils/topology.d.ts.map +1 -1
- package/build/video/webgl/utils/uniforms.d.ts +1 -25
- package/build/video/webgl/utils/uniforms.d.ts.map +1 -1
- package/build/video/webgl/utils/vertexformat.d.ts +1 -26
- package/build/video/webgl/utils/vertexformat.d.ts.map +1 -1
- package/build/video/webgl/webgl_renderer.d.ts +24 -286
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts +0 -6
- package/build/video/webgpu/batchers/lit_mesh_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts +0 -8
- package/build/video/webgpu/batchers/lit_quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/mesh_batcher.d.ts +1 -230
- package/build/video/webgpu/batchers/mesh_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/primitive_batcher.d.ts.map +1 -1
- package/build/video/webgpu/batchers/quad_batcher.d.ts +0 -82
- package/build/video/webgpu/batchers/quad_batcher.d.ts.map +1 -1
- package/build/video/webgpu/buffer/arena.d.ts +1 -63
- package/build/video/webgpu/buffer/arena.d.ts.map +1 -1
- package/build/video/webgpu/buffer/instance_buffer.d.ts +1 -64
- package/build/video/webgpu/buffer/instance_buffer.d.ts.map +1 -1
- package/build/video/webgpu/buffer/retained_geometry.d.ts +1 -54
- package/build/video/webgpu/buffer/retained_geometry.d.ts.map +1 -1
- package/build/video/webgpu/buffer/uniformring.d.ts +1 -67
- package/build/video/webgpu/buffer/uniformring.d.ts.map +1 -1
- package/build/video/webgpu/effect_binding.d.ts +1 -16
- package/build/video/webgpu/effect_binding.d.ts.map +1 -1
- package/build/video/webgpu/pipeline/bindgroups.d.ts +1 -32
- package/build/video/webgpu/pipeline/bindgroups.d.ts.map +1 -1
- package/build/video/webgpu/pipeline/cache.d.ts +1 -163
- package/build/video/webgpu/pipeline/cache.d.ts.map +1 -1
- package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts +1 -87
- package/build/video/webgpu/renderers/tmxlayer/orthogonal.d.ts.map +1 -1
- package/build/video/webgpu/shaders/mesh-instanced.d.ts +1 -43
- package/build/video/webgpu/shaders/mesh-instanced.d.ts.map +1 -1
- package/build/video/webgpu/texture/compressed.d.ts +1 -32
- package/build/video/webgpu/texture/compressed.d.ts.map +1 -1
- package/build/video/webgpu/texture/frametexture.d.ts +1 -62
- package/build/video/webgpu/texture/frametexture.d.ts.map +1 -1
- package/build/video/webgpu/texture/store.d.ts +1 -147
- package/build/video/webgpu/texture/store.d.ts.map +1 -1
- package/build/video/webgpu/webgpu_renderer.d.ts +2 -89
- package/build/video/webgpu/webgpu_renderer.d.ts.map +1 -1
- package/package.json +8 -11
- package/skills/AGENTS.md +67 -0
- package/skills/melonjs/SKILL.md +156 -0
- package/skills/melonjs-20-migration/SKILL.md +160 -0
- package/skills/melonjs-3d/SKILL.md +525 -0
- package/skills/melonjs-3d-assets/SKILL.md +258 -0
- package/skills/melonjs-audio/SKILL.md +236 -0
- package/skills/melonjs-camera-and-drawing/SKILL.md +175 -0
- package/skills/melonjs-deployment/SKILL.md +113 -0
- package/skills/melonjs-effects-and-shaders/SKILL.md +178 -0
- package/skills/melonjs-events/SKILL.md +159 -0
- package/skills/melonjs-getting-started/SKILL.md +183 -0
- package/skills/melonjs-input/SKILL.md +166 -0
- package/skills/melonjs-lighting/SKILL.md +139 -0
- package/skills/melonjs-loading-assets/SKILL.md +186 -0
- package/skills/melonjs-particles-and-trails/SKILL.md +136 -0
- package/skills/melonjs-performance/SKILL.md +183 -0
- package/skills/melonjs-physics/SKILL.md +321 -0
- package/skills/melonjs-plugins/SKILL.md +191 -0
- package/skills/melonjs-renderables/SKILL.md +214 -0
- package/skills/melonjs-renderer-backends/SKILL.md +173 -0
- package/skills/melonjs-scenes-and-state/SKILL.md +180 -0
- package/skills/melonjs-sprites-and-animation/SKILL.md +173 -0
- package/skills/melonjs-tilemaps/SKILL.md +213 -0
- package/skills/melonjs-ui-and-text/SKILL.md +65 -0
- package/build/audio/backend.d.ts +0 -140
- package/build/audio/backend.d.ts.map +0 -1
- package/build/loader/parsers/fetchdata.d.ts +0 -32
- package/build/loader/parsers/fetchdata.d.ts.map +0 -1
|
@@ -1,149 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
* Renderer-owned GPU texture store for the WebGPU backend — the counterpart
|
|
3
|
-
* of `MaterialBatcher`'s createTexture2D/bindTexture2D/deleteTexture2D tier,
|
|
4
|
-
* kept on the renderer (rather than a batcher) so the quad path and the
|
|
5
|
-
* future mesh / tile-layer paths share one resident-texture map.
|
|
6
|
-
*
|
|
7
|
-
* The engine-side bookkeeping is untouched: `TextureCache` still allocates
|
|
8
|
-
* the logical "unit" for each `(source, repeat)` pair; here a unit keys a
|
|
9
|
-
* `{GPUTexture, view, bind groups}` record instead of a GL texture binding.
|
|
10
|
-
* Bind groups pair the texture view with a cached `GPUSampler` — one bind
|
|
11
|
-
* group per (texture, sampler) combination, invalidated wholesale when the
|
|
12
|
-
* filter setting changes (textures stay resident; only the pairing is
|
|
13
|
-
* rebuilt — the WebGPU analogue of `_reapplyTextureFilter`, without the
|
|
14
|
-
* re-parameterization).
|
|
15
|
-
* @ignore
|
|
16
|
-
*/
|
|
17
|
-
export default class WebGPUTextureStore extends TextureStore {
|
|
18
|
-
/**
|
|
19
|
-
* @param {import("../webgpu_renderer.js").default} renderer - the owning renderer
|
|
20
|
-
*/
|
|
21
|
-
constructor(renderer: import("../webgpu_renderer.js").default);
|
|
22
|
-
renderer: import("../webgpu_renderer.js").default;
|
|
23
|
-
device: GPUDevice | undefined;
|
|
24
|
-
/** @type {Map<string, GPUSampler>} */
|
|
25
|
-
samplers: Map<string, GPUSampler>;
|
|
26
|
-
onCacheReset: () => void;
|
|
27
|
-
/**
|
|
28
|
-
* resolve (creating on first use) the sampler for a filter/wrap combo
|
|
29
|
-
* @param {string} filter - "nearest" | "linear"
|
|
30
|
-
* @param {string} repeat - engine wrap mode string
|
|
31
|
-
* @returns {GPUSampler} the sampler
|
|
32
|
-
* @ignore
|
|
33
|
-
*/
|
|
34
|
-
getSampler(filter: string, repeat: string, mipmaps?: boolean): GPUSampler;
|
|
35
|
-
/**
|
|
36
|
-
* The per-draw entry point: resolve the atlas to a bind group pairing
|
|
37
|
-
* its resident GPU texture with the currently-applicable sampler,
|
|
38
|
-
* uploading the source on first use (or re-uploading when forced — the
|
|
39
|
-
* video-frame path).
|
|
40
|
-
* @param {object} texture - a TextureAtlas
|
|
41
|
-
* @param {object} [options] - resolution options
|
|
42
|
-
* @param {boolean} [options.force=false] - re-upload the source pixels
|
|
43
|
-
* @param {string} [options.repeat] - per-use wrap override (else texture.repeat)
|
|
44
|
-
* @returns {GPUBindGroup} the material bind group for this draw
|
|
45
|
-
*/
|
|
46
|
-
getBinding(texture: object, options?: {
|
|
47
|
-
force?: boolean | undefined;
|
|
48
|
-
repeat?: string | undefined;
|
|
49
|
-
}): GPUBindGroup;
|
|
50
|
-
lastRecord: {
|
|
51
|
-
handle: any;
|
|
52
|
-
version: number;
|
|
53
|
-
generation: number;
|
|
54
|
-
} | undefined;
|
|
55
|
-
/**
|
|
56
|
-
* Build the full mip chain of a freshly-uploaded record: one blit pass
|
|
57
|
-
* per level, each rendering the previous level with linear filtering.
|
|
58
|
-
* Runs in its own encoder submitted immediately — queue ordering places
|
|
59
|
-
* it after the level-0 copy (a queue operation) and before the frame's
|
|
60
|
-
* own command buffer, so the frame's draws sample a complete chain.
|
|
61
|
-
* @param {object} record - the resident record (mipLevelCount > 1)
|
|
62
|
-
* @ignore
|
|
63
|
-
*/
|
|
64
|
-
generateMipmaps(record: object): void;
|
|
65
|
-
mipLayout: GPUBindGroupLayout | undefined;
|
|
66
|
-
mipPipeline: GPURenderPipeline | undefined;
|
|
67
|
-
mipSampler: GPUSampler | undefined;
|
|
68
|
-
/**
|
|
69
|
-
* Resolve the view + sampler a resident record should be bound with,
|
|
70
|
-
* plus the cache key identifying that pair. Shared by the one-texture
|
|
71
|
-
* material path and the mesh path, so the two cannot drift on which
|
|
72
|
-
* view a mip-wanting consumer gets.
|
|
73
|
-
* @ignore
|
|
74
|
-
*/
|
|
75
|
-
viewAndSampler(record: any, texture: any, wrap: any, wantMips: any): {
|
|
76
|
-
view: any;
|
|
77
|
-
sampler: GPUSampler;
|
|
78
|
-
key: string;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* The group-1 material for a MESH: the diffuse texture/sampler pair plus
|
|
82
|
-
* the per-texel opacity pair (MTL `map_d`, #1575).
|
|
83
|
-
*
|
|
84
|
-
* Always four bindings. A mesh with no alpha map passes the shared white
|
|
85
|
-
* pixel, whose red channel is 1 — so the shader's multiply is a no-op and
|
|
86
|
-
* the same pipeline layout serves both cases rather than splitting the
|
|
87
|
-
* mesh family in two.
|
|
88
|
-
* @param {TextureAtlas} texture - the diffuse texture
|
|
89
|
-
* @param {TextureAtlas} alphaTexture - the opacity map, or the white pixel
|
|
90
|
-
* @param {object} [options] - wrap / mipmap options, as `getBinding` takes
|
|
91
|
-
* @returns {GPUBindGroup} the group-1 bind group
|
|
92
|
-
* @ignore
|
|
93
|
-
*/
|
|
94
|
-
getMeshBinding(texture: TextureAtlas, alphaTexture: TextureAtlas, options?: object): GPUBindGroup;
|
|
95
|
-
/**
|
|
96
|
-
* the per-sampler material bind group for a resident record (shared by
|
|
97
|
-
* the image and compressed upload paths)
|
|
98
|
-
* @ignore
|
|
99
|
-
*/
|
|
100
|
-
bindGroupFor(record: any, texture: any, wrap: any, wantMips?: boolean): any;
|
|
101
|
-
/**
|
|
102
|
-
* Ensure the texture is resident (same upload/validation path as
|
|
103
|
-
* getBinding) and return its record — callers composing their own bind
|
|
104
|
-
* groups (the lit batcher pairs the color view with a normal map) need
|
|
105
|
-
* the raw view rather than the standard material group.
|
|
106
|
-
* @param {object} texture - the texture atlas to resolve
|
|
107
|
-
* @param {object} [options] - same options as getBinding
|
|
108
|
-
* @returns {object} the resident record ({texture, view, width, height, …})
|
|
109
|
-
*/
|
|
110
|
-
getResidentRecord(texture: object, options?: object): object;
|
|
111
|
-
/**
|
|
112
|
-
* Dispose of a GPUTexture safely: while a frame is being recorded the
|
|
113
|
-
* texture may be referenced by already-recorded draws (destroying it
|
|
114
|
-
* would make `queue.submit()` reject the whole command buffer), so it
|
|
115
|
-
* parks on the renderer's retired list and is destroyed after submit.
|
|
116
|
-
* @param {GPUTexture} gpuTexture - the texture to dispose of
|
|
117
|
-
* @ignore
|
|
118
|
-
*/
|
|
119
|
-
retire(gpuTexture: GPUTexture): void;
|
|
120
|
-
/**
|
|
121
|
-
* drop every (texture, sampler) bind-group pairing while keeping the
|
|
122
|
-
* textures resident — the filter setting changed and the next draw
|
|
123
|
-
* re-pairs each texture with the newly-resolved sampler
|
|
124
|
-
*/
|
|
125
|
-
invalidateBindGroups(): void;
|
|
126
|
-
/**
|
|
127
|
-
* Destroy the resident GPU texture(s) associated with an image — every
|
|
128
|
-
* `(source, repeat)` unit the cache knows about, mirroring
|
|
129
|
-
* `MaterialBatcher.deleteTexture2D`'s multi-repeat sweep.
|
|
130
|
-
* @param {object} texture - a TextureAtlas
|
|
131
|
-
*/
|
|
132
|
-
destroyTexture(texture: object): void;
|
|
133
|
-
/**
|
|
134
|
-
* drop every unit association and dispose of the resident textures
|
|
135
|
-
*/
|
|
136
|
-
/**
|
|
137
|
-
* Release the GPU texture behind a record. The base calls this; the device
|
|
138
|
-
* defers the actual destroy until the frame that referenced it has retired.
|
|
139
|
-
* @param {GPUTexture} handle - the texture to release
|
|
140
|
-
* @ignore
|
|
141
|
-
*/
|
|
142
|
-
onDestroy(handle: GPUTexture): void;
|
|
143
|
-
/**
|
|
144
|
-
* full teardown (device loss / renderer destroy)
|
|
145
|
-
*/
|
|
146
|
-
destroy(): void;
|
|
147
|
-
}
|
|
1
|
+
|
|
148
2
|
import { TextureStore } from "../../gpu/texturestore.js";
|
|
149
3
|
//# sourceMappingURL=store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/video/webgpu/texture/store.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../src/video/webgpu/texture/store.js"],"names":[],"mappings":"AAwBA;;;;;;;;;;;;;;;;GAgBG;AACH;IACC;;OAEG;IACH,sBAFW,OAAO,uBAAuB,EAAE,OAAO,EAoBjD;IAhBA,kDAAwB;IACxB,8BAA6B;IAC7B,sCAAsC;IACtC,UADW,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CACT;IAKzB,yBAMC;IAIF;;;;;;;OAOG;IACH,mBANW,MAAM,UACN,MAAM,sBACJ,UAAU,CAmCtB;IAED;;;;;;;;;;OAUG;IACH,oBANW,MAAM,YAEd;QAA0B,KAAK;QACN,MAAM;KAC/B,GAAU,YAAY,CAuMxB;IAjHE;;;;kBAAwB;IAmH3B;;;;;;;;;OASG;IACH,wBAJW,MAAM,QA0EhB;IA/DC,0CAME;IAIF,2CAYE;IACF,mCAIE;IAsCJ;;;;;;;OAOG;IACH;;;;MAqBC;IAED;;;;;;;;;;;;;;OAcG;IACH,wBAPW,YAAY,gBACZ,YAAY,YACZ,MAAM,GACJ,YAAY,CAoExB;IAED;;;;;OAKG;IACH,4EAeC;IAED;;;;;;;;OAQG;IACH,2BAJW,MAAM,YACN,MAAM,GACJ,MAAM,CAKlB;IAED;;;;;;;;OAQG;IACH,mBAJW,UAAU,QAMpB;IAED;;;;OAIG;IACH,6BAIC;IAED;;;;;OAKG;IACH,wBAFW,MAAM,QAchB;IAED;;OAEG;IACH;;;;;;OAMG;IACH,kBAJW,UAAU,QAMpB;IAED;;OAEG;IACH,gBAIC;CACD;6BApmB4B,2BAA2B"}
|
|
@@ -30,14 +30,12 @@ export default class WebGPURenderer extends Renderer {
|
|
|
30
30
|
readonly adapter: GPUAdapter | undefined;
|
|
31
31
|
/**
|
|
32
32
|
* The WebGPU device, set once {@link WebGPURenderer#init} resolves.
|
|
33
|
-
* @name device
|
|
34
33
|
* @type {GPUDevice|undefined}
|
|
35
34
|
* @readonly
|
|
36
35
|
*/
|
|
37
36
|
readonly device: GPUDevice | undefined;
|
|
38
37
|
/**
|
|
39
38
|
* The WebGPU canvas context
|
|
40
|
-
* @name context
|
|
41
39
|
* @type {GPUCanvasContext}
|
|
42
40
|
*/
|
|
43
41
|
context: GPUCanvasContext;
|
|
@@ -50,37 +48,6 @@ export default class WebGPURenderer extends Renderer {
|
|
|
50
48
|
readonly preferredFormat: string | undefined;
|
|
51
49
|
cache: TextureCache;
|
|
52
50
|
currentTransform: Matrix3d;
|
|
53
|
-
/**
|
|
54
|
-
* Advanced-blend state — the WebGPU twin of the WebGL bracket, and
|
|
55
|
-
* deliberately the same shape. The six CSS modes fixed-function
|
|
56
|
-
* cannot express are composited by capturing the destination,
|
|
57
|
-
* rendering the draw to an offscreen target, then blitting that
|
|
58
|
-
* through {@link BlendEffect}. All lazily created.
|
|
59
|
-
*
|
|
60
|
-
* `_advancedBlendBusy` is a DEPTH, not a flag: the bracket nests
|
|
61
|
-
* inside itself (the composite blit re-enters `setBatcher`).
|
|
62
|
-
*
|
|
63
|
-
* One documented difference from WebGL: masks need no handling here.
|
|
64
|
-
* `beginPass` attaches the shared depth/stencil texture whatever the
|
|
65
|
-
* current target is, so an armed mask clips the offscreen draw
|
|
66
|
-
* directly — where the GL backend has to disable the test (its
|
|
67
|
-
* offscreen FBO owns a separate, zeroed stencil) and let the
|
|
68
|
-
* composite carry the clip instead. Same result, different route.
|
|
69
|
-
* @ignore
|
|
70
|
-
*/
|
|
71
|
-
_advancedBlendEffect: BlendEffect | undefined;
|
|
72
|
-
/** @ignore */
|
|
73
|
-
_advancedBlendCapture: any;
|
|
74
|
-
/** @ignore */
|
|
75
|
-
_advancedBlendTarget: WebGPURenderTarget | undefined;
|
|
76
|
-
/** @ignore */
|
|
77
|
-
_advancedBlendOpen: boolean;
|
|
78
|
-
/** @ignore */
|
|
79
|
-
_advancedBlendBusy: number;
|
|
80
|
-
/** @ignore */
|
|
81
|
-
_advancedBlendParent: WebGPURenderTarget | null;
|
|
82
|
-
/** @ignore */
|
|
83
|
-
_advancedBlendWarned: Set<any>;
|
|
84
51
|
onGameReset: () => void;
|
|
85
52
|
onCanvasResize: () => void;
|
|
86
53
|
GPUVendor: string | undefined;
|
|
@@ -133,8 +100,6 @@ export default class WebGPURenderer extends Renderer {
|
|
|
133
100
|
height: number;
|
|
134
101
|
} | undefined;
|
|
135
102
|
}): Texture2d | null;
|
|
136
|
-
/** @ignore */
|
|
137
|
-
_toFrameTexture(options?: {}): any;
|
|
138
103
|
/**
|
|
139
104
|
* Draw a pooled render target through an effect's pipeline as a
|
|
140
105
|
* screen-space quad — the compositing primitive of the post-effect
|
|
@@ -151,35 +116,6 @@ export default class WebGPURenderer extends Renderer {
|
|
|
151
116
|
* @override
|
|
152
117
|
*/
|
|
153
118
|
override blitEffect(source: import("../rendertarget/webgpurendertarget.js").default, x: number, y: number, width: number, height: number, effect: ShaderEffect, keepBlend?: boolean): void;
|
|
154
|
-
/**
|
|
155
|
-
* Say once, per excluded path and mode, that an advanced blend mode is
|
|
156
|
-
* falling back to `"normal"`. A silent data-dependent fallback is exactly
|
|
157
|
-
* what the advanced-blend work exists to remove, so the exclusions are
|
|
158
|
-
* loud.
|
|
159
|
-
* @param {string} what - the excluded path, named for the message
|
|
160
|
-
* @ignore
|
|
161
|
-
*/
|
|
162
|
-
_warnAdvancedBlendFallback(what: string): void;
|
|
163
|
-
/**
|
|
164
|
-
* Close a pending advanced-blend bracket, if one is open and we are not
|
|
165
|
-
* already inside the bracket machinery.
|
|
166
|
-
* @ignore
|
|
167
|
-
*/
|
|
168
|
-
_drainAdvancedBlend(): void;
|
|
169
|
-
/**
|
|
170
|
-
* Open an advanced-blend bracket: capture the destination, then redirect
|
|
171
|
-
* this draw into an offscreen target.
|
|
172
|
-
* @returns {boolean} false when the effect could not be realized, in which
|
|
173
|
-
* case the draw proceeds unbracketed (plain source-over)
|
|
174
|
-
* @ignore
|
|
175
|
-
*/
|
|
176
|
-
_openAdvancedBlend(): boolean;
|
|
177
|
-
/**
|
|
178
|
-
* Close an advanced-blend bracket: drain the offscreen, retarget to the
|
|
179
|
-
* parent, and composite through {@link BlendEffect}.
|
|
180
|
-
* @ignore
|
|
181
|
-
*/
|
|
182
|
-
_closeAdvancedBlend(): void;
|
|
183
119
|
/**
|
|
184
120
|
* Clear the current clip region with the given color — a full-viewport
|
|
185
121
|
* triangle clipped by the active scissor, drawn with blending replaced
|
|
@@ -231,30 +167,6 @@ export default class WebGPURenderer extends Renderer {
|
|
|
231
167
|
* @returns {WebGPUBatcher} the now-active batcher
|
|
232
168
|
*/
|
|
233
169
|
setBatcher(name?: string): WebGPUBatcher;
|
|
234
|
-
/**
|
|
235
|
-
* Draw a textured triangle mesh — the mesh-path contract of the base
|
|
236
|
-
* renderer, on this backend's pipeline-state model. Unlike GL there is
|
|
237
|
-
* no device state to toggle: depth testing (write + LEQUAL) and the
|
|
238
|
-
* per-mesh face culling are axes of the pipeline the mesh batcher
|
|
239
|
-
* looks up per flush, and the once-per-target depth clear is the
|
|
240
|
-
* pass's `depthLoadOp` (armed by `clear()`/`setRenderTarget`).
|
|
241
|
-
* @param {object} mesh - a Mesh object with vertices, uvs, indices, and texture properties
|
|
242
|
-
* @param {Matrix3d} [modelMatrix] - the mesh's model matrix. When given,
|
|
243
|
-
* the mesh is drawn from persistent model-space geometry and placed
|
|
244
|
-
* entirely by uniforms; when omitted, its vertices are taken as
|
|
245
|
-
* already positioned and accumulated through the batcher (the
|
|
246
|
-
* 2D-camera path).
|
|
247
|
-
* @override
|
|
248
|
-
*/
|
|
249
|
-
/**
|
|
250
|
-
* Draw one ground shadow per instance of an `InstancedMesh` (#1515), in a
|
|
251
|
-
* single recorded call over the mesh's own instance buffer.
|
|
252
|
-
* @param {InstancedMesh} mesh - the mesh casting the shadows
|
|
253
|
-
* @param {Matrix3d} shadowMatrix - the group matrix flattened onto the ground
|
|
254
|
-
* @param {object} quad - the shared shadow quad
|
|
255
|
-
* @ignore
|
|
256
|
-
*/
|
|
257
|
-
drawInstancedShadow(mesh: InstancedMesh, shadowMatrix: Matrix3d, quad: object): void;
|
|
258
170
|
drawMesh(mesh: any, modelMatrix: any): void;
|
|
259
171
|
/**
|
|
260
172
|
* Release any retained geometry held for the given mesh (called from
|
|
@@ -290,7 +202,8 @@ export default class WebGPURenderer extends Renderer {
|
|
|
290
202
|
getGlobalAlpha(): number;
|
|
291
203
|
/**
|
|
292
204
|
* set the current blend mode for this renderer. <br>
|
|
293
|
-
*
|
|
205
|
+
* Both GPU renderers support the full set — the Canvas fallback supports
|
|
206
|
+
* every mode below except `"none"`: <br>
|
|
294
207
|
* - "normal" : draws new content on top of the existing content <br>
|
|
295
208
|
* <img src="../images/normal-blendmode.png" width="180"/> <br>
|
|
296
209
|
* - "add", "additive", or "lighter" : color values are added together <br>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webgpu_renderer.d.ts","sourceRoot":"","sources":["../../../src/video/webgpu/webgpu_renderer.js"],"names":[],"mappings":"AAyDA;;;;;;;;;;;;;;;GAeG;AACH,iDANW,OAAO,qBACP,OAAO,GACL;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAC,CAYvD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH;IACC;;OAEG;IACH,qBAFW,mBAAmB,
|
|
1
|
+
{"version":3,"file":"webgpu_renderer.d.ts","sourceRoot":"","sources":["../../../src/video/webgpu/webgpu_renderer.js"],"names":[],"mappings":"AAyDA;;;;;;;;;;;;;;;GAeG;AACH,iDANW,OAAO,qBACP,OAAO,GACL;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAC,CAYvD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH;IACC;;OAEG;IACH,qBAFW,mBAAmB,EA2U7B;IAnUA;;;;OAIG;IACH,kBAHU,UAAU,GAAC,SAAS,CAGN;IAExB;;;;OAIG;IACH,iBAHU,SAAS,GAAC,SAAS,CAGN;IAEvB;;;OAGG;IACH,SAFU,gBAAgB,CAEc;IAExC;;;;;OAKG;IACH,0BAHU,MAAM,GAAC,SAAS,CAGM;IA0BhC;mBACe;IACf,iEAAsC;IAGtC,oBAAmC;IAInC,2BAAyD;IAKzD;mBACe;IACf,qBAA2B;IAG3B;mBACe;IACf;;;QAEE;IACF;mBACe;IACf,iBAAmB;IAEnB;mBACe;IACf,iBAA4B;IAE5B;mBACe;IACf,uBAAuB;IAEvB;;;;;OAKG;IACH,UAJU,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAIJ;I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B;+BAKxB,oBAAoB;+BA1BpB,uCAAuC;wBAL9C,2BAA2B;sBAnBlB,qBAAqB;0BA2C5B,8BAA8B;iCAvBvB,8BAA8B;6BAKrB,qBAAqB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "melonjs",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.4.0",
|
|
4
4
|
"description": "melonJS Game Engine",
|
|
5
5
|
"homepage": "http://www.melonjs.org/",
|
|
6
6
|
"type": "module",
|
|
@@ -50,16 +50,12 @@
|
|
|
50
50
|
},
|
|
51
51
|
"files": [
|
|
52
52
|
"build",
|
|
53
|
-
"
|
|
53
|
+
"skills",
|
|
54
54
|
"README.md",
|
|
55
|
-
"CHANGELOG"
|
|
55
|
+
"CHANGELOG",
|
|
56
|
+
"package.json"
|
|
56
57
|
],
|
|
57
|
-
"dependencies": {
|
|
58
|
-
"core-js": "^3.48.0",
|
|
59
|
-
"howler": "2.2.4"
|
|
60
|
-
},
|
|
61
58
|
"devDependencies": {
|
|
62
|
-
"@types/howler": "^2.2.13",
|
|
63
59
|
"@types/node": "^25.6.0",
|
|
64
60
|
"concurrently": "^9.2.1",
|
|
65
61
|
"del-cli": "^7.0.0",
|
|
@@ -81,12 +77,13 @@
|
|
|
81
77
|
"build": "pnpm lint && tsx scripts/build.js && pnpm types",
|
|
82
78
|
"dist": "pnpm clean && pnpm lint && pnpm vitest run && pnpm build && pnpm doc && cp ../../README.md .",
|
|
83
79
|
"dist:publish": "pnpm clean && pnpm lint && pnpm build && pnpm doc && cp ../../README.md .",
|
|
84
|
-
"doc": "tsx scripts/check-doc-readme.ts &&
|
|
85
|
-
"doc:watch": "typedoc
|
|
80
|
+
"doc": "tsx scripts/check-doc-readme.ts && pnpm doc:css && typedoc && tsx scripts/generate-llms-txt.ts",
|
|
81
|
+
"doc:watch": "typedoc --watch --skipErrorChecking --preserveWatchOutput --logLevel Error",
|
|
86
82
|
"serve": "serve docs",
|
|
87
83
|
"prepublishOnly": "pnpm dist:publish",
|
|
88
84
|
"clean": "tsx scripts/clean.ts",
|
|
89
85
|
"types": "tsc --project tsconfig.build.json && tsx scripts/strip-internal.ts",
|
|
90
|
-
"test:types": "tsc"
|
|
86
|
+
"test:types": "tsc",
|
|
87
|
+
"doc:css": "cat scripts/docs/brand.css scripts/docs/copy-page.css > scripts/docs/.docs.css"
|
|
91
88
|
}
|
|
92
89
|
}
|
package/skills/AGENTS.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# melonJS — agent instructions
|
|
2
|
+
|
|
3
|
+
> **This is a template for a game that *uses* melonJS, not instructions for
|
|
4
|
+
> working on the engine itself.** Copy it to your own project root:
|
|
5
|
+
>
|
|
6
|
+
> ```bash
|
|
7
|
+
> cp node_modules/melonjs/skills/AGENTS.md ./AGENTS.md
|
|
8
|
+
> ```
|
|
9
|
+
>
|
|
10
|
+
> Already have an `AGENTS.md`? Paste the sections below into it. Codex, Cursor,
|
|
11
|
+
> Gemini CLI and anything else following the `AGENTS.md` convention will read it
|
|
12
|
+
> from your project root. Claude Code users should install the plugin instead —
|
|
13
|
+
> `/plugin marketplace add melonjs/melonJS` — which registers the same guidance
|
|
14
|
+
> as 23 routed skills.
|
|
15
|
+
|
|
16
|
+
This project uses **melonJS 20.x**, an open-source HTML5 game engine covering
|
|
17
|
+
2D, 2.5D and 3D, running on WebGPU, WebGL 2 or Canvas with automatic fallback.
|
|
18
|
+
|
|
19
|
+
## Read these before writing engine code
|
|
20
|
+
|
|
21
|
+
Task-oriented guides ship with the package at `node_modules/melonjs/skills/`,
|
|
22
|
+
one directory per subsystem, each ending with a symptom → cause table.
|
|
23
|
+
|
|
24
|
+
**Start at `node_modules/melonjs/skills/melonjs/SKILL.md`** — it routes to the
|
|
25
|
+
right one for the task. Do not read all of them; read the router, then the one
|
|
26
|
+
or two it points at.
|
|
27
|
+
|
|
28
|
+
For anything the guides do not cover, fetch
|
|
29
|
+
<https://melonjs.github.io/melonJS/llms.txt> — an index of every exported class,
|
|
30
|
+
function and type with a one-line summary and a link to its reference page,
|
|
31
|
+
regenerated on every docs build. Deprecated entries are marked. Do not infer an
|
|
32
|
+
API from the shape of the engine; look it up.
|
|
33
|
+
|
|
34
|
+
## Three rules that produce code which runs and is wrong
|
|
35
|
+
|
|
36
|
+
1. **`await app.init()` is mandatory** since 20.0. The `Application` constructor
|
|
37
|
+
builds the world but no renderer, so `addChild` silently succeeds while
|
|
38
|
+
`new Sprite(...)` throws a `TypeError` that names neither the class nor the
|
|
39
|
+
missing call.
|
|
40
|
+
2. **`addChild(child, z)` is the only way to set draw order.** `renderable.z`
|
|
41
|
+
does not exist. Setting `depth` before `addChild` is overwritten by
|
|
42
|
+
`autoDepth`; setting it after does not resort.
|
|
43
|
+
3. **`isKinematic` defaults to `true`**, which silently excludes a renderable
|
|
44
|
+
from pointer events and from the physics broadphase. Plain `Renderable` and
|
|
45
|
+
`Sprite` subclasses need `this.isKinematic = false` — attaching a `Body`
|
|
46
|
+
sets it for you.
|
|
47
|
+
|
|
48
|
+
## Most melonJS bugs are silent, not fatal
|
|
49
|
+
|
|
50
|
+
The engine warns and degrades rather than throwing. A shader effect on the
|
|
51
|
+
Canvas fallback, a `Camera3d` without a GPU backend, a pooled object whose
|
|
52
|
+
`onResetEvent` forgets a property — all render *something*. When output looks
|
|
53
|
+
wrong rather than crashing, check the console for a one-shot warning and consult
|
|
54
|
+
the relevant skill's symptom table before debugging the game logic.
|
|
55
|
+
|
|
56
|
+
## Prefer built-in features
|
|
57
|
+
|
|
58
|
+
Before hand-rolling: `ParticleEmitter`, `Trail`, `Tween`, the built-in
|
|
59
|
+
`ShaderEffect` presets, `Light2d` / `Light3d`, `UIBaseElement` /
|
|
60
|
+
`UITextButton`, `NineSliceSprite`, `TextureAtlas`, `BitmapText`,
|
|
61
|
+
`CanvasRenderTarget` for bake-once drawing, `viewport.shake` / `fadeIn` /
|
|
62
|
+
`fadeOut`, and `save` for persistence.
|
|
63
|
+
|
|
64
|
+
Companion packages cover the rest: `@melonjs/planck-adapter` and
|
|
65
|
+
`@melonjs/matter-adapter` (physics), `@melonjs/spine-plugin` (skeletal
|
|
66
|
+
animation), `@melonjs/tiled-inflate-plugin` (**required** for compressed Tiled
|
|
67
|
+
maps), `@melonjs/debug-plugin`, `@melonjs/capacitor-plugin`.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: melonjs
|
|
3
|
+
description: "Use this skill FIRST for any melonJS task; it routes to the right specialised skill and lists the companion packages. melonJS is an open-source 2D, 2.5D and 3D HTML5 game engine running on WebGPU, WebGL 2 or Canvas. Covers Application setup, the scene graph, renderables, sprites, tilemaps, physics, audio, particles, shaders, and the 3D tier — perspective cameras, meshes and glTF scenes. Triggers on: melonjs, melonJS, me.game, Application, app.init, app.world, Renderable, Sprite, Stage, state.change, Camera2d, Camera3d, Mesh, tilemap, Tiled, TMX, ParticleEmitter, ShaderEffect, how do I make a game, HTML5 game engine."
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# melonJS
|
|
8
|
+
|
|
9
|
+
Entry point for the melonJS skill collection. melonJS is an open-source HTML5
|
|
10
|
+
game engine for indie developers, covering 2D, 2.5D and 3D — perspective and
|
|
11
|
+
orthogonal cameras, GPU-accelerated tilemap rendering, post-processing effects,
|
|
12
|
+
custom shaders, 3D meshes, polygon-accurate physics and modern Tiled workflows.
|
|
13
|
+
It runs on WebGPU, WebGL 2 or Canvas with automatic fallback, and has no runtime
|
|
14
|
+
dependencies.
|
|
15
|
+
|
|
16
|
+
## How to use this skill
|
|
17
|
+
|
|
18
|
+
1. Find the specialised skill below that matches the task and follow it.
|
|
19
|
+
2. If the task involves anything 3D, read `melonjs-3d` **first** — melonJS's
|
|
20
|
+
coordinate conventions are the inverse of OpenGL's, so untutored 3D instincts
|
|
21
|
+
are backwards.
|
|
22
|
+
3. If you are writing melonJS from prior knowledge rather than from the current
|
|
23
|
+
docs, read `melonjs-20-migration` — most published melonJS material predates
|
|
24
|
+
20.0 and its bootstrap no longer exists.
|
|
25
|
+
4. If none of them covers the task, use the escape hatch below rather than
|
|
26
|
+
guessing at an API.
|
|
27
|
+
|
|
28
|
+
## Skill router
|
|
29
|
+
|
|
30
|
+
| Skill | Load when… |
|
|
31
|
+
|---|---|
|
|
32
|
+
| [melonjs-getting-started](../melonjs-getting-started/SKILL.md) | Bootstrapping a game, `new Application`, `await app.init()`, choosing a renderer, preloading assets. |
|
|
33
|
+
| [melonjs-20-migration](../melonjs-20-migration/SKILL.md) | Code based on melonJS 19.x or earlier, or an API that "should exist" but doesn't — `video.init`, `Entity`, `renderable.shader =`. |
|
|
34
|
+
| [melonjs-scenes-and-state](../melonjs-scenes-and-state/SKILL.md) | `Stage` subclasses, the state manager, transitions, pausing, the update loop, timers, tweens, saved data. |
|
|
35
|
+
| [melonjs-renderables](../melonjs-renderables/SKILL.md) | Subclassing `Renderable`, custom `draw()`, draw order, anchors, `floating`, post effects on an object. |
|
|
36
|
+
| [melonjs-sprites-and-animation](../melonjs-sprites-and-animation/SKILL.md) | `Sprite`, frame animation, texture atlases (TexturePacker / Aseprite / ShoeBox), tint, flip, pooling. |
|
|
37
|
+
| [melonjs-input](../melonjs-input/SKILL.md) | Keyboard actions, pointer and touch handling, drag, gamepad, virtual controls. |
|
|
38
|
+
| [melonjs-physics](../melonjs-physics/SKILL.md) | Collision, bodies, movement, spatial queries, and the planck / matter adapters. |
|
|
39
|
+
| [melonjs-tilemaps](../melonjs-tilemaps/SKILL.md) | Tiled maps — TMX/TSX loading, spawning entities from objects, collision layers, isometric maps. |
|
|
40
|
+
| [melonjs-audio](../melonjs-audio/SKILL.md) | Sound effects, music, audio sprites, spatial audio, procedural tone and noise. |
|
|
41
|
+
| [melonjs-effects-and-shaders](../melonjs-effects-and-shaders/SKILL.md) | Post effects, custom GLSL/WGSL shaders, blend modes, colour grading, screen capture. |
|
|
42
|
+
| [melonjs-3d](../melonjs-3d/SKILL.md) | Anything 3D or 2.5D — `Camera3d`, meshes, instancing, `Sprite3d` billboards, `Light3d`, distance fog, glTF scenes. |
|
|
43
|
+
| [melonjs-3d-assets](../melonjs-3d-assets/SKILL.md) | Loading glTF/GLB or OBJ models — materials, imported lights, instancing, and what is not supported. |
|
|
44
|
+
| [melonjs-camera-and-drawing](../melonjs-camera-and-drawing/SKILL.md) | Camera follow, bounds, shake and fade, coordinate conversion, and immediate-mode shape drawing. |
|
|
45
|
+
| [melonjs-ui-and-text](../melonjs-ui-and-text/SKILL.md) | HUDs, buttons, menus, drag-and-drop, `Text` and `BitmapText`, web fonts, panels. |
|
|
46
|
+
| [melonjs-particles-and-trails](../melonjs-particles-and-trails/SKILL.md) | `ParticleEmitter`, burst versus stream, `referenceSpace`, and the `Trail` renderable. |
|
|
47
|
+
| [melonjs-lighting](../melonjs-lighting/SKILL.md) | 2D dynamic lighting — `Light2d`, stage ambient, normal-mapped sprites. |
|
|
48
|
+
| [melonjs-deployment](../melonjs-deployment/SKILL.md) | Scaffolding a project, building, browser support and transpiling, native and mini-game platforms. |
|
|
49
|
+
| [melonjs-loading-assets](../melonjs-loading-assets/SKILL.md) | Resource descriptors, the asset type list, base URLs, cross-origin, progress events, unloading. |
|
|
50
|
+
| [melonjs-renderer-backends](../melonjs-renderer-backends/SKILL.md) | A feature works on one machine but not another; choosing or pinning a backend; degrading gracefully. |
|
|
51
|
+
| [melonjs-events](../melonjs-events/SKILL.md) | The event bus, per-frame and lifecycle events, and subscribing without leaking. |
|
|
52
|
+
| [melonjs-performance](../melonjs-performance/SKILL.md) | Dropped frames, draw-call counts, pooling, batching, culling, baking, profiling. |
|
|
53
|
+
| [melonjs-plugins](../melonjs-plugins/SKILL.md) | Registering the debug, Spine or Tiled-inflate plugins, physics adapters, or writing your own plugin. |
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
## Escape hatch: the full API index
|
|
57
|
+
|
|
58
|
+
These skills are hand-written and deliberately partial — they cover the paths
|
|
59
|
+
people actually take and the mistakes those paths invite. When the task needs
|
|
60
|
+
something they do not mention, do **not** infer an API from the shape of the
|
|
61
|
+
engine. Fetch the generated index instead:
|
|
62
|
+
|
|
63
|
+
<https://melonjs.github.io/melonJS/llms.txt>
|
|
64
|
+
|
|
65
|
+
It is regenerated on every docs build from the same TSDoc comments the reference
|
|
66
|
+
pages render, so it is always current for `master`. It lists every exported
|
|
67
|
+
class, function, interface, type and namespace with a one-line summary and a
|
|
68
|
+
link to its page — fetch the pages you need from there.
|
|
69
|
+
|
|
70
|
+
Two things it gives you that this collection cannot:
|
|
71
|
+
|
|
72
|
+
- **Members.** The skills name classes; `llms.txt` links to the page listing
|
|
73
|
+
every method, property, default and `@since` tag on them.
|
|
74
|
+
- **Deprecations.** Entries marked `**deprecated**` are exactly the APIs that a
|
|
75
|
+
model trained on older melonJS material will reach for. If something you were
|
|
76
|
+
about to write appears with that marker, follow the page for the replacement.
|
|
77
|
+
|
|
78
|
+
If a class, function, namespace or type is absent from `llms.txt`, it is absent
|
|
79
|
+
from the engine's public API — that is the useful negative answer, and it is
|
|
80
|
+
worth acting on rather than writing code around something that does not exist.
|
|
81
|
+
The index lists top-level exports only, so a *member* missing from it proves
|
|
82
|
+
nothing: follow the owning class's page to check that.
|
|
83
|
+
|
|
84
|
+
## The three rules that catch everyone
|
|
85
|
+
|
|
86
|
+
Whatever the task, these produce code that runs and is wrong:
|
|
87
|
+
|
|
88
|
+
1. **`await app.init()` is mandatory** since 20.0. The constructor builds the
|
|
89
|
+
world but not the renderer: a plain renderable can still be added and simply
|
|
90
|
+
never draws, while `new Sprite(...)` / `new Text(...)` throw a `TypeError`
|
|
91
|
+
on the global `game`, which is unset until the first `init()` resolves.
|
|
92
|
+
Neither symptom names the missing call.
|
|
93
|
+
2. **`addChild(child, z)` is the only way to set draw order.** `renderable.z`
|
|
94
|
+
does not exist; setting `depth` before `addChild` is overwritten, and setting
|
|
95
|
+
it after does not resort (except under `Camera3d`).
|
|
96
|
+
3. **`isKinematic` defaults to `true`**, which silently excludes a renderable
|
|
97
|
+
from pointer events and from the physics broadphase. Plain `Renderable` and
|
|
98
|
+
`Sprite` subclasses need `this.isKinematic = false`.
|
|
99
|
+
|
|
100
|
+
## Companion packages
|
|
101
|
+
|
|
102
|
+
melonJS ships optional packages alongside the engine. Reach for these rather
|
|
103
|
+
than reimplementing what they cover — and note the physics adapters and the
|
|
104
|
+
Tiled inflate plugin are *required* for their use cases, not merely convenient.
|
|
105
|
+
|
|
106
|
+
| Package | Use when |
|
|
107
|
+
|---|---|
|
|
108
|
+
| [`@melonjs/planck-adapter`](https://www.npmjs.com/package/@melonjs/planck-adapter) | You want full rigid-body dynamics — stacking, joints, realistic restitution. Pass it as the Application's `physic` setting; the portable `raycast` and `queryAABB` calls work unchanged across adapters (`querySphere` and `raycast3d` are built-in-adapter only). |
|
|
109
|
+
| [`@melonjs/matter-adapter`](https://www.npmjs.com/package/@melonjs/matter-adapter) | Same, backed by matter-js. Choose one adapter per game. |
|
|
110
|
+
| [`@melonjs/tiled-inflate-plugin`](https://www.npmjs.com/package/@melonjs/tiled-inflate-plugin) | **Required** to load gzip-, zlib- or zstd-compressed Tiled maps. Without it, parsing such a map throws `No inflate function set`. |
|
|
111
|
+
| [`@melonjs/spine-plugin`](https://www.npmjs.com/package/@melonjs/spine-plugin) | Skeletal animation authored in Spine, as a melonJS renderable. |
|
|
112
|
+
| [`@melonjs/debug-plugin`](https://www.npmjs.com/package/@melonjs/debug-plugin) | An in-game debug panel — FPS, draw counts, collision-shape and bounds overlays. Register it after `app.init()`. |
|
|
113
|
+
| [`@melonjs/capacitor-plugin`](https://www.npmjs.com/package/@melonjs/capacitor-plugin) | Wrapping a game as a native iOS/Android app: it bridges Capacitor's lifecycle — pause/resume, the hardware back button, orientation lock, splash screen. |
|
|
114
|
+
| [`create-melonjs`](https://www.npmjs.com/package/create-melonjs) | Scaffolding a new project — start here rather than assembling a build by hand. |
|
|
115
|
+
|
|
116
|
+
Plugins are registered **after** `init()`, into a global registry:
|
|
117
|
+
|
|
118
|
+
```js
|
|
119
|
+
import { plugin } from "melonjs";
|
|
120
|
+
import { DebugPanelPlugin } from "@melonjs/debug-plugin";
|
|
121
|
+
|
|
122
|
+
await app.init();
|
|
123
|
+
plugin.register(DebugPanelPlugin, "debugPanel");
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Physics adapters are different — they are an `Application` setting, not a
|
|
127
|
+
plugin:
|
|
128
|
+
|
|
129
|
+
```js
|
|
130
|
+
import { PlanckAdapter } from "@melonjs/planck-adapter";
|
|
131
|
+
|
|
132
|
+
const app = new Application(800, 600, {
|
|
133
|
+
parent: "screen",
|
|
134
|
+
// gravity is in pixels/s²; pixelsPerMeter converts it to the adapter's
|
|
135
|
+
// metres. Both are shown at their defaults; subSteps defaults to 1
|
|
136
|
+
physic: new PlanckAdapter({
|
|
137
|
+
gravity: { x: 0, y: 320 },
|
|
138
|
+
pixelsPerMeter: 32,
|
|
139
|
+
subSteps: 2,
|
|
140
|
+
}),
|
|
141
|
+
});
|
|
142
|
+
await app.init();
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
`melonjs-plugins` covers the registry, the version gate and writing your own.
|
|
146
|
+
|
|
147
|
+
## Prefer built-in features
|
|
148
|
+
|
|
149
|
+
melonJS covers a lot that is easy to reimplement badly. Before hand-rolling,
|
|
150
|
+
check for: `ParticleEmitter` and `Trail`, `Tween` with easing, the built-in
|
|
151
|
+
`ShaderEffect` presets (vignette, scanline, chromatic aberration, glow, dissolve
|
|
152
|
+
and more), `Light2d` / `Light3d`, `UIBaseElement` / `UISpriteElement` /
|
|
153
|
+
`UITextButton`, `NineSliceSprite`, `TextureAtlas` (TexturePacker, ShoeBox,
|
|
154
|
+
Aseprite), `BitmapText`, `CanvasRenderTarget` for bake-once drawing,
|
|
155
|
+
`NoiseTexture2d`, `viewport.shake` / `fadeIn` / `fadeOut`, and `save` for
|
|
156
|
+
localStorage-backed persistence.
|