Skip to content

Releases: melonjs/melonJS

v18.2.2

29 Mar 13:41
a9147da

Choose a tag to compare

What's Changed

melonJS Team

  • Chore: fix missing README on the npm release (58a534d)
  • Copy root README into melonjs package during dist (6ef58cd)
  • Bump spine-plugin to 2.0.1 (501de1f)

Full Changelog: 18.2.1...18.2.2

v18.2.1

29 Mar 13:21
b4d6a68

Choose a tag to compare

What's Changed

melonJS Team

  • Fix loading screen logo persisting after preload completes (3f0be6f)

Full Changelog: 18.2.0...18.2.1

v18.2.0

29 Mar 10:26
37eaf7f

Choose a tag to compare

What's New in melonJS 18.2.0

New Features

  • Multi-camera support — stages can now have multiple cameras for split-screen, minimaps, and multi-viewport layouts
  • Extensible batcher system — custom Batcher subclasses with configurable maxVertices, indexed drawing (settings.indexed), and custom projection uniform names (settings.projectionUniform)
  • Tiled 1.8–1.12 full support — oblique maps, capsule shapes, list properties, embedded base64 images, tile sub-rectangles, tilerendersize/fillmode, layer blend modes, per-object opacity/visibility, repeatx/repeaty, parallaxoriginx/parallaxoriginy, class-type properties, isCollection flag
  • RoundRect as collision shape — can now be used for SAT collision via polygon-approximated rounded corners
  • Expanded blend modes — Canvas: overlay, darken, lighten, color-dodge, color-burn, hard-light, soft-light, difference, exclusion; WebGL2: darken, lighten via gl.MIN/gl.MAX

Changed

  • TypeScript — converted plugin, camera, particles emitter, state, audio, application, input, UI, and pointer modules to TypeScript
  • CDN URLs — README now uses cdn.jsdelivr.net instead of esm.run (which is still in beta)

Bug Fixes

  • WebGLRenderersetBatcher() now rebinds the shared vertex buffer when switching batchers, allowing custom batchers with their own GL buffers
  • WebGLRenderersetBlendMode() now accepts a premultipliedAlpha parameter for correct blending with non-premultiplied textures
  • Renderer — add base setBlendMode() and GPURenderer property to fix TypeScript casts
  • Pluginplugin.register() now uses pluginClass.name for reliable name derivation
  • TMXTileset — fix animation key using first frame tile ID instead of the tile's own ID
  • CanvasRenderer — replace bezier ellipse approximation with native context.ellipse() (with polyfill)
  • Plugin — fix plugin.get() throwing TypeError when searching by name with no match
  • Events — fix duplicate BLUR entry (was missing FOCUS)
  • UIBaseElement — fix isDraggable JSDoc and released default
  • Application — fix constructor options not being optional, fix getUriFragment() unsafe cast
  • CanvasRenderersetProjection() now properly applies the projection matrix as a canvas 2D transform

Spine Plugin

  • @melonjs/spine-plugin migrated into the monorepo — custom SpineBatcher with two-color tinting, indexed drawing, expanded example with 17 official Spine characters

v18.1.0

23 Mar 04:19
b444554

Choose a tag to compare

What's New in melonJS 18.1.0

New Features

  • ShaderEffect class — simplified custom shader API that only requires a fragment apply(color, uv) function. Vertex shader, uniforms, and texture sampling boilerplate are handled automatically. Silently disabled in Canvas mode.
  • create-melonjs CLI — scaffold a new game project in seconds with npm create melonjs my-game
  • Inline source code viewer — examples now have a "Show Code" button to view syntax-highlighted source alongside the running game
  • API docs landing page — new home page with quick start, feature overview, and common tasks
  • API docs categories — sidebar organized into 14 categories (Rendering, Physics, Input, etc.)

