Releases: phaserjs/phaser-ce
Phaser CE v2.20.21
Version 2.20.1 - 5 October 2024
Updates
- The canvases used for device capability checks and input hit testing are now created with
willReadFrequently: true
.
Bug Fixes
- Fixed an error when a video loaded after the game was destroyed (#742).
Documentation
- Set Phaser.Game#forceSingleUpdate to
false
for better consistency in physics calculations.
Thanks
Phaser CE v2.20.0
Version 2.20.0 - 10 December 2022
API Changes
- Removed
Phaser.GAMES
. - Removed
PIXI.defaultRenderer
. - Removed
PIXI.game
. - Phaser.Game#isRunning has changed slightly: it now changes from
false
totrue
when the core game loop starts running and tofalse
when the game is destroyed.
New Features
- Phaser.Game#onDestroy is a new signal that is fired at the beginning of the game destroy sequence.
- Phaser.CanvasPool.clear() empties the canvas pool.
Updates
- Phaser.Utils.Debug now has all its methods stubbed when disabled.
- There's a console message reminding you to disable the debug canvas in production, if it's enabled. You can disable it by passing
{ enableDebug: false }
in the game config or making a custom build of Phaser CE without thedebug
module. - When the game is destroyed, its signals are disposed, more properties are nullified, and
isBooted
andisRunning
change tofalse
.
Bug Fixes
- Fixed incorrect result in Phaser.Point.multiplyAdd().
- Fixed Phaser.Rope appearing in the Canvas renderer when invisible.
- Fixed an error destroying the game before it's booted (#728).
- Fixed an error creating a RenderTexture after destroying the game (#729).
Thanks
Phaser CE v2.19.2
Phaser CE v2.19.1
Version 2.19.1 - 13 October 2021
Bug Fixes
- TilemapLayer#getRayCastTiles() was less efficient and behaved incorrectly for horizontal or vertical rays.
- Text no longer errors when missing a
style
parameter. - Fixed some WebGL warnings.
Thanks
Phaser CE v2.19.0
API Changes
Text
- Text height is now calculated from actualBoundingBoxAscent and actualBoundingBoxDescent where available or estimated from character widths otherwise. If you need uniform display across devices, it's best to pass
style.fontProperties
when creating a Text object. - The default Text#testString changed to
|MÂÉQfjq_
.
Tilemaps
- Tilemap object properties
ellipse
,gid
,point
,polygon
,polyline
,properties
,rectangle
,template
, andtext
have default values (false
ornull
). - Tilemap object
properties
is an object, as in the Tiled JSON v1.1 format (#623). - Tilemap#createFromObjects() returns an array instead of
undefined
.
New Features
- You can pass
style.fontProperties
when creating a Text game object or in Text#setStyle(). - You can pass
style.testString
when creating a Text game object or in Text#setStyle(). - Tilemap#getObject() gets a tilemap object by
id
, from any object layer. - Tilemap#getObjects() gets the tilemap objects matching the given property name and value.
Updates
- When the Tilemap#createFromObjects()
search
argument is an array, e.g.['type', 'enemy']
, it matches objects with that property name and value. - When the Tilemap#createFromObjects()
search
argument isnull
, it matches all objects in the layer. - When the Tilemap#createFromObjects()
group
argument isnull
, it doesn't add the created sprites to a group.
Bug Fixes
- Tilemap#createFromObjects() was adjusting y-coordinates for all tile objects, which was incorrect. Now it adjusts y-coordinates for tile objects only, which have origin (0, 1) in Tiled.
Phaser CE v2.18.0
Version 2.18.0 - 7 May 2021
Updates
- Re-enabled fix from v2.13.3, Fixed webGL making excessive calls (#641), but only when multitexture batching is disabled.
Bug Fixes
- Videos are loaded using the Loader#crossOrigin value.
Thanks
Phaser CE v2.17.0
Version 2.17.0 - 16 March 2021
API Changes
The core game loop and timekeeping have been redone. Game timing should now work consistently at any device frame rate, for any desiredFps
, with forceSingleUpdate
on or off.
Animations, lifespan, particles, physics, timers, and tweens now all use the same delta time, represented by delta
and deltaTotal
. The delta is scaled by slowMotion
. There's no need to adjust desiredFps
to match slowMotion
now; they work independently. The delta size is clamped by deltaMax
, which can be controlled by desiredMinFps
as well.
Phaser.Game#forceSingleUpdate now switches between a variable-step or fixed-step game loop.
When forceSingleUpdate
is on (the default), the game makes one logic update and one render per animation frame received from the device. This is usually at 60Hz, but can be lower (33Hz) or higher (75Hz, 144Hz, 240Hz).
When forceSingleUpdate
is off, the game makes logic updates only at the rate given by desiredFps
(60Hz or 16.6ms by default). Depending on the desiredFps
value and the device frame rate, this will make zero, one, or several logic updates per animation frame. There is one render per animation frame only if at least one update was made or forceSingleRender
is on; otherwise there is none.
See the Phaser CE game loop plot example to try these out.
Added
- Phaser.Game#onBoot is a signal dispatched after the game boots but before the first update is made. You could use it to configure the game before a game state is started.
- Phaser.Particles.Arcade.Emitter#setGravity() sets the gravity of emitted particles.
- Phaser.Particles.Arcade.Emitter#setSpeed() sets the speed ranges of emitted particles.
- Phaser.Time#delta is the time step for the current logic update, in game time.
- Phaser.Time#deltaMax is the desired maximum delta size in ms. The default is 200ms.
- Phaser.Time#deltaTotal is the cumulative delta, so the current "time" in game time.
- Phaser.Time#desiredMinFps is the desired minimum logic update rate. It sets
deltaMax
. The default is 5. - PIXI.CanvasRenderer#postRender
- PIXI.WebGLRenderer#postRender
Changed
- Phaser.Game#dropFrames skips updates and renders when the animation frame interval is larger than
deltaMax
. It's probably not very useful. - Phaser.Game#forceSingleUpdate switches between a variable-step or fixed-step game loop.
Removed
- Phaser.Game#maxUpdates
- Phaser.Game#net (
game.net
) - Phaser.Net
- Phaser.Time#physicsElapsed
- Phaser.Time#physicsElapsedMS
- Phaser.Time#prevTime
- Phaser.Timer#timeCap
- Phaser.Tween#frameBased
- Phaser.TweenManager#frameBased
- The
elapsedTime
argument in Phaser.State#preRender
Bug Fixes
- Fixed some errors when destroying a game while Web Audio sounds were decoding (#684).
- Fixed tweens running at different speeds depending on device frame rate (#685).
- Fixed incorrect step interval when using
setTimeout()
(#687)
Thanks
Phaser CE v2.16.2
Change Log
Version 2.16.2 - 8 March 2021
Updates
- Better parsing of Tiled object properties (#682)
Bug Fixes
- Web Audio sounds will not progress while the audio context is suspended.
Deprecated
These will be removed in v2.17.0:
- Phaser.Net
- Phaser.Time#physicsElapsed
- Phaser.Time#physicsElapsedMS
- Phaser.Tween#frameBased
- Phaser.TweenManager#frameBased
Thanks
Phaser CE v2.16.1
New Features
- Phaser.Video#createVideoFromURL has a
crossOrigin
argument (#676). - Phaser.Video#startMediaStream accepts MediaTrackConstraints in its
captureAudio
andcaptureVideo
arguments (#677). - Phaser.Loader#image supports loading one of several alternative formats (e.g., AVIF, WebP, SVG) according to browser support.
Updates
- Removed the codec parameter for the Phaser.Device#wav test because it gave a false negative in Safari.
Thanks
Phaser CE v2.16.0
API Changes
- Mouse wheel input is disabled by default. You can enable it by setting
{ mouseWheel: true }
in the game config. - Phaser.StateManager#onStateChange is dispatched before Phaser.Scene#init, rather than after.
New Features
- Phaser.Camera#fadeIn is a new camera effect. It does the opposite of Phaser.Camera#fade.
- Phaser.SoundManager#onStateChange is a new signal, dispatched when the Web Audio context changes state, when using Web Audio.
- Phaser.Utils.Debug#state shows the current game state.
Updates
- The Web Audio context is resumed automatically when resuming or refocusing the game (#667).