Skip to content

Commit 641251a

Browse files
authored
Merge pull request phaserjs#6 from photonstorm/master
fuse with master + cleanup
2 parents e68776d + 7fbe57c commit 641251a

14 files changed

Lines changed: 78 additions & 68 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The following features are now deprecated and will be removed in a future versio
5454

5555
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:
5656

57-
@JasonHK @supertommy
57+
@JasonHK @supertommy @majalon @samme
5858

5959
## Version 3.22 - Kohaku - January 15th 2020
6060

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Grab the source and join the fun!
2929

3030
> 15th January 2020
3131
32-
We're excited to announce the release of Phaser 3.22, the first of many in the year 2020. The main focus of 3.22 is all the work we've done on Matter Physics integration. Matter has been supported in Phaser since the first release, yet there were lots of things we wanted to do with it to make development life easier. 3.22 brings all of these to the front, including powerful new visual debugging options such as rendering contacts, velocity, the broadphase grid, sensors, joints and more. Matter also now has 100% JSDoc and TypeScripy coverage and I spent a long time rebuilding the TypeScript defs by hand, in order to make them as accurate as possible.
32+
We're excited to announce the release of Phaser 3.22, the first of many in the year 2020. The main focus of 3.22 is all the work we've done on Matter Physics integration. Matter has been supported in Phaser since the first release, yet there were lots of things we wanted to do with it to make development life easier. 3.22 brings all of these to the front, including powerful new visual debugging options such as rendering contacts, velocity, the broadphase grid, sensors, joints and more. Matter also now has 100% JSDoc and TypeScript coverage and I spent a long time rebuilding the TypeScript defs by hand, in order to make them as accurate as possible.
3333

3434
As well as docs and defs there are stacks of handy new methods, including intersection tests such as `intersectPoint`, `intersectRay`, `overlap` and more. New Body level collision callbacks allow you to filter collided pairs a lot more quickly now, combined with new collision events and data type defs to give you all the information you need when resolving. There are now functions to create bodies from SVG data, JSON data or Physics Editor data directly, new Body alignment features and of course bug fixes.
3535

