Releases: phaserjs/phaser-ce
Phaser CE v2.11.0
Version 2.11.0 - 26 June 2018
If you're starting or stopping input handlers manually, you'll have to make some simple changes to your code.
API Changes / New Features
-
Phaser now starts the Pointer Events handler (with capture off) or the Mouse handler (with capture off), but not both. This makes input behavior more consistent and avoids some rare conflicts between the two when running simultaneously.
If you want to disable the Pointer Events handler, pass
{ mspointer: false }
in your game config. The Mouse handler will be used instead.If you want to run both handlers together, you can start the Mouse handler manually. You should also turn on capture for the Pointer Events handler to avoid duplicate events:
game.input.mouse.start(); game.input.mspointer.capture = true;
-
Mouse wheel input was moved to
input.mouseWheel
. The changed properties areinput.mouse.wheelDelta
→input.mouseWheel.delta
input.mouse.mouseWheelCallback
→input.mouseWheel.callback
The old properties will keep working for now.
-
Pointer lock input was moved to
input.pointerLock
. The changed properties areinput.mouse.pointerLock
→input.pointerLock.onChange
input.mouse.requestPointerLock()
→input.pointerLock.request()
input.mouse.locked
→input.pointerLock.locked
input.mouse.releasePointerLock()
→input.pointerLock.exit()
The old properties will keep working for now.
There is a new Signal,
input.pointerLock.onError
, dispatched when a request fails.Beware that Chrome < 68 doesn't pass movement values when using Pointer Events with pointer lock, so you should use the Mouse handler instead for that.
-
game.debug.inputInfo()
now shows which input handlers and pointers are active. -
All the input handlers have an
active
property that shows whether they've been started. Theirstart
methods return true if they've been started or false otherwise. -
The
skipFrames
argument in AnimationParser#spriteSheet now works as an offset (#514). When positive, it's an offset from the start of the parsed frame list; when negative, it's an offset from the end. NegativeframeWidth
andframeHeight
arguments are no longer allowed. -
preRender() and postRender() hooks are no longer called for the HEADLESS renderer.
-
game.make.group()
no longer assigns a default parent. This is more consistent with the rest of the game.make methods (#525). Usegame.add.group()
instead to add the Group to the game world. -
Point.parse() no longer converts coordinates to integers (#502). Use the new method Point.trunc() as well if you want the previous behavior.
-
The default Debug#font is now '14px monospace'.
-
The unused and deprecated property MSPointer#button was removed.
New Features
- States have a new postUpdate method hook. It's called after game objects have received all their own updates (including physics), but before the Stage has calculated the final transformations.
- Debug#spriteInfo shows the sprite's parent, if any.
- When a sprite is being dragged you can read its change in position (as
deltaX
,deltaY
) in the onDragUpdate handler. - Phaser.Math.trunc() truncates a number.
- Phaser.EmptyRectangle replaces PIXI.EmptyRectangle.
- Debug#device shows device graphics, audio, and input support. It may be helpful on devices where you can't see
console
output easily. - Debug#pointer shows the pointer's movementX/movementY values and button states (for mouse pointers).
maxPointers
can be passed in the game config, setting Input#maxPointers.
Updates
- Removed the unnecessary 'Audio source already exists' warning.
Bug Fixes
- Masks are no longer disabled by getBounds() and are excluded from bounds calculations (#334).
- Sprites' bringToTop() and sendToBack() methods now work as expected for all parent types, not just Groups (#549).
Thanks
@giniwren, @griever989, @mindcity, @omretterry, @photonstorm, @samme, @Siri0n, @tobspr
Phaser CE v2.10.6
- Fixed audio playback when restarting a paused sound (#538).
- TypeScript and documentation fixes (#537, #540, #544, #545).
Thanks
@bseiller, @GrindheadGames, @josalmi, @photonstorm, @qdrj, @samme, @Siri0n, @zhanghuanchong
Phaser CE v2.10.5
Bug Fixes
- Phaser could fail to resume a suspended Web Audio context if the mouse cursor left the browser window before clicking on the game canvas (#437).
Phaser CE v2.10.4
New Features
- Phaser.Text#testString is the character string used to calculate the text's width and height.
- Ellipse#centerX
- Ellipse#centerY
Updates
- Callbacks added with Phaser.Input#addMoveCallback receive an
event
parameter.
Bug Fixes
- Fixed a bogus warning when selecting tilemap layer 0 (#511).
- Fixed wrong position in Ellipse#random (#522).
- Fixed an Animation skipping the final frame in low-FPS situations (#524).
- Fixed wrong ellipse position in Debug#geom (#526).
- Fixed
forceType
failing to override some geometry types in Debug#geom. - Fixed unnecessary text updates when using Text#setText with
immediate=true
(#525). - Fixed issues restarting a Sound in Firefox (#530).
- Fixed an IndexSizeError in Edge/Firefox when a very small texture crop rectangle is used (#532).
TypeScript definitions
- Corrected definitions for ContactMaterial#frictionStiffness, Convex (#513).
Documentation
- Fixed typos (#517, #521).
- The Tilemap methods fill, random, replace, shuffle, and swap modify the tile index only (#484).
- The special GameConfig.transparent value 'notMultiplied' disables the WebGL context attribute
premultipliedAlpha
.
Thanks
@budda, @Hagisus, @HaoboZ, @hardylr, @intersrc, @jamesjsewell, @josalmi, @joshlory, @melissaelopez, @mickeyren, @photonstorm, @samme, @tobspr
Phaser CE v2.10.3
Phaser CE v2.10.2
New Features
- You can set clearBeforeRender when creating the game (#481).
Updates
- Phaser tries to resume a suspended WebAudio context after a user click/tap on any device (#437, #482).
Bug Fixes
- Phaser.Text objects show the correct type (#479).
- game.add.plugin forwards all arguments to game.plugins.add (#486).
- Phaser.Signal#memorized works correctly after only one listener is added (#495).
TypeScript
- PIXI.Rectangle includes more of Phaser.Rectangle's properties (#491).
Documentation
Thanks
@KIVassilev, @koalaylj, @photonstorm, @RedPanduzer, @samme, @Siri0n
Phaser CE v2.10.1
Version 2.10.1 - 18th February 2018
New Features
- Phaser.Sound#playOnce flags a sound for deletion after it is played once. This is a simple method for avoiding adding new Sound objects for sounds that are intended to just be played once and done.
- A final State#loadUpdate call is made right before the loader is reset, when Loader#progress is 100, instead of after, when Loader#progress is 0 (#468).
- Loader#onBeforeLoadComplete is a signal dispatched right before the Loader is reset (unlike Loader#onLoadComplete).
Updates
- Clarified
margin
andspacing
arguments in Phaser.Loader#spritesheet (#448). - Debug#text now uses Debug#font as its default.
Bug Fixes
- Fixed audio sprites failing to loop after pause and resume (#323).
- Fixed sounds not looping when using audio tags (#446).
- Fixed circular Arcade bodies sticking to each other during some collisions (#451).
- Fixed a sprite with input.enabled
false
triggering its onInputOut signal when the mouse leaves the game canvas (#454). - Fixed spelling error in API documentation (#458).
- Fixed some TypeScript definitions (#442, #447, #455, #460, #462, #463, #469, #475).
- The canvas now correctly scales inside a container if using relative values for
width
andheight
in the Phaser.Game constructor (#367). Make sure you give the container a height. - Fixed State#loadUpdate being called once when no assets have been loaded (#468).
- Fixed Debug#spriteInfo failing to show
sprite.name
as promised (#471).
Thanks
@bseiller, @dhashvir, @Lucas-C, @mmacvicar, @Nek-, @netdreamer, @omretterry, @pantoninho, @photonstorm, @samme, @seiyria, @squaresun, @Tembac, @wtravO
Phaser CE v2.10.0
Version 2.10.0 - 18th January 2018
New Features
- New game config arguments:
alignH
,alignV
crisp
disableStart
failIfMajorPerformanceCaveat
roundPixels
scaleH
,scaleV
,trimH
,trimV
- New game loop features:
- Phaser.Game#dropFrames skips renders when the game loop delta time is spiraling upwards (#314).
- Phaser.Game#forceSingleRender can be set to
false
to reduce the render rate to match Phaser.Time#desiredFps (#313). - Phaser.Time#ups tracks updates per second when advanced timing is enabled.
- Phaser.Time#rps tracks renders per second when advanced timing is enabled.
- Phaser.Color constants AQUA, BLACK, BLUE, GRAY, GREEN, ORANGE, RED, VIOLET, WHITE, and YELLOW. You can use these anywhere you use a numeric (hex) color value: Graphics, Sprite#tint, Stage#backgroundColor.
- Phaser.Game#pendingDestroy marks the game for destruction at the next update. It can be used safely within an update callback.
- Phaser.Point#round rounds a point's coordinates.
- Phaser.SoundManager#onTouchUnlock signal (#434)
- Phaser.SoundManager#removeAll destroys all sounds and removes them from the Manager.
- Phaser.Utils.Debug methods:
- Debug#loader displays loader progress.
- Debug#scale displays game/canvas dimensions and Scale Manager state.
- Debug#sound displays Sound Manager state.
- Phaser.Video#playWhenUnlocked
- Phaser.Video#onTouchUnlock signal
Updates
- Phaser now falls back to the Canvas renderer if AUTO is selected and WebGL context creation fails. Phaser.Device#webGL is now a soft check and doesn't create a test WebGL context. This is slightly more accurate (#402) and slightly faster (#420). Phaser.Device#webGLError was removed.
- Gamepad input is now enabled while the game is paused (#423).
- Removed gain smoothing for WebAudio volume changes (#385).
- Updated ionic example project (#381).
- Removed these deprecated items (#403):
- Phaser.ArrayUtils.rotate → Phaser.ArrayUtils.rotateLeft
- Phaser.Device.isConsoleOpen
- Phaser.Loader#useXDomainRequest → xhrLoadWithXDR.js
- Phaser.Loader#xhrLoadWithXDR → xhrLoadWithXDR.js
- Phaser.Particles#update
- Phaser.Polygon#points (as a setter) → Phaser.Polygon#setTo
- Phaser.Touch#addTouchLockCallback → Phaser.Input#addTouchLockCallback
- Phaser.Touch#removeTouchLockCallback → Phaser.Input#removeTouchLockCallback
- PIXI.BaseTexture#updateSourceImage → Phaser.Component.LoadTexture#loadTexture
- RevoluteConstraint#motorIsEnabled → RevoluteConstraint#motorEnabled
- Shape.RECTANGLE → Shape.BOX
Bug Fixes
- Fixed a false positive in TweenManager#isTweening (#414).
- Changing a display object's smoothed property now marks the WebGL texture as dirty (#432, #433).
- Fixed Phaser.Sound temporarily having an incorrect gain setting at creation time.
- Fixed sprites not receiving onInputOut when the pointer leaves the game canvas (#429).
- Fixed some TypeScript definitions.
Thanks
@ankush-badyal, @Dreaded-Gnu, @Mertank, @pavle-goloskokovic, @photonstorm, @qdrj, @samme, @squaresun
Phaser CE v2.9.4
Version 2.9.4 - 20th December 2017
New Features
- TweenManager#isTweening has a
checkIsRunning
argument (#414). - You can now pass
game.stage
as theparent
parameter in thegame.add
methods. - Arcade#closest, Arcade#distanceBetween, and Arcade#farthest have a
useCenter
argument (#418).
Updates
- Phaser.Device tests for WebGL stencil buffer support (#402).
Bug Fixes
Thanks
@bananatron, @mblais, @mepsoid, @naglfar, @photonstorm, @samme
Phaser CE v2.9.3
Version 2.9.3 - 11th December 2017
New Features
- Phaser.BitmapData#polygon draws a polygon.
- Phaser.Keyboard#removeCallbacks removes callbacks added by Phaser.Keyboard#addCallbacks.
- Phaser.Line#fromPoints
- Phaser.Loader#imageFromGrid and Phaser.Loader#imageFromTexture are image-loading counterparts of Phaser.Create#grid and Phaser.Create#texture.
- Phaser.Point.sortClockwise sorts points around a reference point.
- Phaser.Point#angleXY
- Phaser.Point#atan computes a point's arctangent.
- Phaser.Point#expand increases a point's magnitude to a minimum length.
- Phaser.World#wrapAll wraps all members of a group.
Updates
- Audio and video are now touch-unlocked only via the touchend event (#92). Previously we used
touchend
for audio on newer Chrome and iOS clients andtouchstart
in all other cases. - Tilemap#addTilesetImage, Tilemap#createFromObjects, and Tilemap#createLayer print the map's contents (following the usual warning) in the console if you pass a bad name or identifier, to help you correct it.
- Tileset#addTilesetImage gives a little more information when warning about image dimension mismatches.
- Optimized Phaser.Utils.getProperty.
- Removed Phaser.TweenData#yoyoCounter, an extraneous property that Phaser never used.
- p2 TypeScript definitions fixes and updates (#406).
Bug Fixes
- Phaser.Tween#start no longer tries to start a tween marked for deletion (such as by Tween#stop). Instead it prints a warning to the console (#401).
- Fixed drag movement of fixedToCamera sprites when the camera is scaled (#405).
- Fixed tweens not repeating when Tween#start is called after Tween#repeat (#408).
- StateManager#loadComplete is no longer called by the Loader if the state has been destroyed (#410).
- Added TypeScript definitions for Phaser.Sprite#outOfCameraBoundsKill.
Documentation
canvas
,canvasId
,canvasStyle
, and forceSetTimeOut can be set in the game configuration object.
Thanks
@clesquir, @GrindheadGames, @husengbatute29, @Nek-, @photonstorm, @samme
For changes in previous releases please see the extensive Change Log.