Skip to content

Commit bea7ca3

Browse files
committed
Merge branch 'master' into containers
# Conflicts: # src/renderer/webgl/pipelines/TextureTintPipeline.js
2 parents 749a69c + 51d29b8 commit bea7ca3

34 files changed

Lines changed: 742 additions & 280 deletions

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ being passed to the simulation. The default value is 1 to remain consistent with
1919
* HTML5AudioSound.setVolume is a chainable way to set the volume of a single Sound instance.
2020
* HTML5AudioSound.setSeek is a chainable way to set seek to a point of a single Sound instance.
2121
* HTML5AudioSound.setLoop is a chainable way to set the loop state of a single Sound instance.
22+
* BitmapText has a new property `letterSpacing` which accepts a positive or negative number to add / reduce spacing between characters (thanks @wtravO)
23+
* Matter Physics has two new debug properties: `debugShowJoint` and `debugJointColor`. If defined they will display joints in Matter bodies during the postUpdate debug phase (only if debug is enabled) (thanks @OmarShehata)
24+
* You can now pass a Sprite Sheet or Canvas as the Texture key to `Tilemap.addTileset` and it will work in WebGL, where-as before it would display a corrupted tilemap. Fix #3407 (thanks @Zykino)
25+
* Graphics.slice allows you to easily draw a Pacman, or slice of pie shape to a Graphics object.
2226

2327
### Bug Fixes
2428

@@ -27,6 +31,13 @@ being passed to the simulation. The default value is 1 to remain consistent with
2731
* PathFollower.start has been renamed to `startFollow`, but PathFollower.setPath was still using `PathFollower.start` (thanks @samid737)
2832
* BaseSoundManager.rate and BaseSoundManager.detune would incorrectly called `setRate` on its sounds, instead of `calculateRate`.
2933
* The Gamepad Axis `getValue` method now correctly applies the threshold and zeroes out the returned value.
34+
* The HueToComponent module was not correctly exporting itself. Fix #3482 (thanks @jdotrjs)
35+
* Matter.World was using `setZ` instead of `setDepth` for the Debug Graphics Layer, causing it to appear behind objects in some display lists.
36+
* Game.destroy now checks to see if the `renderer` exists before calling destroy on it. Fix #3498 (thanks @Huararanga)
37+
* Keyboard.JustDown and Keyboard.JustUp were being reset too early, causing them to fail when called in `update` loops. Fix #3490 (thanks @belen-albeza)
38+
* RenderTexture.destroy no longer throws an error when called. Fix #3475 (thanks @kuoruan)
39+
* The WebGL TileSprite batch now modulates the tilePosition to avoid large values being passed into the UV data, fixing corruption when scrolling TileSprites over a long period of time. Fix #3402 (thanks @vinerz @FrancescoNegri)
40+
* LineCurve.getResolution was missing the `divisions` argument and always returning 1, which made it fail when used as part of a Path. It now defaults to return 1 unless specified otherwise (thanks _ok)
3041

3142
### Updates
3243

@@ -38,8 +49,10 @@ being passed to the simulation. The default value is 1 to remain consistent with
3849
* The ComputedSize Component now has `setSize` and `setDisplaySize` methods. This component is used for Game Objects that have a non-texture based size.
3950
* The GamepadManager now extends EventEmitter directly, just like the KeyboardManager does.
4051
* The Gamepad Axis threshold has been increased from 0.05 to 0.1.
52+
* Animation.updateFrame will now call `setSizeToFrame` on the Game Object, which will adjust the Game Objects `width` and `height` properties to match the frame size. Fix #3473 (thanks @wtravO @jp-gc)
53+
* Animation.updateFrame now supports animation frames with custom pivot points and injects these into the Game Object origin.
4154

42-
Also, my thanks to the following for helping with the Phaser 3 Examples, either by reporting errors or fixing them: @gabegordon @melissaelopez @samid737 @nbs @tgrajewski @pagesrichie @hexus
55+
Also, my thanks to the following for helping with the Phaser 3 Examples and Docs, either by reporting errors, fixing them or helping author the docs: @gabegordon @melissaelopez @samid737 @nbs @tgrajewski @pagesrichie @hexus @mbrickn @erd0s @icbat @Matthew-Herman
4356

4457

