Back to Phaser

V4 New Features — Reference

skills/v4-new-features/references/REFERENCE.md

4.1.02.8 KB
Original Source

V4 New Features — Reference

Detailed configuration, API tables, and source file maps for the v4-new-features skill.

New Tint Modes

v3 had two tint modes set implicitly via setTint() (multiply) and setTintFill() (fill). v4 separates tint color from tint mode and adds new modes.

js
// v3 approach:
sprite.setTint(0xff0000);      // multiply mode implicit
sprite.setTintFill(0xff0000);  // fill mode implicit

// v4 approach:
sprite.setTint(0xff0000);                            // sets color only
sprite.setTintMode(Phaser.TintModes.FILL);           // sets mode separately
// NOTE: setTintFill() is a deprecated no-op in v4 -- it only logs a console error

Available modes (Phaser.TintModes):

ModeValueEffect
MULTIPLY0Default. Tint multiplied with texture color
FILL1Tint replaces texture color (respects alpha). Flash-white effect
ADD2Tint added to texture color (respects alpha)
SCREEN4Brightens dark areas of the texture
OVERLAY5Brightens lights, darkens darks
HARD_LIGHT6Like overlay with tint/texture swapped

Source: src/renderer/TintModes.js


Migrating from v3

For detailed migration instructions, code conversion examples, removed APIs, and a full checklist, see the dedicated v3 to v4 Migration Guide.


Source File Map

FeaturePath
CaptureFramesrc/gameobjects/captureframe/CaptureFrame.js
Gradientsrc/gameobjects/gradient/Gradient.js
Noise (white)src/gameobjects/noise/Noise.js
NoiseCell2D/3D/4Dsrc/gameobjects/noise/noisecell{2,3,4}d/
NoiseSimplex2D/3Dsrc/gameobjects/noise/noisesimplex{2,3}d/
SpriteGPULayersrc/gameobjects/spritegpulayer/SpriteGPULayer.js
TilemapGPULayersrc/tilemaps/TilemapGPULayer.js
Lighting componentsrc/gameobjects/components/Lighting.js
RenderSteps componentsrc/gameobjects/components/RenderSteps.js
RenderNodes componentsrc/gameobjects/components/RenderNodes.js
Tint componentsrc/gameobjects/components/Tint.js
TintModessrc/renderer/TintModes.js
RenderNode base classsrc/renderer/webgl/renderNodes/RenderNode.js
RenderNodeManagersrc/renderer/webgl/renderNodes/RenderNodeManager.js
Filter render nodessrc/renderer/webgl/renderNodes/filters/
Submitter nodessrc/renderer/webgl/renderNodes/submitter/
Transformer nodessrc/renderer/webgl/renderNodes/transformer/
Texturer nodessrc/renderer/webgl/renderNodes/texturer/
Batch handlerssrc/renderer/webgl/renderNodes/BatchHandler*.js
Rendering concepts docdocs/Phaser 4 Rendering Concepts/

Related skills: ../filters-and-postfx/SKILL.md, ../game-object-components/SKILL.md, ../tilemaps/SKILL.md, ../v3-to-v4-migration/SKILL.md