This version is out of date

The version of Phaser CE on this page is not the most current release.

Version: 2.11.0
Released: 26th June 2018
Next Version: 2.12.0
Previous Version: 2.10.6

Download

Download this version of Phaser CE from npm. Need more details? Follow this tutorial

npm install phaser-ce@2.11.0

Change Log

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 are

    • input.mouse.wheelDeltainput.mouseWheel.delta
    • input.mouse.mouseWheelCallbackinput.mouseWheel.callback

    The old properties will keep working for now.

  • Pointer lock input was moved to input.pointerLock. The changed properties are

    • input.mouse.pointerLockinput.pointerLock.onChange
    • input.mouse.requestPointerLock()input.pointerLock.request()
    • input.mouse.lockedinput.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. Their start 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. Negative frameWidth and frameHeight 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). Use game.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