Changed

  • Physics — collision response is now mass-proportional; overlap and velocity correction are split based on relative mass
  • Entity — deprecated in favor of Sprite/Renderable + Body (#1008)
  • Loader — modernized with Promise-based asset loading for improved parallel performance; onload/onProgress/onError deprecated in favor of events
  • TMX — refactored TMXUtils into reusable decode.ts and xml.ts modules
  • Compositor → BatcherCompositor, QuadCompositor, PrimitiveCompositor renamed to Batcher, QuadBatcher, PrimitiveBatcher (old names still work with deprecation warnings)

Bug Fixes

  • Texture cache overflow — flush and rebatch when GPU texture units are exhausted instead of throwing (#1280)
  • setAntiAlias — now controls GL texture filtering (GL_NEAREST vs GL_LINEAR) on all bound textures (#1279)
  • createPattern leak — clean up previous GPU texture when repeat mode changes (#1278)
  • Custom shader support — properly flush and restore default shader per draw call, fix setUniform using wrong GL program, reset sampler uniform on shader switch
  • TMX — fix hexagonal pixelToTileCoords mutation, canvas memory leak, collision shape dimensions, XML parsing crash, GC pressure from vector allocations
  • Sprite — fix body-renderable misalignment with trimmed atlas frames, visual vibration on flip, jumping on rotated frames (#1201, #1214)
  • Path2D — fix SVG arc parsing and ellipse rotation (#1198)
  • WebGLRenderer — fix polygon corruption from vertex mutation, scissor restore, drawVertices vertex count, resize setAntiAlias corruption
  • Z-ordering — fix reset during collision response

Performance

  • TMX loading — ~20-40% faster via tileset caching, pre-allocated decode buffers, and fast path for base64 data
  • WebGL renderingfillRect, fillEllipse, fillArc, fillRoundRect, fillPolygon now generate geometry directly, bypassing path2D and earcut
  • WebGL batching — quad rendering uses gl.drawElements with index buffer (33% less vertex data), redundant sampler calls eliminated, zero-allocation save/restore stacks
  • Collision — index-based pool access instead of array push/pop in SAT detection
  • Container — O(n) accumulator pattern in getChildByProp/getChildByType instead of O(n²)

Developer Experience

  • 74 JSDoc typo and grammar fixes across 32 files
  • Coin glow shader example in the platformer demo
  • Updated typescript-boilerplate and plugin-template for melonJS 18
  • Archived es6-boilerplate with redirect notice

Full Changelog: 18.0.0...18.1.0

v18.0.0

10 Mar 07:46

Choose a tag to compare

What's Changed

melonJS Team

  • Align @types/node version across monorepo to fix type conflicts (230c57e)
  • Fix lint errors in test files (dafdff2)
  • Update CHANGELOG and fix typo in JSDoc (5af4c0e)
  • Fix CI configuration and resolve security vulnerabilities (9abac8f)
  • Expand test coverage for camera, container, input, and more (3e8f4ed)
  • Replace @teppeis/multimaps with internal ArrayMultimap (1f75477)
  • Optimize collision detection and rendering hot paths (e9c32d0)
  • Fix collision response and polyline junction tunneling (b60382d)
  • bump version to 18.0, removed N-2 deprecated API (36188d4)
  • new backgroundColor property for clearing background between frames (ca2f100)
  • "simplify" anchorPoint definition using a new ObservablePoint class (c174ca6)
  • optimize pool implementation for performance (d9b6946)
  • new ObservableVector2d class rewrite for better performances (04b47a1)
  • improved Observable3d implementation (d934ca5)
  • rewrite of the new ObservableVector3d class for better performances (1fd6355)
  • fix calling set triggering the callback multiple times (a86adf2)
  • optimize uniform setter (5c76b0e)
  • Color constructor now also accepts another Color object as parameter (c536693)
  • faster Color.clone() method (7daf48b)
  • new pool system improvements (45a3a77)
  • align accepted arguments for constructor and reset method when using object pool (1d77516)
  • fix argument(s) being ignored when passing a Color object directly to the pool get() method (01cbb22)
  • fix a regression when no parameters are passed to the pool get method (9886e87)
  • restore compatibility with the legacy pool system (8904aa0)
  • convert BitmapTextData to TS and to the new internal pool system (beaece4)
  • convert Particle to TS and the new pooling system (c2c3f84)
  • pooling: rename destroy to release (5634eee)
  • fix base Renderable class update and draw definition (f1eaff7)
  • fix Tween TS declaration (64ca1cf)
  • clarify callback is optional for flicker() (4b1da51)
  • add missing Bounds type for fill and stroke argument (c5d50d6)
  • fix parseCSS argument type when passing a #RRGGBB string value (7e16a8c)
  • stop throttling window resize and scrolling for a smoother experience (e419afa)
  • fix a regression with window resizing not triggering a canvas and viewport resize (d2e2f3f)
  • regression: add back clearTimeout and clearInterval (63c1a19)
  • refactor: implement a new internal type safe event emitter (55a031b)
  • remove the fetch polyfill (317201c)
  • fix keyboard import following conversion to TS (9394b9f)
  • fix implicit global reference to HTMLVideoElement (3e311e3)
  • revamped the collision example into a sprite benchmark example (932bf35)
  • add the debug panel to the isometric example (f96cadd)
  • chore: replace webdoc with typedoc (75cbb88)
  • release script for GH (8fb3b87)
  • Add npm publish workflow with OIDC trusted publishing (c44f129)

Contributors

@hornta

  • chore: migrate to monorepo (a4c0c24)
  • chore: replace rollup with esbuild (5ec1280)
  • refactor: typescript conversion (9352c3f)
  • refactor: move color to typescript (f0c1c20)
  • refactor: moved much code to typescript (e392c71)
  • refactor: moved polygon and line class to typescript (6088afb)
  • refactor: typescriptify rectangle and line (4d185c9)
  • refactor: convert ellipse to typescript (d0aa4ed)
  • refactor: move platform to typescript (8c3df92)
  • refactor: move dom to typescript (56176cb)
  • refactor: move keyboard to typescript (ff092ba)
  • refactor: move some code to typescript (84931c5)
  • refactor: convert timer class to typescript (5988e88)
  • refactor: typing the application settings (c20b822)
  • feat: add typesafe function to create a pool (748bad7)
  • refactor: add Pool type (4b80f88)
  • refactor: prevent duplicate instances to be added to pool (30b63f2)
  • refactor: remove ponyfill of exitFullscreen (2f0089e)
  • refactor: remove alternative way of providing duration in Tween.to (051c7bc)
  • refactor: improve readability (multiple commits)
  • chore: improve the tests by using vitest in browser mode (8a57c8a)
  • chore: add github workflow (29fc441)
  • chore: added biome as a code formatter (7e440ca)
  • chore: github action to build github pages artifact and upload (aa8893a)
  • chore: added debug plugin (40fd785)
  • refactor: add platformer, lights, drag-and-drop, whac-a-mole, text, and more examples
  • fix: missing default value for url in setBaseURL (d1ca0e2)
  • refactor: switch from import assertions to import attributes (b5f73e9)

@Vareniel

  • implement persistence for child bodies during reset (029efe2)
  • rendering update! (c5d94c5)
  • change instanceof to super.preDraw (b41f6ed)
  • Update quad_compositor.js (2dfbfad)

New Contributors

  • @SergioChan made their first contribution
    • docs(ui): show correct floating default for UI elements (b5622da)

Full Changelog: 17.4.0...18.0.0

v17.4.0

22 Jun 00:57

Choose a tag to compare

Added

  • Renderer: new lineJoin property to set the line join style (only support "round" for now in WebGL mode)
  • Renderer: add support for line thickness for strokePolygon and strokeRect operations in WebGL

Changed

  • Chore: Update to TypeScript 5.5

Fixed

  • Renderer: fix fillEllipse() method in WebGL mode (that was stroking the ellipse instead)
  • TypeScript: fix most (if not all) missing declarations

v17.3.0

04 Jun 08:11

Choose a tag to compare

Added

  • Renderer: add support for line thickness when using strokeLine() in WebGL

Changed

  • Renderer: the setLineWidth() method is now deprecated and replaced by a lineWidth class property

Fixed

  • Renderer: fix animation when using multi-texture atlas in WebGL mode
  • TMX: fix tsx file type import when using a React / Vue build step (thanks @customautosys)
  • Typedef: fix missing definition for video.init() settings parameter, and Application constructor parameter

v17.2.0

21 Apr 23:45

Choose a tag to compare

Added

  • Audio: add missing optional id parameter to 3D / Spatial audio methods
  • Core: add platform detection if running as a standalone web app
  • Loader: add missing unload implementation for font assets

Fixed

  • Loader: properly return an error when attempting to load FontFace assets on non-browser platforms
  • Renderer: fix a regression when a global canvas is available (e.g. webapp adapter for wechat)
  • Renderer: fix a regression when forcing WebGL1 rendering mode (leading to an exception)
  • Renderer: fix a regression when using the canvas rendering mode where antialias setting was not being applied on cached tinted elements

v17.1.0

29 Mar 00:15

Choose a tag to compare

Added

  • Audio: added/exposed 3D Spatial Audio method (stereo(), position(), orientation() and panner())
  • Loader: image resources can now take an array of src urls with different format (preparing for later usage)
  • Math: added a isPowerOfFour() method
  • Renderer: new renderTarget property specifying the default CanvasRenderTarget to use when rendering

Changed

  • Renderer: CanvasTexture is now deprecated and replaced by a new CanvasRenderTarget class

Fixed

  • Core: prevent multiple temporary canvas creation when calling isWebGLSupported multiple times

v17.0.0

05 Mar 01:10

Choose a tag to compare

Added

  • Sprite: add support for aseprite texture atlas (including animation)
  • Atlas: createSpritefromAnim parameter is now optional, and if not defined will use all defined index in the corresponding atlas
  • Loader: new setOptions method that allows specifying custom settings to be applied to fetch requests (crossOrigin, withCredentials, etc..)

Changed

  • Loader: loader settings such as crossOrigin and withCredentials are now deprecated and have to be set through the setOptions method

Fixed

  • Doc: fix hyperlinks to source code within documentation (thanks @Waltibaba)
  • Loader: fix settings for the fetch request not being applied in ES6 builds (thanks @B0sh)