Skip to content

Commit 4148609

Browse files
obiotclaude
andauthored
release: melonjs 19.7.1 + spine-plugin 3.0.0 (#1500)
* release: melonjs 19.7.1 + spine-plugin 3.0.0 melonjs 19.7.1 — Three bug fixes, no behavior changes for working code. * WebGL context-restore now invalidates the setBlendMode cache before re-applying. Without this, scenes using a single blend mode after restore kept the driver-default `(ONE, ZERO)` blendFunc and rendered transparent texels as opaque black. Surfaced by the spine-plugin context-loss verification. * UITextButton's `draw(renderer)` override (predates #1310 multi-camera) crashed with TypeError on `viewport.isDefault` every frame for ~3 months / 12 releases — uitextbutton.ts now forwards the viewport, and Container.draw() honors its documented-optional viewport so any legacy `super.draw(renderer)` subclass override keeps working. Closes #1499. New tests/uitextbutton.spec.js + tests/ui-interaction.spec.js pin both the unit and integration paths. * "gpuTilemap is enabled but the active renderer is not WebGL 2" warning was emitted at every Application init even when no TMX layer was ever loaded. Relocated to TMXLayer, latched once per session so multi-layer maps stay quiet and apps without any tilemap stay clean. spine-plugin 3.0.0 — Major upgrade to Spine 4.3 with peer dep melonjs >=19.7.1. Breaking: * Spine runtimes ^4.2.114 → ^4.3.7. Skeleton data is editor-version locked: 4.2 exports won't load on plugin 3.x and vice versa. * Skeleton.yDown = true at module init replaces the manual root-bone scaleY flip + per-constraint gravity invert + +90° canvas rotation offset. The same pattern Spine's own pixi/phaser/canvaskit integrations use. * Full 4.3 pose-system migration through spineObject.skeleton: bone.pose.* / bone.appliedPose.* (was bone.x/.scaleX/.worldX), slot.appliedPose.color / .attachment, drawOrder.appliedPose. Renames setToSetupPose→setupPose, physicsConstraints→physics, MixBlend/MixDirection removed. Added: * WebGL context-loss recovery — SpineBatcher rebuilds GPU resources via the engine's init(renderer) restore path; all spine GL resources funnel through a single canvas-backed ManagedWebGLRenderingContext via src/glContext.js so spine restorables actually fire (a managed context built from a raw GL context has no element to listen on). * 4.3 inherited features: slider constraints, sequence timelines, convex/inverse clipping, physics force vectors. Fixed (canvas-only): * Slot alpha animation now applies — was reading color.a (undefined on melonJS Color) instead of color.alpha. Visible on powerup (stars stayed at full opacity). * 90°-rotated atlas regions positioned correctly — drawRegion was using pre-swap half-dimensions in the post-rotate translate while drawImage used post-swap dimensions, so the dst quad was offset by ±(w−h)/2. Visible as the tank turret detached from the chassis and the raptor visor tilted off his head. * Latent mesh-vs-clip corruption from a stride-2 cargo-cult. Performance: * Canvas SkeletonRenderer mesh vertex buffer 8 → 2 floats per vertex. Removed the dead 4-color-floats interleave (tinting is per-slot via setTint/setGlobalAlpha) then dropped the UV interleave entirely (UVs now read straight from sequence.getUVs in drawMesh). Verified pixel-identical across all 15 example skeletons. Examples + docs: * Spine example data refreshed to 4.3.75-beta exports across 15 characters (sack dropped — removed upstream). ExampleSpine.tsx rewritten off the global game/deprecated video.init to new Application(...). README opening paragraph reframed to "2.5D game engine" with the new positioning (perspective+orthogonal cameras, GPU-accelerated tilemap rendering, Canvas2D auto-fallback, tree-shakeable, ~150 KB minzipped), Graphics section reshuffled around Light2d + 3D mesh + Camera3d. Deps: * vite 8.0.8 → ^8.0.16 (dev-only, in melonjs + examples). Verified: full build green, eslint+biome clean, vitest 4355/0/15. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * docs: fix glOrtho.gif case typo in matrix3d.ts JSDoc `matrix3d.ts:538` referenced `images/glOrtho.gif` but the actual file (at `src/math/images/glortho.gif`, placed there by `ae8499304` along with the rest of the per-module doc image structure) is lowercase. Most web servers serve a 404 for the camel-cased path, so the orthogonal projection diagram was broken on melonjs.github.io. Side note: I'd earlier concluded that ~20 JSDoc `<img>` references were broken because only `src/images/object_properties.png` existed in the single `src/images/` folder. That was wrong — `ae8499304` moved the doc image assets to per-module folders (`src/video/images/`, `src/math/images/`, `src/renderable/images/`, etc.) so the JSDoc tags that use relative paths (`<img src="images/foo.png">` / `<img src="../images/foo.png">`) resolve correctly from each source file's location. All 21 originally-cataloged "missing" images and the 9 WebGL2-only blend mode samples added by #1317 actually live in the right per-module folders. The previous commit on this branch added duplicates to `src/images/` and is now reverted. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent fe9d160 commit 4148609

105 files changed

Lines changed: 29988 additions & 33648 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A modern & lightweight HTML5 game engine
1717
-------------------------------------------------------------------------------
1818
![melonJS](https://melonjs.org/img/alex4-github.png)
1919

20-
[melonJS](https://melonjs.org/) is an open-source 2D game engine designed for indie developers — post-processing effects, custom shaders, 3D mesh support, polygon-accurate physics, modern Tiled workflows, and high performance, all packed into just over 100 KB minzipped of vanilla JS/TS with no toolchain lock-in. Built with ES6 classes and bundled with [esbuild](https://esbuild.github.io).
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).
2121

2222
[melonJS](https://melonjs.org/) is licensed under the [MIT License](LICENSE.md) and actively maintained by the team at AltByte in Singapore.
2323

@@ -30,9 +30,9 @@ melonJS is designed so you can **focus on making games, not on graphics plumbing
3030

3131
- **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.
3232

33-
- **Complete engine, minimal footprint** — Physics, tilemaps, audio, input, cameras, tweens, particles, UI — a full 2D game stack in a single tree-shakeable ES module. No dependency sprawl, no library stitching.
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.
3434

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.
3636

3737
- **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.
3838

@@ -46,15 +46,15 @@ Compatibility
4646
- Compatible with all major browsers (Chrome, Safari, Firefox, Opera, Edge) and mobile devices
4747

4848
Graphics
49-
- 2D sprite-based graphic engine
5049
- Fast WebGL renderer for desktop and mobile devices with fallback to Canvas rendering
5150
- Extensible batcher system for custom rendering pipelines
5251
- High DPI resolution & Canvas advanced auto scaling
53-
- Sprite with 9-slice scaling option, and animation management
54-
- Built-in effects such as tinting, masking and 2D lighting (with optional per-pixel normal-map shading on sprites for 3D-looking dynamic lights)
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)
5554
- Standard spritesheet, single and multiple Packed Textures support
5655
- 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, perspective projection and hardware depth testing
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`
5858
- 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)
5959
- Trail renderable for fading, tapering ribbons behind moving objects (speed lines, sword slashes, magic trails)
6060
- System & Bitmap Text with built-in typewriter effect
@@ -88,12 +88,13 @@ Camera
8888
- Per-camera post-processing pipeline with stackable shader effects and color grading (ColorMatrix)
8989

9090
UI
91-
- Clickable, hoverable and draggable UI elements
92-
- Drag-and-drop support
93-
- Text buttons with built-in styling
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`
9494

9595
Level Editor
9696
- [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
9798
- Uncompressed and [compressed](https://github.com/melonjs/melonJS/tree/master/packages/tiled-inflate-plugin) Plain, Base64, CSV and JSON encoded XML tilemap loading
9899
- Orthogonal, Isometric, Hexagonal (both normal and staggered) and Oblique maps
99100
- Multiple layers with per-layer alpha, tinting and blend modes (multiple background/foreground, collision and Image layers)
@@ -121,7 +122,7 @@ Core
121122
- Tween effects with multiple easing functions (Quadratic, Cubic, Elastic, Bounce, etc.) and Bezier/Catmull-Rom interpolation
122123
- Transition effects
123124
- Pooling support for object recycling
124-
- Basic Particle System
125+
- Particle system with `ParticleEmitter` (emission rate, lifetime, velocity, gravity, blend modes)
125126
- EventEmitter based event system
126127
- Persistent data storage (save/load via localStorage)
127128
- Plugin system for extending engine capabilities
@@ -171,6 +172,7 @@ Examples
171172
* [Compressed Textures](https://melonjs.github.io/melonJS/examples/#/compressed-textures) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/compressedTextures))
172173
* [3D Mesh](https://melonjs.github.io/melonJS/examples/#/mesh-3d) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/mesh3d))
173174
* [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
174176
* [Trail](https://melonjs.github.io/melonJS/examples/#/trail) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/trail))
175177
* [Shader Effects](https://melonjs.github.io/melonJS/examples/#/shader-effects) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/shaderEffects))
176178
* [Spine](https://melonjs.github.io/melonJS/examples/#/spine) ([source](https://github.com/melonjs/melonJS/tree/master/packages/examples/src/examples/spine))

packages/examples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
"react-router-dom": "^7.14.1",
2525
"tsconfig": "workspace:^",
2626
"typescript": "^6.0.2",
27-
"vite": "8.0.8"
27+
"vite": "8.0.16"
2828
}
2929
}

0 commit comments

Comments
 (0)