You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+65Lines changed: 65 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,60 @@
2
2
3
3
## Version 3.18.0 - Raphtalia - in dev
4
4
5
+
### Input System Changes
6
+
7
+
The old 'input queue' legacy system, which was deprecated in 3.16, has been removed entirely in order to tidy-up the API and keep input events consistent. This means the following changes:
8
+
9
+
* Removed the `inputQueue` Game config property.
10
+
* Removed the `useQueue`, `queue` and `_updatedThisFrame` properties from the Input Manager.
11
+
* Removed the `legacyUpdate` and `update` methods from the Input Manager.
12
+
* Removed the `ignoreEvents` property as this should now be handled on a per-event basis.
13
+
* The Input Manager no longer listens for the `GameEvents.POST_STEP` event.
14
+
15
+
As a result, all of the following Input Manager methods have been renamed:
16
+
17
+
*`queueTouchStart` is now called `onTouchStart` and invoked by the Touch Manager.
18
+
*`queueTouchMove` is now called `onTouchMove` and invoked by the Touch Manager.
19
+
*`queueTouchEnd` is now called `onTouchEnd` and invoked by the Touch Manager.
20
+
*`queueTouchCancel` is now called `onTouchCancel` and invoked by the Touch Manager.
21
+
*`queueMouseDown` is now called `onMouseDown` and invoked by the Mouse Manager.
22
+
*`queueMouseMove` is now called `onMouseMove` and invoked by the Mouse Manager.
23
+
*`queueMouseUp` is now called `onMouseUp` and invoked by the Mouse Manager.
24
+
25
+
Each of these handlers used to check the `enabled` state of the Input Manager, but this now handled directly in the Touch and Mouse Managers instead, leading to less branching and cleaner tests.
26
+
27
+
Because the legacy queue mode is gone, there is no longer any need for the DOM Callbacks:
28
+
29
+
* Removed the `_hasUpCallback`, `_hasDownCallback` and `_hasMoveCallback` properties from the Input Manager
30
+
* Removed the `processDomCallbacks`, `addDownCallback`, `addUpCallback`, `addMoveCallback`, `domCallbacks`, `addDownCallback`, `addUpCallback` and `addMoveCallback` methods.
31
+
32
+
Also, CSS cursors can now be set directly:
33
+
34
+
* Cursors are now set and reset immediately on the canvas, leading to the removal of `_setCursor` and `_customCursor` properties.
35
+
36
+
The following changes took place in the Input Plugin class:
37
+
38
+
* The method `processDragEvents` has been removed as it's now split across smaller, more explicit methods.
39
+
*`processDragDownEvent` is a new method that handles a down event for drag enabled Game Objects.
40
+
*`processDragMoveEvent` is a new method that handles a move event for drag enabled Game Objects.
41
+
*`processDragUpEvent` is a new method that handles an up event for drag enabled Game Objects.
42
+
*`processDragStartList` is a new internal method that builds a drag list for a pointer.
43
+
*`processDragThresholdEvent` is a new internal method that tests when a pointer with drag thresholds can drag.
44
+
45
+
The following changes took place in the Pointer class:
46
+
47
+
*`Pointer.dirty` has been removed as it's no longer required.
48
+
*`Pointer.justDown` has been removed as it's not used internally and makes no sense under the DOM event system.
49
+
*`Pointer.justUp` has been removed as it's not used internally and makes no sense under the DOM event system.
50
+
*`Pointer.justMoved` has been removed as it's not used internally and makes no sense under the DOM event system.
51
+
* The `Pointer.reset` method has been removed as it's no longer required internally.
52
+
53
+
#### Input System Bug Fixes
54
+
55
+
* Calling `setPollAlways()` would cause the `'pointerdown'` event to fire multiple times. Fix #4541 (thanks @Neyromantik)
56
+
* The pointer events were intermittently not registered, causing `pointerup` to often fail. Fix #4538 (thanks @paulsymphony)
57
+
* Due to a regression in 3.16 the drag events were not performing as fast as before, causing drags to feel lagged. Fix #4500 (thanks @aliblong)
58
+
5
59
### New Features
6
60
7
61
*`Matter.Factory.velocity` is a new method that allows you to set the velocity on a Matter Body directly.
@@ -14,13 +68,24 @@
14
68
* The default `BaseShader` vertex shader has a new uniform `uResolution` which is set during the Shader init and load to be the size of the Game Object to which the shader is bound.
15
69
* The default `BaseShader` vertex shader will now set the `fragCoord` varying to be the Game Object height minus the y inPosition. This will give the correct y axis in the fragment shader, causing 'inverted' shaders to display normally when using the default vertex code.
16
70
* There was some test code left in the `DOMElementCSSRenderer` file that caused `getBoundingClientRect` to be called every render. This has been removed, which increases performance significantly for DOM heavy games.
71
+
* The `TimeStep` will no longer set its `frame` property to zero in the `resetDelta` method. Instead, this property is incremented every step, no matter what, giving an accurate indication of exactly which frame something happened on internally.
72
+
* The `TimeStep.step` method no longer uses the time value passed to the raf callback, as it's not actually the current point in time, but rather the time that the main thread began at. Which doesn't help if we're comparing it to event timestamps.
73
+
*`TimeStep.now` is a new property that holds the exact `performance.now` value, as set at the start of the current game step.
17
74
18
75
### Bug Fixes
19
76
20
77
* Tweens created in a paused state couldn't be started by a call to `play`. Fix #4525 (thanks @TonioParis)
21
78
* If both Arcade Physics circle body positions and the delta equaled zero, the `separateCircle` function would cause the position to be set `NaN` (thanks @hizzd)
22
79
* The `CameraManager` would incorrectly destroy the `default` Camera in its shutdown method, meaning that if you used a fixed mask camera and stopped then resumed a Scene, the masks would stop working. The default camera is now destroyed only in the `destroy` method. Fix #4520 (thanks @telinc1)
23
80
* Passing a Frame object to `Bob.setFrame` would fail, as it expected a string or integer. It now checks the type of object, and if a Frame it checks to make sure it's a Frame belonging to the parent Blitter's texture, and if so sets it. Fix #4516 (thanks @NokFrt)
81
+
* The ScaleManager full screen call had an arrow function in it. Despite being within a conditional block of code it still broke really old browsers like IE11, so has been removed. Fix #4530 (thanks @jorbascrumps@CNDW)
82
+
*`Game.getTime` would return `NaN` because it incorrectly accessed the time value from the TimeStep.
83
+
84
+
### Examples, Documentation and TypeScript
85
+
86
+
My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs:
* @const {boolean} Phaser.Core.Config#inputWindowEvents - Should Phaser listen for input events on the Window? If you disable this, events like 'POINTER_UP_OUTSIDE' will no longer fire.
* The number of frames that the cooldown is set to after the browser panics over the FPS rate, usually
307
+
* as a result of switching tabs and regaining focus.
308
+
*
309
+
* This can be changed in the Game Config via the `fps.panicMax` property. The default is 120.
302
310
*
303
311
* @name Phaser.Core.TimeStep#panicMax
304
312
* @type {integer}
@@ -309,19 +317,31 @@ var TimeStep = new Class({
309
317
310
318
/**
311
319
* The actual elapsed time in ms between one update and the next.
312
-
* Unlike with `delta` no smoothing, capping, or averaging is applied to this value.
313
-
* So please be careful when using this value in calculations.
320
+
*
321
+
* Unlike with `delta`, no smoothing, capping, or averaging is applied to this value.
322
+
* So please be careful when using this value in math calculations.
314
323
*
315
324
* @name Phaser.Core.TimeStep#rawDelta
316
325
* @type {number}
317
326
* @default 0
318
327
* @since 3.0.0
319
328
*/
320
329
this.rawDelta=0;
330
+
331
+
/**
332
+
* The time, as returned by `performance.now` at the very start of the current step.
333
+
* This can differ from the `time` value in that it isn't calculated based on the delta value.
334
+
*
335
+
* @name Phaser.Core.TimeStep#now
336
+
* @type {number}
337
+
* @default 0
338
+
* @since 3.18.0
339
+
*/
340
+
this.now=0;
321
341
},
322
342
323
343
/**
324
-
* Called when the DOM window.onBlur event triggers.
344
+
* Called by the Game instance when the DOM window.onBlur event triggers.
325
345
*
326
346
* @method Phaser.Core.TimeStep#blur
327
347
* @since 3.0.0
@@ -332,7 +352,7 @@ var TimeStep = new Class({
332
352
},
333
353
334
354
/**
335
-
* Called when the DOM window.onFocus event triggers.
355
+
* Called by the Game instance when the DOM window.onFocus event triggers.
336
356
*
337
357
* @method Phaser.Core.TimeStep#focus
338
358
* @since 3.0.0
@@ -369,7 +389,8 @@ var TimeStep = new Class({
369
389
},
370
390
371
391
/**
372
-
* [description]
392
+
* Resets the time, lastTime, fps averages and delta history.
393
+
* Called automatically when a browser sleeps them resumes.
373
394
*
374
395
* @method Phaser.Core.TimeStep#resetDelta
375
396
* @since 3.0.0
@@ -382,7 +403,6 @@ var TimeStep = new Class({
382
403
this.lastTime=now;
383
404
this.nextFpsUpdate=now+1000;
384
405
this.framesThisSecond=0;
385
-
this.frame=0;
386
406
387
407
// Pre-populate smoothing array
388
408
@@ -437,11 +457,17 @@ var TimeStep = new Class({
437
457
*
438
458
* @method Phaser.Core.TimeStep#step
439
459
* @since 3.0.0
440
-
*
441
-
* @param {number} time - The current time. Either a High Resolution Timer value if it comes from Request Animation Frame, or Date.now if using SetTimeout.
442
460
*/
443
-
step: function(time)
461
+
step: function()
444
462
{
463
+
// Because the timestamp passed in from raf represents the beginning of the main thread frame that we’re currently in,
464
+
// not the actual time now. As we want to compare this time value against Event timeStamps and the like, we need a
465
+
// more accurate one:
466
+
467
+
vartime=window.performance.now();
468
+
469
+
this.now=time;
470
+
445
471
varbefore=time-this.lastTime;
446
472
447
473
if(before<0)
@@ -556,14 +582,14 @@ var TimeStep = new Class({
556
582
},
557
583
558
584
/**
559
-
* Manually calls TimeStep.step, passing in the performance.now value to it.
* @property {integer} [activePointers=1] - The maximum number of touch pointers. See {@link Phaser.Input.InputManager#pointers}.
10
10
* @property {number} [smoothFactor=0] - The smoothing factor to apply during Pointer movement. See {@link Phaser.Input.Pointer#smoothFactor}.
11
-
* @property {boolean} [inputQueue=false] - Should Phaser use a queued input system for native DOM Events or not?
12
11
* @property {boolean} [windowEvents=true] - Should Phaser listen for input events on the Window? If you disable this, events like 'POINTER_UP_OUTSIDE' will no longer fire.
0 commit comments