phaserjs/phaser/v4-new-features
Claude Code and agent skill by phaserjs/phaser
- community
Checking that the SKILL.md file is still in the repository.
A map of what Phaser 4.0 to 4.3 added, a few lines each, with the skill which covers it: Filters, render nodes, lighting and cone lights, tint modes and setTint2, CaptureFrame, Gradient, the Noise objects, Sky and its stars, World3D, SpriteGPULayer, TilemapGPULayer, Stamp, Mesh2D, Stencil, CustomContext, setFPSLimit, SDF Graphics and Shapes, line joins, clean alpha, the Loader AbortSignal and the Phaser.AUTO fallback to Canvas. Use when asked what's new in Phaser 4 or a 4.x release, or when choosing a v4-only object for huge numbers of sprites, large tilemaps, procedural noise, gradients, banded skies, starfields or meshes. Triggers on: what's new, 4.1, 4.2, 4.3, Salusa, Giedi, Arrakis, changelog, SpriteGPULayer, TilemapGPULayer, Mesh2D, Stencil, noise, gradient, sky, starfield, raster bands.
Install
npx vskill@latest install phaserjs/phaser/v4-new-featuresSKILL.md
The same SKILL.md was published earlier as phaserjs/phaser/v4-new-features.
What's new in Phaser 4.0 to 4.3
A map of the features added since Phaser 3, by release. Each entry names the API and links to the skill with the detail. For code which must change when porting from v3, use v3-to-v4-migration.
Source: changelog/v4/4.0/CHANGELOG-v4.0.0.md, changelog/v4/4.1/, changelog/v4/4.2/, changelog/v4/4.2.1/, changelog/v4/4.3/CHANGELOG-v4.3.0.md, docs/Phaser 4 Rendering Concepts/. Related: phaser4-core, v3-to-v4-migration.
Most new rendering features are WebGL only. obj.filters is null until enableFilters(), which does nothing in Canvas, and Phaser.AUTO can fall back to Canvas (4.3). Guard them as phaser4-core shows.
Quick start: the v4-only objects with no other skill
- The noise objects are
noise,noisecell2d,noisecell3d,noisecell4d,noisesimplex2dandnoisesimplex3d.noiseSeedis an array of integers. AnimatenoiseOffset(an[x, y]array) to scroll, andnoiseFlow(simplex) or the extra axes (noisecell3d,noisecell4d) to evolve the pattern.noiseNormalMap: trueoutputs a normal map for lighting. - The Gradient colors are a
Phaser.Display.ColorRampofColorBands. Callgradient.ramp.encode()after changing them. - Sky: the config, x, y, width, height. The default size is the game, with an origin of 0 and a scroll factor of 0. Presets:
day,dawn,sunset,dusk,night,rainbow(Phaser.GameObjects.Sky.Presets).setColorscan be called every frame.bandHeightis in pixels, and 0 is a smooth gradient. - Sky colors and the Camera:
setGradientHeight(worldHeight, 1)makes the colors cover the world, so the Sky shows the part the Camera'sscrollYis at. Only vertical scroll changes the colors.scrollY,scrollSpeedandrepeatscroll them by hand.scrollBandsmoves the bands, not just the colors. - Sky stars (
SkyStars):count,layers,color/farColor,size/farSize,speedX/speedYin pixels per second (positive is right and down),cameraFactor(default 0.5),key/framefor a texture.is3D: trueflies them out oforiginX,originYatspeedZ. Seesrc/gameobjects/sky/. - Gradient, Sky and the Noise objects extend
Shader. See custom-rendering. - SpriteGPULayer: fill it once. Adding, editing or removing members rewrites the GPU buffer, which is expensive. Members can animate on the GPU (
x,y,rotation,scaleX,scaleY,alphaandtintBlendtake an animation config). It hassetLighting. Seesrc/gameobjects/spritegpulayer/.
4.0: the new renderer
| Feature | API | Skill | |
|---|---|---|---|
| Render nodes replace pipelines | setRenderNodeRole, render.renderNodes config, addRenderStep | custom-rendering | |
| Filters replace preFX, postFX and FX | enableFilters(), filters.internal, filters.external | filters-and-postfx | |
| The Mask filter replaces BitmapMask | filters.internal.addMask(), Phaser.Actions.AddMaskShape | masks-and-stencils | |
| Effect Actions | Phaser.Actions.AddEffectBloom, AddEffectShine, FitToRegion | filters-and-postfx, actions-and-utilities | |
| Lighting component | setLighting(true), setSelfShadow(), lights have z | lighting | |
| Tint modes | setTintMode(Phaser.TintModes.FILL) and others | game-object-components | |
| Vertex rounding | vertexRoundMode, roundPixels defaults to false, smoothPixelArt | phaser4-core, scale-and-responsive | |
| CaptureFrame | this.add.captureFrame(key): copies what's drawn so far to a texture | filters-and-postfx | |
| Gradient, Noise | this.add.gradient, this.add.noise and the other five | Quick start above | |
| SpriteGPULayer | this.add.spriteGPULayer(texture, size) | Quick start above | |
| TilemapGPULayer | map.createLayer(id, tileset, x, y, true): one quad, one tileset, orthogonal maps | tilemaps | |
| Stamp | this.add.stamp(x, y, texture, frame): a quad which ignores the Camera, for Dynamic Textures | render-textures | |
| Dynamic Texture changes | render() runs the queued draws; preserve, callback, capture; Render Texture renderMode | render-textures | |
| TileSprite | Uses atlas frames; tileRotation | sprites-and-images | |
| NineSlice | tileX, tileY arguments tile the edges | sprites-and-images | |
| Compact texture atlas | this.load.atlasPCT(key, url): a small text atlas format | loading-assets | |
| Hash noise in JS | Phaser.Math.Hash, HashCell, HashSimplex | geometry-and-math | |
| Color ramps | Phaser.Display.ColorBand, ColorRamp; Color helpers can write to an existing Color | geometry-and-math | |
| Destroyed flag | gameObject.isDestroyed | game-object-components |
4.1 (Salusa)
import Phaser from 'phaser'works: the ESM build has a default export.Layeris a true Game Object, so its filters work. See groups-and-containers.render.mipmapRegenerationlets Dynamic Textures rebuild their mipmaps. Filters never use mipmaps.- Filter Controllers have
getPaddingCeil(). Custom render nodes should call it rather thangetPadding().
4.2 (Giedi)
| Feature | API | Skill | |
|---|---|---|---|
| Stencil | this.add.stencil(x, y, children, options): a Container which writes to the stencil buffer, a fast lasting mask | masks-and-stencils | |
| StencilReference | this.add.stencilreference(stencil, options): draws a Stencil again with other settings | masks-and-stencils | |
| CustomContext | this.add.customcontext(x, y, children, callback): a Container which changes the DrawingContext, such as the scissor or stencil test | masks-and-stencils | |
| Alpha strategies | render.alphaStrategy ('keep'), render.stencil (true), render.stencilAlphaStrategy ('dither'); strategies keep, dither, threshold | masks-and-stencils | |
| Mesh2D | this.add.mesh2d(x, y, texture, vertices, indices): textured triangles which batch with sprites. Vertices are x, y, u, v; indices are a, b, c, page. Supports lighting | src/gameobjects/mesh2d/Mesh2D.js | |
| Cone lights | this.lights.addConeLight(...), light.setCone(), setConeRotation, setConeAngles, disableCone | lighting | |
| Second tint | TintModes.MULTIPLY_TWO, setTint2(), tint2TopLeft and the other corners | game-object-components | |
| FPS limit at runtime | this.game.loop.setFPSLimit(30); 0 removes the limit | game-setup-and-config |
- The filters render step now runs just before the object's own render step, so other render steps can run first.
inTintEffectin the tint shader changed from afloatto avec4. Only custom shaders which read it are affected.- The new
BatchHandlerTrirender node draws triangles;TransformerVertexhassetupMatrixandtransformVertex. - 4.2.1 fixed
stencilInvert, and stencil clearing in framebuffers.
4.3 (Arrakis)
Graphics and Shapes, all in graphics-and-shapes:
- SDF shapes. WebGL draws circles, ellipses, arcs, rounded rectangles, strokes and lines with signed distance fields. They're round and smooth at any zoom, and look different from 4.2.
render.sdfShapes: falsegoes back to triangles. - Joins. Stroked paths now have pointed joins, as in Canvas.
lineJoin('miter','bevel','round') andmiterLimit(default 10) on Graphics,setLineJoinandsetMiterLimiton Shapes. - Gradients.
fillLinearGradient,fillRadialGradient,lineLinearGradientandlineRadialGradienton Graphics, andsetFillLinearGradient,setFillRadialGradient,setStrokeLinearGradientandsetStrokeRadialGradienton Shapes. Any number of stops. Both renderers draw them. - Hard edges.
setHardEdges(true)turns off the smoothed edge, for a crisp mask. - Clean alpha.
setCleanAlpha()on Graphics and Shapes fades the whole object evenly, so overlapping parts don't show through each other. WebGL only, and it costs a framebuffer while alpha is below 1.
Other features:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/v4-new-features/SKILL.md
Popularity
- Repository stars
- 39,633
- Repository forks
- 7,130
- 7-day trend score
- 53
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 May 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Grok Build (Cursor)
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/phaserjs/phaser/v4-new-features)