You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
What's New in melonJS 18.3.0
New Features
Bezier curve drawing — bezierCurveTo(), quadraticCurveTo(), and arcTo() path methods, matching the Canvas 2D API. WebGL renderer tessellates via Path2D.
Gradient fills — createLinearGradient() and createRadialGradient() methods for both Canvas and WebGL renderers, usable with all fill methods
Dashed lines — setLineDash() 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 point — new 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 lifecycle — onResetEvent(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