melonjs 19.7.0 → 19.7.1
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 +13 -11
- package/build/application/application.d.ts.map +1 -1
- package/build/index.js +29 -24
- package/build/index.js.map +2 -2
- package/build/level/tiled/TMXLayer.d.ts.map +1 -1
- package/build/math/matrix3d.d.ts +1 -1
- package/build/renderable/container.d.ts.map +1 -1
- package/build/renderable/ui/uitextbutton.d.ts +2 -1
- package/build/renderable/ui/uitextbutton.d.ts.map +1 -1
- package/build/video/webgl/webgl_renderer.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ A modern & lightweight HTML5 game engine
|
|
|
17
17
|
-------------------------------------------------------------------------------
|
|
18
18
|

|
|
19
19
|
|
|
20
|
-
[melonJS](https://melonjs.org/) is an open-source
|
|
20
|
+
[melonJS](https://melonjs.org/) is an open-source 2.5D game engine designed for indie developers — perspective and orthogonal cameras, GPU-accelerated tilemap rendering, post-processing effects, custom shaders, 3D mesh support, polygon-accurate physics, modern Tiled workflows, and high performance. Runs on WebGL or Canvas2D with automatic fallback, tree-shakeable so you only pay for what you use, and the entire engine fits in ~150 KB minzipped of vanilla JS/TS with no toolchain lock-in. Built with ES6 classes and bundled with [esbuild](https://esbuild.github.io).
|
|
21
21
|
|
|
22
22
|
[melonJS](https://melonjs.org/) is licensed under the [MIT License](LICENSE.md) and actively maintained by the team at AltByte in Singapore.
|
|
23
23
|
|
|
@@ -30,9 +30,9 @@ melonJS is designed so you can **focus on making games, not on graphics plumbing
|
|
|
30
30
|
|
|
31
31
|
- **True renderer abstraction** — Write your game once, run it on WebGL or Canvas2D with zero code changes. The engine handles all GPU complexity behind a unified API, with automatic fallback when WebGL is not available. Designed to support future backends (WebGPU) without touching game code.
|
|
32
32
|
|
|
33
|
-
- **Complete engine, minimal footprint** — Physics, tilemaps, audio, input, cameras, tweens, particles, UI — a full
|
|
33
|
+
- **Complete engine, minimal footprint** — Physics, tilemaps, audio, input, cameras, tweens, particles, UI — a full game stack in a single tree-shakeable ES module. No dependency sprawl, no library stitching.
|
|
34
34
|
|
|
35
|
-
- **Tiled as a first-class citizen** — Deep [Tiled](https://www.mapeditor.org) integration built into the core: orthogonal, isometric, hexagonal and staggered maps, animated tilesets, collision shapes, object properties, compressed formats — all parsed and rendered natively.
|
|
35
|
+
- **Tiled as a first-class citizen** — Deep [Tiled](https://www.mapeditor.org) integration built into the core: orthogonal, isometric, hexagonal and staggered maps, animated tilesets, collision shapes, object properties, compressed formats — all parsed and rendered natively, with GPU-accelerated tile rendering for orthogonal maps under WebGL 2.
|
|
36
36
|
|
|
37
37
|
- **Batteries included, hackable by design** — Get started in minutes with minimal setup. When you need to go deeper: ES6 classes throughout, a plugin system for engine extensions, and a clean architecture that's easy to extend without fighting the framework.
|
|
38
38
|
|
|
@@ -46,15 +46,15 @@ Compatibility
|
|
|
46
46
|
- Compatible with all major browsers (Chrome, Safari, Firefox, Opera, Edge) and mobile devices
|
|
47
47
|
|
|
48
48
|
Graphics
|
|
49
|
-
- 2D sprite-based graphic engine
|
|
50
49
|
- Fast WebGL renderer for desktop and mobile devices with fallback to Canvas rendering
|
|
51
50
|
- Extensible batcher system for custom rendering pipelines
|
|
52
51
|
- High DPI resolution & Canvas advanced auto scaling
|
|
53
|
-
- Sprite with 9-slice scaling option,
|
|
54
|
-
- Built-in effects such as tinting, masking and
|
|
52
|
+
- Sprite with 9-slice scaling option, frame animation, and optional per-pixel normal-map shading for 3D-looking dynamic lights
|
|
53
|
+
- Built-in effects such as tinting, masking, and CSS-style blend modes (normal, additive, multiply, screen, darken, lighten)
|
|
55
54
|
- Standard spritesheet, single and multiple Packed Textures support
|
|
56
55
|
- Compressed texture support (DDS, KTX, KTX2, PVR, PKM) with automatic format detection and fallback
|
|
57
|
-
- 3D mesh rendering with OBJ/MTL model loading, multi-material support,
|
|
56
|
+
- 3D mesh rendering with OBJ/MTL model loading, multi-material support, hardware depth testing, and perspective projection via `Camera3d`
|
|
57
|
+
- `Light2d` as a first-class `Renderable` — multiple dynamic lights, radial-gradient falloff, illumination-only mode, and procedural rendering via `drawLight`
|
|
58
58
|
- Built-in shader effects (Flash, Outline, Glow, Dissolve, CRT, Hologram, etc.) with multi-pass chaining via `postEffects`, plus custom shader support via `ShaderEffect` for per-sprite fragment effects (WebGL)
|
|
59
59
|
- Trail renderable for fading, tapering ribbons behind moving objects (speed lines, sword slashes, magic trails)
|
|
60
60
|
- System & Bitmap Text with built-in typewriter effect
|
|
@@ -88,12 +88,13 @@ Camera
|
|
|
88
88
|
- Per-camera post-processing pipeline with stackable shader effects and color grading (ColorMatrix)
|
|
89
89
|
|
|
90
90
|
UI
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
-
|
|
91
|
+
- `UIBaseElement` / `UISpriteElement` containers for clickable, hoverable and holdable elements with full pointer-event wiring
|
|
92
|
+
- `Draggable` / `DropTarget` for drag-and-drop with configurable overlap or contains-check
|
|
93
|
+
- `UITextButton` text button with hover, press, and key-bind support — built on `BitmapText`
|
|
94
94
|
|
|
95
95
|
Level Editor
|
|
96
96
|
- [Tiled](https://www.mapeditor.org) map format [up to 1.12](https://doc.mapeditor.org/en/stable/reference/tmx-changelog/) built-in support for easy level design
|
|
97
|
+
- **GPU-accelerated tile rendering** for orthogonal maps under WebGL 2 — each layer draws as a single quad with no per-tile loop, ~5–8× faster than the legacy CPU renderer on dense maps. Honors animated tiles, flip bits, per-layer opacity/tint/blend, and oversized bottom-aligned tiles; falls back transparently to the CPU renderer on isometric/staggered/hexagonal layers or non-WebGL-2 contexts
|
|
97
98
|
- Uncompressed and [compressed](https://github.com/melonjs/melonJS/tree/master/packages/tiled-inflate-plugin) Plain, Base64, CSV and JSON encoded XML tilemap loading
|
|
98
99
|
- Orthogonal, Isometric, Hexagonal (both normal and staggered) and Oblique maps
|
|
99
100
|
- Multiple layers with per-layer alpha, tinting and blend modes (multiple background/foreground, collision and Image layers)
|
|
@@ -121,7 +122,7 @@ Core
|
|
|
121
122
|
- Tween effects with multiple easing functions (Quadratic, Cubic, Elastic, Bounce, etc.) and Bezier/Catmull-Rom interpolation
|
|
122
123
|
- Transition effects
|
|
123
124
|
- Pooling support for object recycling
|
|
124
|
-
-
|
|
125
|
+
- Particle system with `ParticleEmitter` (emission rate, lifetime, velocity, gravity, blend modes)
|
|
125
126
|
- EventEmitter based event system
|
|
126
127
|
- Persistent data storage (save/load via localStorage)
|
|
127
128
|
- Plugin system for extending engine capabilities
|
|
@@ -171,6 +172,7 @@ Examples
|
|
|
171
172
|
* [Compressed Textures](https://melonjs.github.io/melonJS/examples/#/compressed-textures) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/compressedTextures))
|
|
172
173
|
* [3D Mesh](https://melonjs.github.io/melonJS/examples/#/mesh-3d) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/mesh3d))
|
|
173
174
|
* [3D Mesh Material](https://melonjs.github.io/melonJS/examples/#/mesh-3d-material) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/mesh3dMaterial))
|
|
175
|
+
* [AfterBurner Clone](https://melonjs.github.io/melonJS/examples/#/after-burner) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/afterBurner)) — `Camera3d` + 3D Mesh arcade shooter
|
|
174
176
|
* [Trail](https://melonjs.github.io/melonJS/examples/#/trail) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/trail))
|
|
175
177
|
* [Shader Effects](https://melonjs.github.io/melonJS/examples/#/shader-effects) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/shaderEffects))
|
|
176
178
|
* [Spine](https://melonjs.github.io/melonJS/examples/#/spine) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/spine))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../src/application/application.ts"],"names":[],"mappings":"AAAA,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AAI;IActB;;;;;OAKG;IACH,IAAI,MAAM,IAAI,iBAAiB,CAE9B;IAED;;;;;;;OAOG;IACH,MAAM,IAAI,IAAI;IAId;;;;;;;;OAQG;IACH,OAAO,CAAC,YAAY,GAAE,OAAc,GAAG,IAAI;IAiD3C;;OAEG;IACH,OAAO,IAAI,IAAI;IAIf;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,GAAE,OAAe,GAAG,IAAI;IAInC;;;OAGG;IACH,MAAM,CAAC,KAAK,GAAE,OAAe,GAAG,IAAI;IAIpC;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,OAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/D,cAAc;IACd,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAKzB,cAAc;IACd,OAAO,IAAI,IAAI;IASf,cAAc;IACd,QAAQ,IAAI,IAAI;IAShB;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IA+C1B;;OAEG;IACH,IAAI,IAAI,IAAI;CAqBZ;AAED;;;;;GAKG;AACH,eAAO,IAAI,IAAI,EAAE,WAAW,CAAC;AAE7B;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,QAE9C"}
|
package/build/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* melonJS Game Engine - 19.7.
|
|
2
|
+
* melonJS Game Engine - 19.7.1
|
|
3
3
|
* http://www.melonjs.org
|
|
4
4
|
* melonjs is licensed under the MIT License.
|
|
5
5
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -9777,7 +9777,7 @@ var Matrix3d = class {
|
|
|
9777
9777
|
}
|
|
9778
9778
|
/**
|
|
9779
9779
|
* generate an orthogonal projection matrix, with the result replacing the current matrix
|
|
9780
|
-
* <img src="images/
|
|
9780
|
+
* <img src="images/glortho.gif"/><br>
|
|
9781
9781
|
* @param left - farthest left on the x-axis
|
|
9782
9782
|
* @param right - farthest right on the x-axis
|
|
9783
9783
|
* @param bottom - farthest down on the y-axis
|
|
@@ -21925,7 +21925,7 @@ var Container = class _Container extends Renderable {
|
|
|
21925
21925
|
if (this.backgroundColor.alpha > 1 / 255) {
|
|
21926
21926
|
renderer2.clearColor(this.backgroundColor);
|
|
21927
21927
|
}
|
|
21928
|
-
const isNonDefaultCamera = !viewport.isDefault;
|
|
21928
|
+
const isNonDefaultCamera = viewport ? !viewport.isDefault : false;
|
|
21929
21929
|
const children = this.getChildren();
|
|
21930
21930
|
for (let i = children.length, obj; i--, obj = children[i]; ) {
|
|
21931
21931
|
const isFloating = obj.floating === true;
|
|
@@ -21936,15 +21936,19 @@ var Container = class _Container extends Renderable {
|
|
|
21936
21936
|
if (isFloating) {
|
|
21937
21937
|
renderer2.save();
|
|
21938
21938
|
renderer2.resetTransform();
|
|
21939
|
-
|
|
21939
|
+
if (viewport) {
|
|
21940
|
+
renderer2.setProjection(viewport.screenProjection);
|
|
21941
|
+
}
|
|
21940
21942
|
}
|
|
21941
21943
|
obj.preDraw(renderer2);
|
|
21942
21944
|
obj.draw(renderer2, viewport);
|
|
21943
21945
|
obj.postDraw(renderer2);
|
|
21944
21946
|
if (isFloating) {
|
|
21945
|
-
|
|
21946
|
-
|
|
21947
|
-
|
|
21947
|
+
if (viewport) {
|
|
21948
|
+
renderer2.setProjection(
|
|
21949
|
+
isNonDefaultCamera ? viewport.worldProjection : viewport.projectionMatrix
|
|
21950
|
+
);
|
|
21951
|
+
}
|
|
21948
21952
|
renderer2.restore();
|
|
21949
21953
|
}
|
|
21950
21954
|
}
|
|
@@ -22538,6 +22542,7 @@ function applyTMXProperties(obj, data2) {
|
|
|
22538
22542
|
var FLIP_H_BIT2 = 1 << 0;
|
|
22539
22543
|
var FLIP_V_BIT2 = 1 << 1;
|
|
22540
22544
|
var FLIP_AD_BIT2 = 1 << 2;
|
|
22545
|
+
var _warnedNoWebGL2Once = false;
|
|
22541
22546
|
function flipMaskFromGid(gid) {
|
|
22542
22547
|
return (gid & TMX_FLIP_H ? FLIP_H_BIT2 : 0) | (gid & TMX_FLIP_V ? FLIP_V_BIT2 : 0) | (gid & TMX_FLIP_AD ? FLIP_AD_BIT2 : 0);
|
|
22543
22548
|
}
|
|
@@ -22728,10 +22733,19 @@ var TMXLayer = class extends Renderable {
|
|
|
22728
22733
|
this.renderMode = "shader";
|
|
22729
22734
|
return;
|
|
22730
22735
|
}
|
|
22731
|
-
if (gpuAllowed
|
|
22732
|
-
|
|
22733
|
-
|
|
22734
|
-
|
|
22736
|
+
if (gpuAllowed) {
|
|
22737
|
+
if (elig.reason === "no-webgl2-renderer") {
|
|
22738
|
+
if (!_warnedNoWebGL2Once) {
|
|
22739
|
+
_warnedNoWebGL2Once = true;
|
|
22740
|
+
console.warn(
|
|
22741
|
+
"melonJS: gpuTilemap is enabled but the active renderer is not WebGL 2 \u2014 falling back to the legacy tile renderer for every tile layer"
|
|
22742
|
+
);
|
|
22743
|
+
}
|
|
22744
|
+
} else {
|
|
22745
|
+
console.warn(
|
|
22746
|
+
`melonJS: layer "${this.name}" using legacy tile renderer (${elig.reason})`
|
|
22747
|
+
);
|
|
22748
|
+
}
|
|
22735
22749
|
}
|
|
22736
22750
|
if (preRenderHint && !this.isAnimated) {
|
|
22737
22751
|
this.renderMode = "prerender";
|
|
@@ -30238,7 +30252,7 @@ var Trigger = class extends Renderable {
|
|
|
30238
30252
|
};
|
|
30239
30253
|
|
|
30240
30254
|
// src/version.ts
|
|
30241
|
-
var version = "19.7.
|
|
30255
|
+
var version = "19.7.1";
|
|
30242
30256
|
|
|
30243
30257
|
// src/system/bootstrap.ts
|
|
30244
30258
|
var initialized = false;
|
|
@@ -33162,6 +33176,7 @@ var WebGLRenderer = class extends Renderer {
|
|
|
33162
33176
|
this.gl.disable(this.gl.SCISSOR_TEST);
|
|
33163
33177
|
this._scissorActive = false;
|
|
33164
33178
|
this.gl.enable(this.gl.BLEND);
|
|
33179
|
+
this.currentBlendMode = void 0;
|
|
33165
33180
|
this.setBlendMode(this.settings.blendMode);
|
|
33166
33181
|
this.reset();
|
|
33167
33182
|
this.cache.units.clear();
|
|
@@ -39114,16 +39129,6 @@ var Application = class {
|
|
|
39114
39129
|
console.log("physics: enabled (no adapter)");
|
|
39115
39130
|
}
|
|
39116
39131
|
}
|
|
39117
|
-
if (this.settings.gpuTilemap && // `gpuTilemap` is meaningful only under WebGL2 — Canvas has no
|
|
39118
|
-
// shader path, and WebGL1 lacks the required extensions. The
|
|
39119
|
-
// `instanceof WebGLRenderer` check narrows `this.renderer` so
|
|
39120
|
-
// `WebGLVersion` (defined as a getter on `WebGLRenderer`) is
|
|
39121
|
-
// well-typed — no `as unknown as ...` cast needed.
|
|
39122
|
-
(!(this.renderer instanceof WebGLRenderer) || this.renderer.WebGLVersion !== 2)) {
|
|
39123
|
-
console.warn(
|
|
39124
|
-
"melonJS: gpuTilemap is enabled but the active renderer is not WebGL 2 \u2014 falling back to the legacy tile renderer for every tile layer"
|
|
39125
|
-
);
|
|
39126
|
-
}
|
|
39127
39132
|
this.lastUpdate = globalThis.performance.now();
|
|
39128
39133
|
if (!this.isInitialized) {
|
|
39129
39134
|
on(STATE_CHANGE, this.repaint, this);
|
|
@@ -41834,7 +41839,7 @@ var UITextButton = class extends UIBaseElement {
|
|
|
41834
41839
|
this.bitmapText.pos.set(this.width / 2, this.height / 2);
|
|
41835
41840
|
this.addChild(this.bitmapText);
|
|
41836
41841
|
}
|
|
41837
|
-
draw(renderer2) {
|
|
41842
|
+
draw(renderer2, viewport) {
|
|
41838
41843
|
const r = renderer2;
|
|
41839
41844
|
if (this.hover) {
|
|
41840
41845
|
r.setColor(this.hoverOnColor);
|
|
@@ -41844,7 +41849,7 @@ var UITextButton = class extends UIBaseElement {
|
|
|
41844
41849
|
r.fill(this.border);
|
|
41845
41850
|
r.setColor(this.borderStrokeColor);
|
|
41846
41851
|
r.stroke(this.border);
|
|
41847
|
-
super.draw(renderer2);
|
|
41852
|
+
super.draw(renderer2, viewport);
|
|
41848
41853
|
}
|
|
41849
41854
|
};
|
|
41850
41855
|
|