src/gameobjects/components/Transform.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ var Transform = {
225225
/**
226226
* The angle of this Game Object in radians.
227227
*
228-
* Phaser uses a right-hand clockwise rotation system, where 0 is right, 90 is down, 180/-180 is left
229-
* and -90 is up.
228+
* Phaser uses a right-hand clockwise rotation system, where 0 is right, PI/2 is down, +-PI is left
229+
* and -PI/2 is up.
230230
*
231231
* If you prefer to work in degrees, see the `angle` property instead.
232232
*

src/gameobjects/text/static/Text.js

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,17 @@ var TextStyle = require('../TextStyle');
2727
* Because it uses the Canvas API you can take advantage of all the features this offers, such as
2828
* applying gradient fills to the text, or strokes, shadows and more. You can also use custom fonts
2929
* loaded externally, such as Google or TypeKit Web fonts.
30-
*
31-
* **Important:** If the font you wish to use has a space or digit in its name, such as
32-
* 'Press Start 2P' or 'Roboto Condensed', then you _must_ put the font name in quotes, either
33-
* when creating the Text object, or when setting the font via `setFont` or `setFontFamily`. I.e.:
34-
*
30+
*
31+
* **Important:** The font name must be quoted if it contains certain combinations of digits or
32+
* special characters, either when creating the Text object, or when setting the font via `setFont`
33+
* or `setFontFamily`, e.g.:
34+
*
3535
* ```javascript
36-
* this.add.text(0, 0, 'Hello World', { fontFamily: '"Roboto Condensed"' });
36+
* this.add.text(0, 0, 'Hello World', { fontFamily: 'Georgia, "Goudy Bookletter 1911", Times, serif' });
3737
* ```
38-
*
39-
* Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all
40-
* quoted properly, too:
41-
*
38+
*
4239
* ```javascript
43-
* this.add.text(0, 0, 'Hello World', { fontFamily: 'Verdana, "Times New Roman", Tahoma, serif' });
40+
* this.add.text(0, 0, 'Hello World', { font: '"Press Start 2P"' });
4441
* ```
4542
*
4643
* You can only display fonts that are currently loaded and available to the browser: therefore fonts must
@@ -82,6 +79,8 @@ var TextStyle = require('../TextStyle');
8279
* @param {number} y - The vertical position of this Game Object in the world.
8380
* @param {(string|string[])} text - The text this Text object will display.
8481
* @param {Phaser.Types.GameObjects.Text.TextStyle} style - The text style configuration object.
82+
*
83+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#Valid_family_names
8584
*/
8685
var Text = new Class({
8786

@@ -643,19 +642,19 @@ var Text = new Class({
643642
*
644643
* If an object is given, the `fontFamily`, `fontSize` and `fontStyle`
645644
* properties of that object are set.
646-
*
647-
* **Important:** If the font you wish to use has a space or digit in its name, such as
648-
* 'Press Start 2P' or 'Roboto Condensed', then you _must_ put the font name in quotes:
649-
*
645+
*
646+
* **Important:** The font name must be quoted if it contains certain combinations of digits or
647+
* special characters:
648+
*
650649
* ```javascript
651-
* Text.setFont('"Roboto Condensed"');
650+
* Text.setFont('"Press Start 2P"');
652651
* ```
653-
*
652+
*
654653
* Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all
655654
* quoted properly, too:
656-
*
655+
*
657656
* ```javascript
658-
* Text.setFont('Verdana, "Times New Roman", Tahoma, serif');
657+
* Text.setFont('Georgia, "Goudy Bookletter 1911", Times, serif');
659658
* ```
660659
*
661660
* @method Phaser.GameObjects.Text#setFont
@@ -664,6 +663,8 @@ var Text = new Class({
664663
* @param {string} font - The font family or font settings to set.
665664
*
666665
* @return {this} This Text object.
666+
*
667+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#Valid_family_names
667668
*/
668669
setFont: function (font)
669670
{
@@ -672,19 +673,19 @@ var Text = new Class({
672673

673674
/**
674675
* Set the font family.
675-
*
676-
* **Important:** If the font you wish to use has a space or digit in its name, such as
677-
* 'Press Start 2P' or 'Roboto Condensed', then you _must_ put the font name in quotes:
678-
*
676+
*
677+
* **Important:** The font name must be quoted if it contains certain combinations of digits or
678+
* special characters:
679+
*
679680
* ```javascript
680-
* Text.setFont('"Roboto Condensed"');
681+
* Text.setFont('"Press Start 2P"');
681682
* ```
682683
*
683684
* Equally, if you wish to provide a list of fallback fonts, then you should ensure they are all
684685
* quoted properly, too:
685686
*
686687
* ```javascript
687-
* Text.setFont('Verdana, "Times New Roman", Tahoma, serif');
688+
* Text.setFont('Georgia, "Goudy Bookletter 1911", Times, serif');
688689
* ```
689690
*
690691
* @method Phaser.GameObjects.Text#setFontFamily
@@ -693,6 +694,8 @@ var Text = new Class({
693694
* @param {string} family - The font family.
694695
*
695696
* @return {this} This Text object.
697+
*
698+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/font-family#Valid_family_names
696699
*/
697700
setFontFamily: function (family)
698701
{

src/gameobjects/video/VideoFactory.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,18 @@ var Video = require('./Video');
88
var GameObjectFactory = require('../GameObjectFactory');
99

1010
/**
11-
* Creates a new Image Game Object and adds it to the Scene.
11+
* Creates a new Video Game Object and adds it to the Scene.
1212
*
13-
* Note: This method will only be available if the Image Game Object has been built into Phaser.
13+
* Note: This method will only be available if the Video Game Object has been built into Phaser.
1414
*
1515
* @method Phaser.GameObjects.GameObjectFactory#video
1616
* @since 3.20.0
1717
*
1818
* @param {number} x - The horizontal position of this Game Object in the world.
1919
* @param {number} y - The vertical position of this Game Object in the world.
20-
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
21-
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
20+
* @param {string} [key] - Optional key of the Video this Game Object will play, as stored in the Video Cache.
2221
*
23-
* @return {Phaser.GameObjects.Image} The Game Object that was created.
22+
* @return {Phaser.GameObjects.Video} The Game Object that was created.
2423
*/
2524
GameObjectFactory.register('video', function (x, y, key)
2625
{

src/math/Vector2.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ var Vector2 = new Class({
423423
},
424424

425425
/**
426-
* Right-hand normalize (make unit length) this Vector.
426+
* Rotate this Vector to its perpendicular, in the positive direction.
427427
*
428428
* @method Phaser.Math.Vector2#normalizeRightHand
429429
* @since 3.0.0
@@ -560,7 +560,7 @@ var Vector2 = new Class({
560560

561561
/**
562562
* A static zero Vector2 for use by reference.
563-
*
563+
*
564564
* This constant is meant for comparison operations and should not be modified directly.
565565
*
566566
* @constant
@@ -572,7 +572,7 @@ Vector2.ZERO = new Vector2();
572572

573573
/**
574574
* A static right Vector2 for use by reference.
575-
*
575+
*
576576
* This constant is meant for comparison operations and should not be modified directly.
577577
*
578578
* @constant
@@ -584,7 +584,7 @@ Vector2.RIGHT = new Vector2(1, 0);
584584

585585
/**
586586
* A static left Vector2 for use by reference.
587-
*
587+
*
588588
* This constant is meant for comparison operations and should not be modified directly.
589589
*
590590
* @constant
@@ -596,7 +596,7 @@ Vector2.LEFT = new Vector2(-1, 0);
596596

597597
/**
598598
* A static up Vector2 for use by reference.
599-
*
599+
*
600600
* This constant is meant for comparison operations and should not be modified directly.
601601
*
602602
* @constant
@@ -608,7 +608,7 @@ Vector2.UP = new Vector2(0, -1);
608608

609609
/**
610610
* A static down Vector2 for use by reference.
611-
*
611+
*
612612
* This constant is meant for comparison operations and should not be modified directly.
613613
*
614614
* @constant
@@ -620,7 +620,7 @@ Vector2.DOWN = new Vector2(0, 1);
620620

621621
/**
622622
* A static one Vector2 for use by reference.
623-
*
623+
*
624624
* This constant is meant for comparison operations and should not be modified directly.
625625
*
626626
* @constant

src/math/easing/linear/Linear.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* Linear easing (no variation).
99
*
10-
* @function Phaser.Math.Easing.Linear.Linear
10+
* @function Phaser.Math.Easing.Linear
1111
* @since 3.0.0
1212
*
1313
* @param {number} v - The value to be tweened.

src/math/easing/stepped/Stepped.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* Stepped easing.
99
*
10-
* @function Phaser.Math.Easing.Stepped.Stepped
10+
* @function Phaser.Math.Easing.Stepped
1111
* @since 3.0.0
1212
*
1313
* @param {number} v - The value to be tweened.

src/physics/arcade/PhysicsGroup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
1515
* @classdesc
1616
* An Arcade Physics Group object.
1717
*
18-
* All Game Objects created by this Group will automatically be given dynamic Arcade Physics bodies.
18+
* All Game Objects created by or added to this Group will automatically be given dynamic Arcade Physics bodies, if they have no body.
1919
*
2020
* Its static counterpart is {@link Phaser.Physics.Arcade.StaticGroup}.
2121
*

src/physics/arcade/StaticPhysicsGroup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
1515
* @classdesc
1616
* An Arcade Physics Static Group object.
1717
*
18-
* All Game Objects created by this Group will automatically be given static Arcade Physics bodies.
18+
* All Game Objects created by or added to this Group will automatically be given static Arcade Physics bodies, if they have no body.
1919
*
2020
* Its dynamic counterpart is {@link Phaser.Physics.Arcade.Group}.
2121
*

0 commit comments

Comments
 (0)