Skip to content

v18.3.0

Choose a tag to compare

@obiot obiot released this 06 Apr 23:48
· 27 commits to master since this release
2f42bbb

What's New in melonJS 18.3.0

New Features

  • Bezier curve drawingbezierCurveTo(), quadraticCurveTo(), and arcTo() path methods, matching the Canvas 2D API. WebGL renderer tessellates via Path2D.
  • Gradient fillscreateLinearGradient() and createRadialGradient() methods for both Canvas and WebGL renderers, usable with all fill methods
  • Dashed linessetLineDash() and getLineDash() for stroke operations on both renderers
  • Tiled object factory registry — extensible registerTiledObjectFactory() and registerTiledObjectClass() APIs for plugins to register custom Tiled object handlers without modifying engine code

Changed

  • Application as entry pointnew Application(width, height, options) auto-calls boot(), making it a standalone entry point. video.init() is deprecated.
  • Game singleton decoupled — internal modules no longer import from the barrel index.js; game singleton uses setDefaultGame pattern
  • Stage lifecycleonResetEvent(app, ...args) and onDestroyEvent(app) now receive the Application instance as first parameter
  • Container defaults — dimensions default to Infinity (no intrinsic size, no clipping), removing dependency on game.viewport
  • EventEmitter — native context parameter support on on()/once(), eliminating .bind() closure overhead

Bug Fixes

  • BitmapText bounding box — width uses last glyph visual extent; height uses actual glyph extents instead of capHeight; baseline shifts use real glyph metrics for all baselines; y offset starts at first visible pixel
  • BitmapText multiline baseline — shift applied once for entire text block instead of per-line (which caused accumulating offsets)
  • Camera2d — floating containers with Infinity bounds (e.g., HUD) are now always visible, fixing a regression where HUD elements stopped rendering
  • Sprite flicker — time-based flickering (~15 flashes/sec) replaces per-draw-call toggle that broke with multi-camera setups
  • Path2D — fix quadraticCurveTo/bezierCurveTo startPoint reference bug and adaptive segment count
  • Application — fix settings mutation, white flash on load, pool cleanup errors
  • WebGLRenderer — fix setBlendMode premultipliedAlpha tracking
  • Text — fix multiline textBaseline y offset, power-of-two texture sizes

Performance

  • BitmapText — precompute glyphMinTop/glyphMaxBottom once in font parsing; cache measureText results in setText/resize