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.
Version 2.22.0 - 19 November 2026
API Changes
PIXI.WebGLGraphics.graphicsDataPool is now an array of pools indexed by WebGL context id.
Removed Phaser.Signal#validateListener().
Phaser.StateManager#created is now true after the state's create method has returned and false before. Previously it was true while create was running. The new behavior matches its original description. Use the new Phaser.StateManager#loaded if you need the old behavior.
Phaser.Stage#checkVisibility() (called during Phaser.Game#boot()) no longer assigns window.onblur, window.onfocus, window.onpagehide, or window.onpageshow. It uses addEventListener() instead, so handlers you assign to those properties are no longer overwritten. This also means that when several games run on one page, every game now receives these window events. Previously only the most recently booted game did. Use disableVisibilityChange on the games that should ignore them.
Phaser.Stage#destroy() now removes only the listeners Phaser added. It no longer sets window.onblur, window.onfocus, window.onpagehide, or window.onpageshow to null, so handlers you assigned to those properties are kept.
CocoonJS CocoonJS.App.on() listeners are registered once per Stage.
When the renderer is given as Phaser.WEBGL_MULTI, the game no longer falls back to the Canvas renderer if WebGL fails to initialise. It throws the WebGL error, as Phaser.WEBGL already did. If you want a Canvas fallback, give { renderer: Phaser.AUTO, multiTexture: true }.
The Float32Array, Uint32Array, Uint16Array, Int16Array, and ArrayBuffer polyfills are now applied individually when native versions are missing.
Phaser.Device.support32bit now also requires Uint32Array.
New Features
The game config now has an antialiasGL option for the WebGL context's antialias attribute, separate from texture smoothing.
Phaser.Loader#uploadTextures uploads images to the GPU as soon as they load instead of when they're first rendered.
Added Phaser.Game#onPostRender, dispatched at the end of each render. Handy for screenshots and automated tests.
Added Phaser.Game#renderCount and Phaser.Game#updateCount, which count completed renders and logic updates since boot.
Added Phaser.Game#onContextLost and Phaser.Game#onContextRestored, dispatched when the WebGL context is lost or restored.
Added Phaser.StateManager#onStateCreated, dispatched for every state after its preload (if any) has finished and its create (if any) has returned.
Added Phaser.StateManager#loaded, which is true once the state's preload phase has completed, i.e., it has finished loading assets or has started without any assets queued.
Updates
Phaser.Video#createVideoFromBlob() will print a console warning instead of throwing an error if URL or createObjectURL() is unavailable. The Video will still be unusuable in that case, as before this change.
WebGL Graphics redraw circles and ellipses faster.
WebGL Graphics create less garbage when redrawn.
Phaser.Device feature detection makes less use of temporary elements:
Fullscreen API detection probes document.documentElement instead of a temporary div.
Uint8ClampedArrayImageData detection, which feeds Phaser.Device.support32bit, uses new ImageData(1, 1) instead of a temporary canvas. The canvas is only used when the ImageData constructor is unavailable.
Phaser.Device.css3D uses CSS.supports() where it exists.
Changed some Error() messages.
Changed some console messages and elevated some console logs to console errors.
Bug Fixes
Fixed WebGL errors when a Graphics object reused pooled WebGL data from another game.
Fixed WebGL Graphics with more than 65536 vertices rendering incompletely.
Added missing methods in the console polyfill for Internet Explorer 9.
Fixed the Function#bind() polyfill so it returns the target's result.
Fixed Phaser.Tilemap#dump() for Internet Explorer 9.
Fixed multitexture batching drawing sprites with the wrong texture after WebGLRenderer#updateTexture().
TypeScript Fixes
Added: Phaser.BitmapData#getBase64() and Phaser.BitmapData#getImage().
Added: Phaser.Cache data methods addData(), getData(), checkDataKey(), and removeData().
Added: Phaser.Camera#fadeIn().
Added: Phaser.Circle.intersectsLine().
Added: Phaser.Utils.Debug helpers canvasPool(), displayList(), gameInfo(), inputHandler(), and state().
Added: Phaser.Ellipse.intersectsLine().
Added: Phaser.Game#onDestroy signal.
Added: Phaser.Input#addTouchLockCallback() and Phaser.Input#removeTouchLockCallback().
Added: Phaser.Math.trunc().
Added: Phaser.CanvasPool.clear().
Added: Phaser.Point.trunc().
Added: Phaser.RenderTexture#getBase64() and Phaser.RenderTexture#getImage().
Added: Phaser.SoundManager#onStateChange signal.
Added: Phaser.Video methods for mute, pause, resume, and getUserMedia handling.
Changed: Phaser.Ellipse#constains() renamed to Phaser.Ellipse#contains().
Changed: GameConfig.canvasId renamed to canvasID.
Changed: Phaser.Tilemap#createFromObjects() accepts [string, any] for search.
Changed: Phaser.Tilemap#searchTileIndex() gained an all parameter and returns Phaser.Tile | Phaser.Tile[]. When all is set, it returns every matching tile.
Changed: p2 Shape.RECTANGLE renamed to BOX.
Changed: Touch lock callbacks moved from Phaser.Touch to Phaser.Input.
Removed: Phaser.ArrayUtils.rotate().
Removed: Phaser.Component.Core.skipTypeChecks.
Removed: Phaser.Device.isConsoleOpen().
Removed: Phaser.Loader#useXDomainRequest.
Removed: Phaser.Mouse wheel constants WHEEL_UP and WHEEL_DOWN, and the Phaser.Mouse#requestPointerLock() and Phaser.Mouse#releasePointerLock() methods.