Skip to content

Commit 4f8ddd7

Browse files
committed
Merge branch 'master' into containers
2 parents 0186e12 + 9f36b5e commit 4f8ddd7

42 files changed

Lines changed: 347 additions & 164 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ being passed to the simulation. The default value is 1 to remain consistent with
3434
* BaseSound `setRate` and `setDetune` from the 3.3.0 release have moved to the WebAudioSound and HTML5AudioSound classes respectively, as they each handle the values differently.
3535
* The file `InteractiveObject.js` has been renamed to `CreateInteractiveObject.js` to more accurately reflect what it does and to avoid type errors in the docs.
3636
* Renamed the Camera Controls module exports for `Fixed` to `FixedKeyControl` and `Smoothed` to `SmoothedKeyControl` to match the class names. Fix #3463 (thanks @seivan)
37+
* The ComputedSize Component now has `setSize` and `setDisplaySize` methods. This component is used for Game Objects that have a non-texture based size.
3738

3839

3940

src/boot/Game.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ var Game = new Class({
115115
* An Event Emitter which is used to broadcast game-level events from the global systems.
116116
*
117117
* @name Phaser.Game#events
118-
* @type {EventEmitter}
118+
* @type {Phaser.Events.EventEmitter}
119119
* @since 3.0.0
120120
*/
121121
this.events = new EventEmitter();

src/cache/BaseCache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var BaseCache = new Class({
4242
* An instance of EventEmitter used by the cache to emit related events.
4343
*
4444
* @name Phaser.Cache.BaseCache#events
45-
* @type {EventEmitter}
45+
* @type {Phaser.Events.EventEmitter}
4646
* @since 3.0.0
4747
*/
4848
this.events = new EventEmitter();

src/data/DataManager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var Class = require('../utils/Class');
2727
* @since 3.0.0
2828
*
2929
* @param {*} parent - [description]
30-
* @param {EventEmitter} eventEmitter - [description]
30+
* @param {Phaser.Events.EventEmitter} eventEmitter - [description]
3131
*/
3232
var DataManager = new Class({
3333

@@ -48,7 +48,7 @@ var DataManager = new Class({
4848
* [description]
4949
*
5050
* @name Phaser.Data.DataManager#events
51-
* @type {EventEmitter}
51+
* @type {Phaser.Events.EventEmitter}
5252
* @since 3.0.0
5353
*/
5454
this.events = eventEmitter;

src/gameobjects/blitter/Blitter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ var Blitter = new Class({
9090
* [description]
9191
*
9292
* @name Phaser.GameObjects.Blitter#children
93-
* @type {Phaser.Structs.List.<Phaser.GameObjects.Blitter.Blitter>}
93+
* @type {Phaser.Structs.List.<Phaser.GameObjects.Blitter.Bob>}
9494
* @since 3.0.0
9595
*/
9696
this.children = new List();

src/gameobjects/components/Alpha.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,59 @@ var _FLAG = 2; // 0010
1919

2020
var Alpha = {
2121

22+
/**
23+
* Private internal value. Holds the global alpha value.
24+
*
25+
* @name Phaser.GameObjects.Components.Alpha#_alpha
26+
* @type {float}
27+
* @private
28+
* @default 1
29+
* @since 3.0.0
30+
*/
2231
_alpha: 1,
2332

33+
/**
34+
* Private internal value. Holds the top-left alpha value.
35+
*
36+
* @name Phaser.GameObjects.Components.Alpha#_alphaTL
37+
* @type {float}
38+
* @private
39+
* @default 1
40+
* @since 3.0.0
41+
*/
2442
_alphaTL: 1,
43+
44+
/**
45+
* Private internal value. Holds the top-right alpha value.
46+
*
47+
* @name Phaser.GameObjects.Components.Alpha#_alphaTR
48+
* @type {float}
49+
* @private
50+
* @default 1
51+
* @since 3.0.0
52+
*/
2553
_alphaTR: 1,
54+
55+
/**
56+
* Private internal value. Holds the bottom-left alpha value.
57+
*
58+
* @name Phaser.GameObjects.Components.Alpha#_alphaBL
59+
* @type {float}
60+
* @private
61+
* @default 1
62+
* @since 3.0.0
63+
*/
2664
_alphaBL: 1,
65+
66+
/**
67+
* Private internal value. Holds the bottom-right alpha value.
68+
*
69+
* @name Phaser.GameObjects.Components.Alpha#_alphaBR
70+
* @type {float}
71+
* @private
72+
* @default 1
73+
* @since 3.0.0
74+
*/
2775
_alphaBR: 1,
2876

2977
/**

src/gameobjects/components/BlendMode.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ var BlendModes = require('../../renderer/BlendModes');
1616

1717
var BlendMode = {
1818

19+
/**
20+
* Private internal value. Holds the current blend mode.
21+
*
22+
* @name Phaser.GameObjects.Components.BlendMode#_blendMode
23+
* @type {integer}
24+
* @private
25+
* @default 0
26+
* @since 3.0.0
27+
*/
1928
_blendMode: BlendModes.NORMAL,
2029

2130
/**

src/gameobjects/components/ComputedSize.js

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
/**
8-
* Provides methods used for setting the blend mode of a Game Object.
8+
* Provides methods used for calculating and setting the size of a non-Frame based Game Object.
99
* Should be applied as a mixin and not used directly.
1010
*
1111
* @name Phaser.GameObjects.Components.ComputedSize
@@ -74,6 +74,45 @@ var ComputedSize = {
7474
this.scaleY = value / this.height;
7575
}
7676

77+
},
78+
79+
/**
80+
* Sets the size of this Game Object.
81+
*
82+
* @method Phaser.GameObjects.Components.ComputedSize#setSize
83+
* @since 3.4.0
84+
*
85+
* @param {number} width - The width of this Game Object.
86+
* @param {number} height - The height of this Game Object.
87+
*
88+
* @return {Phaser.GameObjects.GameObject} This Game Object instance.
89+
*/
90+
setSize: function (width, height)
91+
{
92+
this.width = width;
93+
this.height = height;
94+
95+
return this;
96+
},
97+
98+
/**
99+
* Sets the display size of this Game Object.
100+
* Calling this will adjust the scale.
101+
*
102+
* @method Phaser.GameObjects.Components.ComputedSize#setDisplaySize
103+
* @since 3.4.0
104+
*
105+
* @param {number} width - The width of this Game Object.
106+
* @param {number} height - The height of this Game Object.
107+
*
108+
* @return {Phaser.GameObjects.GameObject} This Game Object instance.
109+
*/
110+
setDisplaySize: function (width, height)
111+
{
112+
this.displayWidth = width;
113+
this.displayHeight = height;
114+
115+
return this;
77116
}
78117

79118
};

src/gameobjects/components/Depth.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414

1515
var Depth = {
1616

17+
/**
18+
* Private internal value. Holds the depth of the Game Object.
19+
*
20+
* @name Phaser.GameObjects.Components.Depth#_depth
21+
* @type {integer}
22+
* @private
23+
* @default 0
24+
* @since 3.0.0
25+
*/
1726
_depth: 0,
1827

1928
/**

src/gameobjects/components/MatrixStack.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ var MatrixStack = {
5555
initMatrixStack: function ()
5656
{
5757
this.matrixStack = new Float32Array(6000); // up to 1000 matrices
58-
this.currentMatrix = new Float32Array([ 1.0, 0.0, 0.0, 1.0, 0.0, 0.0 ]);
58+
this.currentMatrix = new Float32Array([ 1, 0, 0, 1, 0, 0 ]);
5959
this.currentMatrixIndex = 0;
6060

6161
return this;
@@ -126,7 +126,7 @@ var MatrixStack = {
126126
*/
127127
loadIdentity: function ()
128128
{
129-
this.setTransform(1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
129+
this.setTransform(1, 0, 0, 1, 0, 0);
130130

131131
return this;
132132
},

0 commit comments

Comments
 (0)