Releases: phaserjs/phaser
Phaser v4.2.0
Version 4.2.0 - Giedi - 19th June 2026
New Features
- New game config options:
render.alphaStrategy: hint to shaders to handle alpha in different ways.render.stencil: disable stencil buffer creation in a game, saving memory.render.stencilAlphaStrategy: set the default alpha strategy used withinStencilobjects, where regular alpha does nothing.
CustomContextgame object is a container which can modify theDrawingContextat render time. This is an advanced rendering technique which reaches into the deep settings of the renderer. Potential uses include:- Toggling stencil testing
- Selectively activating alpha handling strategies
- Freehand GL scissor modification
Mesh2Dgame object renders textured triangles. It batches with regular sprites.Mesh2D#buildOrderedIndicesprecomputes an optimized index list (Mesh2D#indicesOrdered) which arranges triangles into quad-forming pairs, synthesizing degenerate triangles where a triangle has no edge-sharing partner. You choose the optimization strategy (0fast,1medium,2high), paying the cost once when the topology is stable. UseMesh2D#useOrderedIndices(andMesh2D#setUseOrderedIndices) to toggle between the ordered and unordered lists without rebuilding.Mesh2D#renderAsTriangles(andMesh2D#setRenderAsTriangles) renders the mesh as individual triangles via the newBatchHandlerTrirender node, which is suitable for dynamic topology that cannot be optimized into quads.
BatchHandlerTrirender node draws individual textured triangles (gl.TRIANGLES) as a batch. It extendsBatchHandlerQuad, reusing its shader, vertex layout, and texture handling, and adds abatchTrianglesmethod which accepts vertex and index arrays directly.TransformerVertexrender node now splits its per-vertexrunintosetupMatrix(build the transform matrix once per GameObject) andtransformVertex(project a single vertex with the cached matrix). Mesh rendering uses this to avoid rebuilding the transform matrix for every vertex.runis unchanged for existing callers.Stencilgame object is a container whose contents modify the stencil buffer. This is a fast way to persistently mask the game canvas. There are many ways to combine stencils. The default approach is to add layers to the stencil mask.- Unlike stencil masks in Phaser 3, Stencil objects are universal, persistent, and support anything as a stencil source, so long as it draws pixels. Use sprites and filter outputs as stencil sources!
- Operating modes include
addLayer,subtractLayer,clear, andclearRegion. Add and subtract can be inverted.
StencilReferencegame object re-renders a targetStencilwith different settings. This is useful for removing or reusing stencil geometry.AlphaStrategysetting used in the render system allows you to use GLSLdiscardinstead of alpha in many shaders. This is inefficient, but is useful for some effects and situations.- Game config can set a default alpha strategy.
- Stencil and CustomContext allow you to set an alpha strategy.
- Most Phaser shaders handle alpha strategy. Custom shaders must implement it themselves, but you can use compositing (
filtersForceComposite) to run graphics through a compatible shader. - Strategies include:
keep: use alpha as normal.dither: use a dithering algorithm to select pixels to discard.threshold: discard all pixels below a certain alpha.
BatchHandlerrender node now has a config option fortopology, allowing extended nodes to opt into different triangulation modes.BatchHandlerTrirender node renders textured triangles. It is used byMesh2Din triangle rendering mode. This can be more efficient than attempting to compile triangles into quads, which is the default strategy.DrawingContextadds more controls:- Alpha strategy
- Color writemask
- Stencil parameters
WebGLGlobalWrappernow handles stencil write mask.WebGLStencilParametersFactorynow takes an extrawriteMaskparameter.TintModes.MULTIPLY_TWOis a new tint mode which uses a secondary color. This can create powerful new tint effects, such as fire or inversion.- To support this, the encoding of tint mode in shaders with the
ApplyTintaddition has been changed. TheinTintEffectshader attribute has changed from afloatto avec4, and its encoding has changed from a float32 to four uint8s. This should only affect deep uses of the render system. - Game objects with the Tint component now support a second tint per corner (
tint2TopLeftetc), and have a new methodsetTint2(). Additionally, the Mesh2D and Tile objects support constant tint viatint2. (TilemapGPULayer does not support tinting on tiles.)
- To support this, the encoding of tint mode in shaders with the
Timestep#setFPSLimitmethod changes the frame rate at runtime. This method updates derived properties, making it safer than manually adjustingTimestep#fpsLimit.
New Feature: Cone Lights
Cone lights are standard Phaser dynamic lights restricted to a directional cone. They are useful for flashlights, lantern beams, vision cones, headlights, searchlights, and other focal light sources.
Cone lights run through the existing WebGL lighting shader. They do not require a mask, a second Camera, or rendering the map twice. Any Game Object that already works with Phaser lighting can be lit by a cone light.
Full details can be found in the Phaser 4 Cone Lights.md file in the docs folder in this repo.
Light.coneEnabledis a new boolean property that controls if the light is restricted to a cone.Light.coneRotationis a new number property that sets the cone direction in radians.Light.coneInnerAngleis a new number property that sets the inner cone angle in radians.Light.coneOuterAngleis a new number property that sets the outer cone angle in radians.Light.setConeis a new method that sets a Light to be a Cone light.Light.setConeRotationis a new method that sets the cone light rotation.Light.setConeAnglesis a new method that sets the cone light inner and outer angles.Light.disableConeis a new method that disables a cone light.LightsManager.addConeLightis a new method that creates a cone-limited light.- The
DefineLightsGLSL shader gains two new uniforms:vec2 directionandvec3 cone.
Thanks to @FSDevelop for adding this feature.
Changes
GameObjects.Components.Filtersnow adds its RenderStep just before the core render method. This allows other steps to run beforehand.WebGLStencilParametersFactorynow defaults to:enabled: true(stencil test is on by default; testing showed little performance impact)func: gl.EQUAL(stencil test now passes if the stencil buffer is EQUAL to 0)
Fixes
Layerno longer has a duplicate RenderStep which does nothing.SpriteGPULayerno longer tries to access global namespace for Phaser functionality, which can cause a crash in modules.SpriteGPULayerno longer has a Mask component, as it's a Canvas feature but the object is WebGL only.DrawingContextno longer attempts to unbind textures based on the game canvas, which cannot exist and just wastes time.- A Blitter will now call
destroyon its Bob Game Objects as part of its own destroy process. Fix #7292 (thanks @samme) - Fixed a bug where the Line
widthandheightvalues were not being updated after a call tosetTo(). Fix #7270 (thanks @samme) Phaser.Math.Pow2now exportsGetPowerOfTwo,IsSizePowerOfTwoandIsValuePowerOfTwo. Fix #7309 (thanks @Visualizeit
)
Phaser v4.1.0
Version 4.1.0 - Salusa - 30th April 2026
New Features
RenderConfig#mipmapRegenerationoption allows certain framebuffer-based objects to use mipmaps if the game is configured to use mipmaps. This has a cost because mipmaps must be recreated after every change. Currently it only applies to DynamicTextures; Filters cannot render mipmaps. Thanks @flow!Layeris now a trueGameObject. This fixes numerous small inconsistencies, and some big issues such as Filters not working. Thanks @rexrainbow for reporting the initial issue!- The base filter
Controllernow hasgetPaddingCeil(), which returns the ceiling of the current padding. This is mostly used internally to avoid quality loss from fractional padding. If your code callsgetPadding()on a filter controller (typically in a custom render node), you should replace it withgetPaddingCeil().
Fixes
- Fix reversions in rounded rectangle handling. Thanks @laineus!
- Remove duplicate function definition and exposed internal code docs from
RectangleCanvasRenderer. - Fix duplicate texture name resulting from
RenderTexture#saveTexture. Thanks @UnaiNeuronUp! - Fix framebuffers (in filters and DynamicTextures) using mipmaps incorrectly. Now filters do not render with mipmaps. Thanks @flow!
- Fix lack of default export in ESM build. Thanks @kibertoad!
- Fix lack of Class and LOG_VERSION export in ESM build. Thanks to many users including @flow and @rex for helping investigate this!
- Fix
Utils.Array.GetRandomoften returningnullif onlystartIndexwas specified. Now it always returns an array element if part of the array is within range, as documented.
Phaser v4.0.0
After years of development, Phaser 4 is here. This is the biggest release in Phaser's history - a ground-up rebuild of the WebGL renderer with a completely new architecture, while keeping the API you know and love.
Highlights
- New Render Node Architecture - The v3 pipeline system has been replaced with a clean, node-based renderer. Each render node handles a single task, WebGL state is fully managed, and context restoration is built in. Faster, more reliable, and much easier to extend.
- Unified Filter System - FX and Masks from v3 are now a single, powerful Filter system. Apply filters to any game object or camera with no restrictions. Ships with Blur, Glow, Shadow, Pixelate, ColorMatrix, Bloom, Vignette, Wipe, ImageLight, GradientMap, Quantize, Blend, and many more.
- SpriteGPULayer - Render a million sprites in a single draw call, up to 100x faster than standard rendering. GPU-driven animations on position, rotation, scale, alpha, tint, and frame.
- TilemapGPULayer - Render an entire tilemap layer as a single quad. Per-pixel shader cost means up to 4096 x 4096 tiles with no performance penalty. Perfect texture filtering with no seams.
- Overhauled Tint System - Six tint modes:
MULTIPLY,FILL,ADD,SCREEN,OVERLAY,HARD_LIGHT. Color and mode are now separate concerns. - New Game Objects - Gradient, Noise (Cell 2D/3D/4D, Simplex 2D/3D), CaptureFrame, and Stamp.
- Improved Lighting - As simple as
sprite.setLighting(true). Self-shadows, explicit light height, works across most game objects. - Shader and TileSprite Improvements - Cleaner config-based Shader API,
#pragmaGLSL directives, TileSprite now supports atlas frames and tile rotation. - AI Agent Skills - 28 comprehensive skill files included in the repository covering every major Phaser subsystem, plus a dedicated v3 to v4 migration skill. Point your AI coding agent at the
skills/folder for deep Phaser 4 knowledge.
Install
npm install phaserLinks
- 📖 Full Changelog
- 🔄 Migration Guide (v3 to v4)
- 📚 API Documentation](https://docs.phaser.io)
- 🎮 Examples
- 💬 Discord
Thank You
Phaser wouldn't have been possible without the fantastic support of the community. Thank you to everyone who supports our work, who shares our belief in the future of HTML5 gaming, and Phaser's role in that.
Happy coding everyone!
Rich and the whole team at Phaser Studio
Phaser v4.0.0 Release Candidate 7
New Features
Actions.AddEffectBloomallows you to quickly set up a bloom effect, using several filters, on a target Camera or GameObject.Actions.AddEffectShineallows you to quickly set up a shine effect, using a new Gradient and filters, on a target Camera or GameObject.Actions.AddMaskShapeallows you to quickly add shapes to a target Camera or GameObject as Masks. Blurred edges and inversion are supported.Actions.FitToRegiontransforms an object to fit a region, such as the screen.Display.Color: several helper methods now support modifying an existingColorobject instead of creating a new one.HSLToColorHexStringToColorIntegerToColorObjectToColorRGBStringToColorValueToColor
Display.Color.Interpolate: an extra interpolation mode is available.HSVWithHSV: new method to interpolate HSV values, in HSV space.ColorWithColorhas new parameters to allow it to operate in HSV space.hsvflag sets it to operate in HSV space.hsvSignflag can force it to interpolate hue either ascending or descending. Default behavior picks the shortest angle.
Display.ColorBanddescribes a transition between two colors. Intended for use in gradients.Display.ColorRampdescribes a range of colors using ColorBands. Intended for use in gradients.GameObject#isDestroyedflag helps you avoid errors when accessing an object that might have removed expected properties during destruction.GameObjects.Gradientis a new game object which renders gradients.- Gradient shapes include:
LINEARBILINEARRADIALCONIC_SYMMETRICCONIC_ASYMMETRIC
- Gradient repeat modes include:
EXTEND: flat colors extend from start and end.TRUNCATE: transparency extends from start and end.SAWTOOTH: gradient starts over every time it completes.TRIANGULAR: gradient reverses direction every time it gets to the end or start.
- Optional Interleaved Gradient Noise based dithering to eliminate banding.
- Gradient shapes include:
GameObjects.NineSlicehas two new parameters:tileX,tileY, which allow non-corner regions of the NineSlice to tile instead of stretch. Some stretching is still applied to keep the tile count a whole number. Thanks to @skhoroshavin for this contribution!GameObjects.Noiserenders noise patterns.- Control value power curve.
- Select from trigonometric or PCG algorithms.
- Output grayscale, random color, or random normals.
- Cellular noise objects:
GameObjects.NoiseCell2D,NoiseCell3DandNoiseCell4Dprovide cellular/Worley/Voronoi noise.- Render cellular noise with sharp or smooth edges, or random flat colors.
- Smoothly animate scroll through the XY plane or evolve the pattern through Z or ZW axes.
- Add octaves of detail.
- Supports rendering as a texture or normal map for use in other effects.
- Simplex noise objects:
GameObjects.NoiseSimplex2DandNoiseSimplex3Dprovide simplex noise.- Render simplex noise, the successor to Perlin Noise.
- Use gradient flow to smoothly loop noise animation.
- Add octaves of detail.
- Apply turbulence and output shaping for a variety of effects.
- Supports rendering as a texture or normal map for use in other effects.
Tintis overhauled.tintandsetTint()now purely affect the color settings.- Previously, both would silently deactivate fill mode.
tintFillandsetTintFill()are removed.- New property
tintModeand new methodsetTintMode()now set the tint fill mode. Phaser.TintModesenumerates valid tint modes.MULTIPLYFILLADDSCREENOVERLAYHARD_LIGHT
- FILL mode now treats partial alpha correctly.
- BitmapText tinting now works correctly.
- Conversion tip:
foo.setTintFill(color)becomesfoo.setTint(color).setTintMode(Phaser.TintModes.FILL).
CombineColorMatrixfilter for remixing alpha and other channels between images.GradientMapfilter for recoloring images using a gradient and their own brightness.Keyfilter for removing or isolating colors.ImageLightfilter for image-based lighting, a soft, highly realistic form of illumination.PanoramaBlurfilter for adjusting images forImageLight.NormalToolsfilter for manipulating normal maps.Quantizefilter for reducing colors and dithering.Vignettefilter returns from Phaser 3.- Now sets a configurable border color instead of erasing alpha.
- Also supports limited blend modes.
Wipefilter returns from Phaser 3.- Now allows you to set the texture displayed in wiped-away regions.
- Now provides helper functions to set directional reveal/wipe effects.
Math.Hashprovides fast hashes of 1, 2, 3, or 4 dimensional input, using trigonometric or PCG methods.Math.HashCellprovides hashes of 1, 2, 3, or 4 dimensional input, using hash results in a Worley noise field. This produces a continuous but lumpy field.Math.HashSimplexprovides hashes of 1, 2, or 3 dimensional input, using a simplex noise implementation. This produces a continuous, smooth field.Texture#setSourcemethod for updating the source of a texture. Note that, while the source will update, derived values such as object sizes will not. It's advisable to switch between textures of identical size to avoid unexpected transforms.Texture#setDataSourcemethod already existed, but has been changed to be more useful likesetSource.TextureManager#addFlatColormethod for creating a flat texture with custom color, alpha, width, and height. This is intended to act as a temporary stand-in for textures you might not have loaded yet.TextureSource#updateSourcemethod for switching sources directly.- New
Phaser.Types.Textures.TextureSourceandPhaser.Types.Textures.TextureSourceElementtypes to simplify the increasing number of sources for a texture.
Fixes
- Fix
TimeStep#stepLimitFPSto drop fewer frames, running much more smoothly at the target frame rate. Thanks to @flow and @Antriel for discussing the topic.- Documentation in
FPSConfig#limitnow clarifies that frame limits are only necessary when artificially slowing the game below the display refresh rate.
- Documentation in
- Fix
Shapenot respecting lights even though it had the lighting component. - Fix
SpriteGPULayercreation time handling getting confused by 0. - Fix blend modes leaking onto siblings within a
Container. Thanks to @saintflow47, @tickle-monster and @leemanhopeter for reporting this. - Fix texture offsets in
ParseXMLBitmapFont. Thanks to @leemanhopeter. - Fix
DynamicTextureturning black if it initially has a power-of-two resolution and is resized to a non-power-of-two resolution. Now any WebGL texture resize will wrap with REPEAT if it is power of two, or CLAMP_TO_EDGE if not. Thanks to @x-wk for reporting this. - Fix
TextureManager.addUint8Arraymethod, which got premultiplied alpha wrong and flipY wrong.
Phaser v4.0.0 Release Candidate 6
New Features
Texture#setWrap()provides easy access to texture wrap mode in WebGL, which would otherwise be very technical to alter onWebGLTextureWrapperobjects. This is probably of most use to shader authors. Thanks @Legend-Master for raising an issue where power-of-two sprites had unexpected wrapping artifacts.Phaser.Textures.WrapMode.CLAMP_TO_EDGEis always available.Phaser.Textures.WrapMode.REPEATwill only be applied to textures with width and height equal to powers of 2.Phaser.Textures.WrapMode.MIRRORED_REPEATlikewise requires powers of 2.- Added new optional
sortByYparameter to the TilemapcreateFromObjectsmethod (thanks @saintflow47)
Clarifications
- Clarified that
Tilemap.createLayer()withgpuflag enabled only works with orthographic layers, not hexagonal or isometric. Thanks @amirking59!
Updates
- Gamepad buttons initialize as not being pressed, which created a problem when reading Gamepads in one Scene, and then reading them in another Scene. If the player held the button down for even a fraction of a second in the first scene, the second scene would see a bogus Button down event. The
Buttonclass now has a new optionalisPressedboolean parameter which theGamepadclass uses to resolve this, initializing the current pressed state of the Button (thanks @CryonautLex)
Fixes
Blendfilter parametertexturenow correctly documented asstring.ColorMatrixfilter correctly blends input alpha.ColorMatrix.desaturateis no longer documented assaturation.Containernow updates the blend mode it passes to children more accurately, preventing blend modes from leaking from one child into another child's filters. Thanks @leemanhopeter!Filtersnow correctly handles non-central object origins when the object is flipped. Thanks @ChrisCPI!Glowfilter acts consistently whenknockoutis active.Gridshape now sets stroke correctly from optional initialization parameters, at 1px wide. (UseGrid#setStrokeStyle()to customize it further.) Thanks @Grimshad!Maskfilter now correctly resizes and clears when the game resizes to an odd width or height, fixing a bug where masks might overdraw themselves over time. Thanks @leemanhopeter!ParallelFiltersfilter memory leak eliminated (this would occur when both passes had active filters).TilemapGPULayernow respects camera translation. Thanks @aroman!- Fixed a crash in
TweenBuilderwhen the targets array contains null or undefined elements (thanks @aomsir) - The Loader
GetURLfunction did not treatfile://URLs as absolute. When a baseURL is set, it gets prepended to an already-absolute path, producing double-prefixed URLs (thanks @aomsir) - Fixed a bug where multiple
Timelineevents withonceset totruewould silently break the timeline and prevent all future events from firing. Fix #7147 (thanks @TomorrowToday)
Examples, Documentation, Beta Testing and TypeScript
Thanks to the following for helping with the Phaser Examples, Beta Testing, Docs, and TypeScript definitions, either by reporting errors, fixing them, or helping author the docs:
Phaser v4.0.0 Release Candidate 5
New Features
Maskfilter now supportsscaleFactorparameter, allowing the creation of scaled-down framebuffers. This can save memory in large games, but you must manage scaling logic yourself. Thanks to kimdanielarthur-cowlabs for developing the initial solution.Camerahas the new propertyisObjectInversion, used internally to support special transforms for filters.Shaderhas the new methodrenderImmediate, which makes it straightforward to userenderToTexturewhen the object is not part of a display list, or otherwise needs updating outside the regular render loop.
Improvements
- Drawing contexts, including filters, can now be larger than 4096 if the current device supports them. Thanks to kimdanielarthur-cowlabs for suggesting this.
- Balance rounded rectangle corners for smoothness on small corners while preventing excessive tesselation.
Fixes
PhysicsGroup.addandStaticPhysicsGroup.addwill now check to see if the incoming child already has a body of the wrong type, and if so, will destroy it so the new correct type can be assigned.Blockyfilter now has a minimum size of 1, which prevents the object from disappearing.TilemapGPULayernow takes the first tileset if it receives an array of tilesets (which is valid for Tilemaps but not for TilemapGPULayer). Thanks to ChrisCPI for the fix.- Filters now correctly transform the camera to focus objects with intricate transforms.
- Filters now correctly handle parent transforms when focusing to the game camera.
DynamicTexturemethodstartCapturenow handles nested parent transforms correctly. This is used inMask, so masks withinContainerobjects should behave correctly too.- Children of filtered
Container/Layerobjects are correctly added to the current camera'srenderList. This fixes an issue with input on overlapping interactive objects.
Phaser v4.0.0 Release Candidate 4
This update improves performance related to data buffer size, primarily affecting filters, including masks. A game that was bottlenecked by filters on mobile devices may experience speedups of 16x or more. A desktop system, or a scene with no filters, may be broadly unaffected, save for memory savings.
New Features
BatchHandlerQuadSinglerender node added.- This is just a copy of
BatchHandlerQuadwith space for 1 quad. - The rendering system uses this node internally for transferring images in some steps of the filter process.
- This is just a copy of
Changes
BatchHandlerrender nodes now create their own WebGL data buffers.- This uses around 5MB of RAM and VRAM in a basic game.
- Dedicated buffers are an optimum size for batch performance.
Removals
WebGLRenderer#genericVertexBufferand#genericVertexDataremoved.- This frees 16MB of RAM and VRAM.
BatchHandlerConfig#createOwnVertexBuffertype property removed.TileSpriteno longer supports texture cropping.
Fixes
- Lighting fixed on rotated or filtered objects.
- Added missing 'this' value for Group.forEach and StaticGroup.forEach (thanks @TadejZupancic)
- Fix
createFromTilesto handle multiple tilesets when using sprite sheets. Fix #7122 (thanks @vikerman) - Fix audio files not loading from Base64 data URIs (thanks @bagyoni)
Documentation / TypeScript Enhancements
Thanks to the following people:
Phaser v3.90.0
Version 3.90 - Tsugumi - 23rd May 2025
New Features
GameObjects.Rectangle.setRoundedis a new method that will allow the Rectangle Shape Game Object to have rounded corners. Pass the radius to set for the corners, or pass a value of zero to disable rounded corners.GameObjects.Rectangle.isRoundedis a new read-only boolean that can be used to determine if the Rectangle Shape Game Object has rounded corners, or not.GameObjects.Rectangle.radiusis a new read-only number that is the size of the rounded corners. Do not set directly, instead use the methodsetRounded.- Added
Phaser.Math.Angle.GetClockwiseDistance()to get the shortest nonnegative angular distance between two angles. PR #7092 (thanks @samme) - Added
Phaser.Math.Angle.GetCounterClockwiseDistance()gets the shortest nonpositive angular distance between two angles. PR #7092 (thanks @samme) - Added
Phaser.Math.Angle.GetShortestDistance()gets the shortest signed angular distance between two angles. (This is likePhaser.Math.Angle.ShortestBetween()but in radians.) PR #7092 (thanks @samme) - Added
Phaser.GameObjects.BitmapText#setDisplaySizemethod toBitmapTextto get the original scaled size of 1. PR #6623 (thanks @samme) - Added fallback for Web Audio on Firefox. Firefox doesn't implement
positionX,positionYandpositionZproperties on the AudioListener instances at the moment. This prevents the follow feature from WebAudioSound to operate on Firefox. PR #7083 (thanks @raaaahman)
Updates
- The
EXPANDScale Mode has been updated to now clamp the size of the canvas that is created, preventing it from growing too large on landscape ultra-wide displays. Fix #7027 (thanks @leha-games @rexrainbow) - An Error will now be thrown if you try to create a DOM Game Object but haven't correctly configured the Game Config (thanks @samme)
Bug Fixes
- An erroneous
console.logwas left in the Text Game Object. This has now been removed. - Particle emitter color RGB arrays are cleared before repopulating. Fix #7069 (thanks @Golen87 @samme)
Phaser.Animations.AnimationFramecorrectly uses frame duration when it is set. Fix #7070 (thanks @sylvainpolletvillard)- Particle emitter custom
moveTofunctions can now move particles. Fix #7063 (thanks @samme) - Changed ImageCollections default Tileset values from
nulltoundefined. Fix #7053 (thanks @Snoturky) - Chained tweens now
persistcorrectly even after callingPhaser.Tweens.BaseTween#stop. Fix #7048 (thanks @FranciscoCaetano88) - New left-to-right
TextGame Objects now includes the defaultcanvas.dir = 'ltrandcontext.direction = 'ltr';. Fixes a bug in Chrome 134 & Edge 134 where callingdestroy()on a right-to-leftTextGame Object prevents the next created left-to-rightTextGame Object from rendering. Fix #7077 (thanks @Demeno) GridGame Objects renderslineWidthcorrectly in WebGL mode. Fix #7029 (thanks @AlvaroNeuronup)- Added
collisionMaskandcollisionCategorychecks toPhaser.Physics.Arcade.World#separateto allow individual physics game objects within a physics group to have it's own unique collision categories. Fix #7034 (thanks @frederikocmr) - Fixed Arcade Physics bug causing immovable circle objects to move when pushed by polygons. Fix #7054 (thanks @hunkydoryrepair)
- Fixed
createFromTilesto handle multiple tilesets when using sprite sheets. Fix #7122 (thanks @vikerman) - Fixed audio files not loading from Base64 data URIs (thanks @bagyoni)
Examples, Documentation, Beta Testing and TypeScript
Thanks to the following for helping with the Phaser Examples, Beta Testing, Docs, and TypeScript definitions, either by reporting errors, fixing them, or helping author the docs:
Phaser v4.0.0 Release Candidate 3
This release candidate introduces better pixel art controls, and fixes performance issues related to pixel art options.
Updates since RC2:
New Features
GameObject#vertexRoundModeadded to control vertex pixel rounding on a per-object basis.- Options include:
"off": Never round vertex positions."safe": Round vertex positions if the object is "safe": it is rendering with a transform matrix which only affects the position, not other properties such as scale or rotation."safeAuto"(default): Like "safe", but only if rendering through a camera whereroundPixelsis enabled."full": Always round vertex positions. This can cause sprites to wobble if their vertices are not safely aligned with the pixel resolution, e.g. during rotations. This is good for a touch of PlayStation 1 style jank."fullAuto": Like "full", but only if rendering through a camera whereroundPixelsis enabled.
GameObject#willRoundVertices(camera, onlyTranslated)returns whether vertices should be rounded. In the unlikely event that you need to control vertex rounding even more precisely, you are intended to override this method.
- Options include:
Blockyfilter added. This is similar to Pixelate, but it picks just a single color from the image, preserving the palette of pixel art. You can also configure the pixel width and height, and offset. This is a good option for pixelating a retro game at high resolution, setting up for additional filters such as CRT emulation.
Changes
- WebGL2 canvases are now compatible with the WebGL renderer.
- Optimize multi-texture shader.
- Shader branching pattern changed to hopefully be more optimal on a wider range of devices.
- Shader will not request the maximum number of textures if it doesn't need them, improving performance on many mobile devices.
- Shader no longer performs vertex rounding. This will prevent many situations where a batch was broken up, degrading performance.
Fixes
WebGLSnapshotand snapshot functions based on it now return the correct pixel, instead of the one above it (or nothing if they're at the top of the image).ArcadePhysics#closest()and#furthest()are properly defined (thanks @samme).GamepadPlugin.stopListenersandGamepadPlugin.disconnectAllnow have guards around them so they won't try to invoke functions on potentially undefined gamepads (thanks @CryonautLex)- Arcade Physics OverlapCirc() and OverlapRect() error when useTree is false. Fix #7112 (thanks @samme)
Documentation / TypeScript Enhancements
Thanks to the following people:
Phaser v4.0.0 Release Candidate 2
Updates since RC1:
New Features
RenderConfig#renderNodesallows you to add render nodes at game boot.ShaderQuadConfig#initialUniformslets you initialize a Shader with uniforms on creation.Shader#setUniform(name, value)lets you set shader program uniforms just once, instead of putting them all into thesetupUniforms()method, where some uniforms might be set redundantly after init. This wrapsShader#renderNode.programManager.setUniform.
Changes
TextureManager#addDynamicTexturenow hasforceEvenparameter.
Fixes
- Fix parent transform on filtered objects (e.g. masks inside containers).
- Fix camera shake.
- Add typedefs for the
{ internal, external }structure ofCamera#filters(andGameObject#filters). - Fix
FilterList#addMaskdocs. - In Layer and Container objects, use that object's children for the
displayListpassed toRenderWebGLSteps. - Fix positioning of Group members and offset objects in
DynamicTexture#draw. - Fix Shadow filter direction.
