|
4 | 4 |
|
5 | 5 | See [README: Change Log: Unreleased](README.md#unreleased).
|
6 | 6 |
|
| 7 | +## Version 2.11.0 - 26 June 2018 |
| 8 | + |
| 9 | +If you're starting or stopping input handlers manually, you'll have to make some simple changes to your code. |
| 10 | + |
| 11 | +### API Changes / New Features |
| 12 | + |
| 13 | +* Phaser now starts the [Pointer Events handler](https://photonstorm.github.io/phaser-ce/Phaser.MSPointer.html) (with capture off) or the [Mouse handler](https://photonstorm.github.io/phaser-ce/Phaser.Mouse.html) (with capture off), but not both. This makes input behavior more consistent and avoids some rare conflicts between the two when running simultaneously. |
| 14 | + |
| 15 | + If you want to disable the Pointer Events handler, pass `{ mspointer: false }` in your game config. The Mouse handler will be used instead. |
| 16 | + |
| 17 | + 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: |
| 18 | + |
| 19 | + ```javascript |
| 20 | + game.input.mouse.start(); |
| 21 | + game.input.mspointer.capture = true; |
| 22 | + ``` |
| 23 | + |
| 24 | +* [Mouse wheel input](https://photonstorm.github.io/phaser-ce/Phaser.MouseWheel.html) was moved to `input.mouseWheel`. The changed properties are |
| 25 | + |
| 26 | + - `input.mouse.wheelDelta` → `input.mouseWheel.delta` |
| 27 | + - `input.mouse.mouseWheelCallback` → `input.mouseWheel.callback` |
| 28 | + |
| 29 | + The old properties will keep working for now. |
| 30 | + |
| 31 | +* [Pointer lock input](https://photonstorm.github.io/phaser-ce/Phaser.PointerLock.html) was moved to `input.pointerLock`. The changed properties are |
| 32 | + |
| 33 | + - `input.mouse.pointerLock` → `input.pointerLock.onChange` |
| 34 | + - `input.mouse.requestPointerLock()` → `input.pointerLock.request()` |
| 35 | + - `input.mouse.locked` → `input.pointerLock.locked` |
| 36 | + - `input.mouse.releasePointerLock()` → `input.pointerLock.exit()` |
| 37 | + |
| 38 | + The old properties will keep working for now. |
| 39 | + |
| 40 | + There is a new Signal, `input.pointerLock.onError`, dispatched when a request fails. |
| 41 | + |
| 42 | + Beware that [Chrome < 68 doesn't pass movement values when using Pointer Events with pointer lock](https://bugs.chromium.org/p/chromium/issues/detail?id=836995), so you should use the Mouse handler instead for that. |
| 43 | + |
| 44 | +* `game.debug.inputInfo()` now shows which input handlers and pointers are active. |
| 45 | + |
| 46 | +* 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. |
| 47 | + |
| 48 | +* The `skipFrames` argument in [AnimationParser#spriteSheet](https://photonstorm.github.io/phaser-ce/Phaser.AnimationParser.html#_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. |
| 49 | + |
| 50 | +* preRender() and postRender() hooks are no longer called for the HEADLESS renderer. |
| 51 | + |
| 52 | +* `game.make.group()` no longer assigns a default parent. This is more consistent with the rest of the [game.make](https://photonstorm.github.io/phaser-ce/Phaser.GameObjectCreator.html) methods (#525). Use `game.add.group()` instead to add the Group to the game world. |
| 53 | + |
| 54 | +* [Point.parse()](https://photonstorm.github.io/phaser-ce/Phaser.Point.html#_parse) no longer converts coordinates to integers (#502). Use the new method [Point.trunc()](https://photonstorm.github.io/phaser-ce/Phaser.Point.html#_trunc) as well if you want the previous behavior. |
| 55 | + |
| 56 | +* The default [Debug#font](https://photonstorm.github.io/phaser-ce/Phaser.Utils.Debug.html#font) is now '14px monospace'. |
| 57 | + |
| 58 | +* The unused and deprecated property MSPointer#button was removed. |
| 59 | + |
| 60 | +### New Features |
| 61 | + |
| 62 | +* States have a new [postUpdate](https://photonstorm.github.io/phaser-ce/Phaser.State.html#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. |
| 63 | +* [Debug#spriteInfo](https://photonstorm.github.io/phaser-ce/Phaser.Utils.Debug.html#spriteInfo) shows the sprite's parent, if any. |
| 64 | +* When a sprite is being dragged you can read its change in position (as `deltaX`, `deltaY`) in the [onDragUpdate](https://photonstorm.github.io/phaser-ce/Phaser.Events.html#onDragUpdate) handler. |
| 65 | +* [Phaser.Math.trunc()](https://photonstorm.github.io/phaser-ce/Phaser.Math.html#trunc) truncates a number. |
| 66 | +* Phaser.EmptyRectangle replaces PIXI.EmptyRectangle. |
| 67 | +* [Debug#device](https://photonstorm.github.io/phaser-ce/Phaser.Utils.Debug.html#device) shows device graphics, audio, and input support. It may be helpful on devices where you can't see `console` output easily. |
| 68 | +* [Debug#pointer](https://photonstorm.github.io/phaser-ce/Phaser.Utils.Debug.html#pointer) shows the pointer's movementX/movementY values and button states (for mouse pointers). |
| 69 | +* `maxPointers` can be passed in the [game config](https://photonstorm.github.io/phaser-ce/global.html#GameConfig), setting [Input#maxPointers](https://photonstorm.github.io/phaser-ce/Phaser.Input.html#maxPointers). |
| 70 | + |
| 71 | +### Updates |
| 72 | + |
| 73 | +* Removed the unnecessary 'Audio source already exists' warning. |
| 74 | + |
| 75 | +### Bug Fixes |
| 76 | + |
| 77 | +* Masks are no longer disabled by getBounds() and are excluded from bounds calculations (#334). |
| 78 | +* Sprites' [bringToTop()](https://photonstorm.github.io/phaser-ce/Phaser.Sprite.html#bringToTop) and [sendToBack()](https://photonstorm.github.io/phaser-ce/Phaser.Sprite.html#sendToBack) methods now work as expected for all parent types, not just Groups (#549). |
| 79 | + |
| 80 | +### Thanks |
| 81 | + |
| 82 | +@giniwren, @griever989, @mindcity, @omretterry, @photonstorm, @samme, @Siri0n, @tobspr |
| 83 | + |
7 | 84 | ## Version 2.10.6 - 1st June 2018
|
8 | 85 |
|
9 | 86 | * Fixed audio playback when restarting a paused sound (#538).
|
|
0 commit comments