4558

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Extra special thanks to our top-tier sponsors: [Orange Games](http://orangegames
7070

7171
Every week we publish the [Phaser World](https://phaser.io/community/newsletter) newsletter. It's packed full of the latest Phaser games, tutorials, videos, meet-ups, talks, and more. The newsletter also contains our weekly Development Progress updates which let you know about the new features we're working on.
7272

73-
Over 100 previous editions can be found on our [Back Issues](http://phaser.io/community/backissues) page.
73+
Over 100 previous editions can be found on our [Back Issues](https://phaser.io/community/backissues) page.
7474

7575
![Download Phaser](https://phaser.io/images/github/div-download.png "Download Phaser")
7676
<a name="download"></a>
@@ -93,7 +93,7 @@ npm install phaser
9393

9494
[![](https://data.jsdelivr.com/v1/package/gh/photonstorm/phaser/badge)](https://www.jsdelivr.com/package/gh/photonstorm/phaser)
9595

96-
[Phaser is on jsDelivr](http://www.jsdelivr.com/projects/phaser) which is a "super-fast CDN for developers". Include the following in your html:
96+
[Phaser is on jsDelivr](https://www.jsdelivr.com/projects/phaser) which is a "super-fast CDN for developers". Include the following in your html:
9797

9898
```html
9999
<script src="//cdn.jsdelivr.net/npm/phaser@3.3.0/dist/phaser.js"></script>
@@ -137,7 +137,7 @@ Also, please subscribe to the [Phaser World](https://phaser.io/community/newslet
137137

138138
### Source Code Examples
139139

140-
During our development of Phaser 3, we created hundreds of examples with the full source code and assets. Until these examples are fully integrated into the Phaser website, you can browse them on [Phaser 3 Labs](http://labs.phaser.io), or clone the [examples repo][examples]. Note: Not all examples work, sorry! We're tidying them up as fast as we can.
140+
During our development of Phaser 3, we created hundreds of examples with the full source code and assets. Until these examples are fully integrated into the Phaser website, you can browse them on [Phaser 3 Labs](https://labs.phaser.io), or clone the [examples repo][examples]. Note: Not all examples work, sorry! We're tidying them up as fast as we can.
141141

142142
### Create Your First Phaser 3 Example
143143

@@ -147,7 +147,7 @@ Create an `index.html` page locally and paste the following code into it:
147147
<!DOCTYPE html>
148148
<html>
149149
<head>
150-
<script src="http://labs.phaser.io/build/phaser-arcade-physics.min.js"></script>
150+
<script src="https://labs.phaser.io/build/phaser-arcade-physics.min.js"></script>
151151
</head>
152152
<body>
153153

src/boot/Config.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ var ValueToColor = require('../display/color/ValueToColor');
5757
* @property {number} [zoom=1] - [description]
5858
* @property {number} [resolution=1] - [description]
5959
* @property {number} [type=CONST.AUTO] - [description]
60-
* @property {*} [?parent=null] - [description]
61-
* @property {HTMLCanvasElement} [?canvas=null] - [description]
62-
* @property {string} [?canvasStyle=null] - [description]
63-
* @property {object} [?scene=null] - [description]
60+
* @property {*} [parent=null] - [description]
61+
* @property {HTMLCanvasElement} [canvas=null] - [description]
62+
* @property {string} [canvasStyle=null] - [description]
63+
* @property {object} [scene=null] - [description]
6464
* @property {string[]} [seed] - [description]
6565
* @property {string} [title=''] - [description]
6666
* @property {string} [url='http://phaser.io'] - [description]
@@ -69,17 +69,17 @@ var ValueToColor = require('../display/color/ValueToColor');
6969
* @property {boolean} [input.keyboard=true] - [description]
7070
* @property {*} [input.keyboard.target=window] - [description]
7171
* @property {(boolean|object)} [input.mouse=true] - [description]
72-
* @property {*} [?input.mouse.target=null] - [description]
72+
* @property {*} [input.mouse.target=null] - [description]
7373
* @property {boolean} [input.touch=true] - [description]
74-
* @property {*} [?input.touch.target=null] - [description]
75-
* @property {boolean} [?input.touch.capture=true] - [description]
74+
* @property {*} [input.touch.target=null] - [description]
75+
* @property {boolean} [input.touch.capture=true] - [description]
7676
* @property {(boolean|object)} [input.gamepad=false] - [description]
7777
* @property {boolean} [disableContextMenu=false] - [description]
7878
* @property {(boolean|object)} [banner=false] - [description]
7979
* @property {boolean} [banner.hidePhaser=false] - [description]
8080
* @property {string} [banner.text='#ffffff'] - [description]
8181
* @property {string[]} [banner.background] - [description]
82-
* @property {FPSConfig} [?fps] - [description]
82+
* @property {FPSConfig} [fps] - [description]
8383
* @property {boolean} [antialias=true] - [description]
8484
* @property {boolean} [pixelArt=false] - [description]
8585
* @property {boolean} [autoResize=false] - [description]
@@ -91,11 +91,11 @@ var ValueToColor = require('../display/color/ValueToColor');
9191
* @property {boolean} [failIfMajorPerformanceCaveat=false] - [description]
9292
* @property {boolean} [powerPreference='default'] - "high-performance", "low-power" or "default"
9393
* @property {(string|number)} [backgroundColor=0x000000] - [description]
94-
* @property {object} [?callbacks] - [description]
94+
* @property {object} [callbacks] - [description]
9595
* @property {BootCallback} [callbacks.preBoot=NOOP] - [description]
9696
* @property {BootCallback} [callbacks.postBoot=NOOP] - [description]
97-
* @property {LoaderConfig} [?loader] - [description]
98-
* @property {object} [?images] - [description]
97+
* @property {LoaderConfig} [loader] - [description]
98+
* @property {object} [images] - [description]
9999
* @property {string} [images.default] - [description]
100100
* @property {string} [images.missing] - [description]
101101
*/

src/boot/Game.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,15 +538,18 @@ var Game = new Class({
538538

539539
this.scene.destroy();
540540

541-
this.renderer.destroy();
541+
if (this.renderer)
542+
{
543+
this.renderer.destroy();
544+
}
542545

543546
this.events.emit('destroy');
544547

545548
this.events.removeAllListeners();
546549

547550
this.onStepCallback = null;
548551

549-
if (removeCanvas)
552+
if (removeCanvas && this.canvas)
550553
{
551554
CanvasPool.remove(this.canvas);
552555
}

src/cache/CacheManager.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ var CacheManager = new Class({
4343
*
4444
* @name Phaser.Cache.CacheManager#binary
4545
* @type {Phaser.Cache.BaseCache}
46-
* @protected
4746
* @since 3.0.0
4847
*/
4948
this.binary = new BaseCache();
@@ -54,7 +53,6 @@ var CacheManager = new Class({
5453
*
5554
* @name Phaser.Cache.CacheManager#bitmapFont
5655
* @type {Phaser.Cache.BaseCache}
57-
* @protected
5856
* @since 3.0.0
5957
*/
6058
this.bitmapFont = new BaseCache();
@@ -64,7 +62,6 @@ var CacheManager = new Class({
6462
*
6563
* @name Phaser.Cache.CacheManager#json
6664
* @type {Phaser.Cache.BaseCache}
67-
* @protected
6865
* @since 3.0.0
6966
*/
7067
this.json = new BaseCache();
@@ -74,7 +71,6 @@ var CacheManager = new Class({
7471
*
7572
* @name Phaser.Cache.CacheManager#physics
7673
* @type {Phaser.Cache.BaseCache}
77-
* @protected
7874
* @since 3.0.0
7975
*/
8076
this.physics = new BaseCache();
@@ -84,7 +80,6 @@ var CacheManager = new Class({
8480
*
8581
* @name Phaser.Cache.CacheManager#shader
8682
* @type {Phaser.Cache.BaseCache}
87-
* @protected
8883
* @since 3.0.0
8984
*/
9085
this.shader = new BaseCache();
@@ -94,7 +89,6 @@ var CacheManager = new Class({
9489
*
9590
* @name Phaser.Cache.CacheManager#audio
9691
* @type {Phaser.Cache.BaseCache}
97-
* @protected
9892
* @since 3.0.0
9993
*/
10094
this.audio = new BaseCache();
@@ -104,7 +98,6 @@ var CacheManager = new Class({
10498
*
10599
* @name Phaser.Cache.CacheManager#text
106100
* @type {Phaser.Cache.BaseCache}
107-
* @protected
108101
* @since 3.0.0
109102
*/
110103
this.text = new BaseCache();
@@ -114,7 +107,6 @@ var CacheManager = new Class({
114107
*
115108
* @name Phaser.Cache.CacheManager#obj
116109
* @type {Phaser.Cache.BaseCache}
117-
* @protected
118110
* @since 3.0.0
119111
*/
120112
this.obj = new BaseCache();
@@ -125,7 +117,6 @@ var CacheManager = new Class({
125117
*
126118
* @name Phaser.Cache.CacheManager#tilemap
127119
* @type {Phaser.Cache.BaseCache}
128-
* @protected
129120
* @since 3.0.0
130121
*/
131122
this.tilemap = new BaseCache();
@@ -135,7 +126,6 @@ var CacheManager = new Class({
135126
*
136127
* @name Phaser.Cache.CacheManager#xml
137128
* @type {Phaser.Cache.BaseCache}
138-
* @protected
139129
* @since 3.0.0
140130
*/
141131
this.xml = new BaseCache();
@@ -146,7 +136,6 @@ var CacheManager = new Class({
146136
*
147137
* @name Phaser.Cache.CacheManager#custom
148138
* @type {Object.<Phaser.Cache.BaseCache>}
149-
* @protected
150139
* @since 3.0.0
151140
*/
152141
this.custom = {};

src/curves/LineCurve.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,15 @@ var LineCurve = new Class({
107107
* @method Phaser.Curves.LineCurve#getResolution
108108
* @since 3.0.0
109109
*
110-
* @return {integer} [description]
110+
* @param {number} [divisions=1] - [description]
111+
*
112+
* @return {number} [description]
111113
*/
112-
getResolution: function ()
114+
getResolution: function (divisions)
113115
{
114-
return 1;
116+
if (divisions === undefined) { divisions = 1; }
117+
118+
return divisions;
115119
},
116120

117121
/**

0 commit comments

Comments
 (0)