Skip to content

Commit 1352b52

Browse files
committed
Merged final Pixi v2.1.0 release.
1 parent 7d0dc68 commit 1352b52

16 files changed

Lines changed: 219 additions & 64 deletions

File tree

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Version 2.2.0 - "Bethal" - in development
7575

7676
### New Features
7777

78+
* Updated to Pixi v2.1.0 - see seprate change log entry below.
7879
* Cache.getRenderTexture will retrieve a RenderTexture that is stored in the Phaser Cache. This method replaces Cache.getTexture which is now deprecated.
7980
* Cache.autoResolveURL is a new boolean (default `false`) that automatically builds a cached map of all loaded assets vs. their absolute URLs, for use with Cache.getURL and Cache.checkURL. Note that in 2.1.3 and earlier this was enabled by default, but has since been moved behind this property which needs to be set to `true` *before* you load any assets to enable.
8081
* You can now call Tween.to again on a Tween that has already completed. This will re-use the same tween, on the original object, without having to recreate the Tween again. This allows a single tween instance to be re-used multiple times, providing they are linked to the same object (thanks InsaneHero)
@@ -142,7 +143,6 @@ Version 2.2.0 - "Bethal" - in development
142143
* ArcadePhysics.skipQuadTree is now set to `true` by default. A QuadTree is a wonderful thing if the objects in your game are well spaced out. But in tightly packed games, especially those with tilemaps or single-screen games, they are a considerable performance drain and eat up CPU. We've taken the decision to disable the Arcade Physics QuadTree by default. It's all still in there and can be re-enabled via `game.physics.arcade.skipQuadTree = false`, but please only do so if you're sure your game benefits from this.
143144
* Phaser.DOM now houses new DOM functions. Some have been moved over from ScaleManager as appropriate.
144145

145-
146146
### Bug Fixes
147147

148148
* Tilemaps in WebGL wouldn't update after the first frame due to a subtle change in how Pixi uploads new textures to the GPU.
@@ -161,6 +161,31 @@ Version 2.2.0 - "Bethal" - in development
161161
* Lots of the Cache getters (such as `Cache.getbitmapData`) would return `undefined` if the asset couldn't be found. They now all consistently return `null` for missing entries (thanks @Matoking #1305)
162162
* Phaser games should now work again from the CocoonJS Launcher.
163163

164+
### Pixi 2.1.0 New Features
165+
166+
* unloadFromGPU added to PIXI.BaseTexture
167+
* PIXI.VideoTexture added
168+
* PIXI.RoundedRectangle added
169+
* Ensured all float32arrays use PIXI.Float32Array
170+
* Removed the use of call in updateTransform (as its 10x faster to run the function directly)
171+
* autoResize option added to renderer options (default is false). Pixi no longer automatically changes the style of the canvas.
172+
* PIXI.RenderTexture.getCanvas optimized
173+
174+
### Pixi 2.1.0 Bug Fixes
175+
176+
* Fix destroy method of PIXI.WebGLRenderer
177+
* Fixed Graphics.drawRoundedRectangle
178+
* Fixed Graphics.arcTo issue
179+
* Fixed Graphics.arc issue
180+
* Fixed Graphics.cacheAsBitmap alpha issue
181+
* Fixed PIXI.Strip alpha issue
182+
* Fixed PIXI.DisplayObject.cacheAsBitmap alpha issue
183+
* Fixed PIXI.RenderTexture Canvas Clear bug
184+
* Fixed PIXI.DisplayObject.updateTransform issue
185+
* Fixed webGL Shader textures issue
186+
* Fixed PIXI.DisplayObject.getLocalPosition()
187+
* Fixed CocoonJS crashing, when loading destroyed texture
188+
* Fix eventTarget emit bug
164189

165190
For details about changes made in previous versions of Phaser see the full Change Log at https://github.com/photonstorm/phaser/blob/master/CHANGELOG.md
166191

build/config.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
<script src="$path/src/pixi/Pixi.js"></script>
4040
<script src="$path/src/pixi/geom/Matrix.js"></script>
4141
<script src="$path/src/pixi/geom/Polygon.js"></script>
42+
<script src="$path/src/pixi/geom/RoundedRectangle.js"></script>
4243
<script src="$path/src/pixi/display/DisplayObject.js"></script>
4344
<script src="$path/src/pixi/display/DisplayObjectContainer.js"></script>
4445
<script src="$path/src/pixi/display/Sprite.js"></script>

src/Phaser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
var Phaser = Phaser || {
1212

13-
VERSION: '2.2.0-RC3',
13+
VERSION: '2.2.0-RC4',
1414
GAMES: [],
1515

1616
AUTO: 0,

src/input/Input.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,7 @@ Phaser.Input.prototype = {
776776
for (var i = 0; i < this.pointers.length; i++)
777777
{
778778
var pointer = this.pointers[i];
779+
779780
if (pointer.pointerId === pointerId)
780781
{
781782
return pointer;

src/pixi/InteractionData.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ PIXI.InteractionData.prototype.getLocalPosition = function(displayObject, point)
4949
var global = this.global;
5050

5151
// do a cheeky transform to get the mouse coords;
52-
var a00 = worldTransform.a, a01 = worldTransform.b, a02 = worldTransform.tx,
53-
a10 = worldTransform.c, a11 = worldTransform.d, a12 = worldTransform.ty,
52+
var a00 = worldTransform.a, a01 = worldTransform.c, a02 = worldTransform.tx,
53+
a10 = worldTransform.b, a11 = worldTransform.d, a12 = worldTransform.ty,
5454
id = 1 / (a00 * a11 + a01 * -a10);
5555

5656
point = point || new PIXI.Point();

src/pixi/Pixi.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ PIXI.WEBGL_RENDERER = 0;
1616
PIXI.CANVAS_RENDERER = 1;
1717

1818
// useful for testing against if your lib is using pixi.
19-
PIXI.VERSION = "v2.0.0";
19+
PIXI.VERSION = "v2.1.0";
2020

2121

2222
// the various blend modes supported by pixi
@@ -81,7 +81,8 @@ PIXI.defaultRenderOptions = {
8181
antialias:false,
8282
preserveDrawingBuffer:false,
8383
resolution:1,
84-
clearBeforeRender:true
84+
clearBeforeRender:true,
85+
autoResize:false
8586
}
8687

8788
PIXI.sayHello = function (type)

src/pixi/display/DisplayObject.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -518,13 +518,14 @@ PIXI.DisplayObject.prototype.updateTransform = function()
518518
// lets do the fast version as we know there is no rotation..
519519
a = this.scale.x;
520520
d = this.scale.y;
521-
tx = this.position.x - this.pivot.x * a;
522-
ty = this.position.y - this.pivot.y * d;
523521

524-
wt.a = pt.a * a;
525-
wt.b = pt.b * d;
526-
wt.c = pt.c * a;
527-
wt.d = pt.d * d;
522+
tx = this.position.x;
523+
ty = this.position.y;
524+
525+
wt.a = a * pt.a;
526+
wt.b = a * pt.b;
527+
wt.c = d * pt.c;
528+
wt.d = d * pt.d;
528529
wt.tx = tx * pt.a + ty * pt.c + pt.tx;
529530
wt.ty = tx * pt.b + ty * pt.d + pt.ty;
530531
}
@@ -540,6 +541,9 @@ PIXI.DisplayObject.prototype.updateTransform = function()
540541

541542
};
542543

544+
// performance increase to avoid using call.. (10x faster)
545+
PIXI.DisplayObject.prototype.displayObjectUpdateTransform = PIXI.DisplayObject.prototype.updateTransform;
546+
543547
/**
544548
* Retrieves the bounds of the displayObject as a rectangle object
545549
*

src/pixi/display/DisplayObjectContainer.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@ PIXI.DisplayObjectContainer = function()
2222
* @readOnly
2323
*/
2424
this.children = [];
25+
26+
// fast access to update transform..
27+
2528
};
2629

2730
// constructor
2831
PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.prototype );
2932
PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer;
3033

34+
3135
/**
3236
* The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
3337
*
@@ -280,7 +284,9 @@ PIXI.DisplayObjectContainer.prototype.updateTransform = function()
280284
{
281285
if(!this.visible)return;
282286

283-
PIXI.DisplayObject.prototype.updateTransform.call( this );
287+
this.displayObjectUpdateTransform();
288+
289+
//PIXI.DisplayObject.prototype.updateTransform.call( this );
284290

285291
if(this._cacheAsBitmap)return;
286292

@@ -290,6 +296,9 @@ PIXI.DisplayObjectContainer.prototype.updateTransform = function()
290296
}
291297
};
292298

299+
// performance increase to avoid using call.. (10x faster)
300+
PIXI.DisplayObjectContainer.prototype.displayObjectContainerUpdateTransform = PIXI.DisplayObjectContainer.prototype.updateTransform;
301+
293302
/**
294303
* Retrieves the bounds of the displayObjectContainer as a rectangle. The bounds calculation takes all visible children into consideration.
295304
*

src/pixi/geom/RoundedRectangle.js

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/**
2+
* @author Mat Groves http://matgroves.com/
3+
*/
4+
5+
/**
6+
* the Rounded Rectangle object is an area defined by its position and has nice rounded corners, as indicated by its top-left corner point (x, y) and by its width and its height.
7+
*
8+
* @class Rounded Rectangle
9+
* @constructor
10+
* @param x {Number} The X coordinate of the upper-left corner of the rounded rectangle
11+
* @param y {Number} The Y coordinate of the upper-left corner of the rounded rectangle
12+
* @param width {Number} The overall width of this rounded rectangle
13+
* @param height {Number} The overall height of this rounded rectangle
14+
* @param radius {Number} The overall radius of this corners of this rounded rectangle
15+
*/
16+
PIXI.RoundedRectangle = function(x, y, width, height, radius)
17+
{
18+
/**
19+
* @property x
20+
* @type Number
21+
* @default 0
22+
*/
23+
this.x = x || 0;
24+
25+
/**
26+
* @property y
27+
* @type Number
28+
* @default 0
29+
*/
30+
this.y = y || 0;
31+
32+
/**
33+
* @property width
34+
* @type Number
35+
* @default 0
36+
*/
37+
this.width = width || 0;
38+
39+
/**
40+
* @property height
41+
* @type Number
42+
* @default 0
43+
*/
44+
this.height = height || 0;
45+
46+
/**
47+
* @property radius
48+
* @type Number
49+
* @default 20
50+
*/
51+
this.radius = radius || 20;
52+
};
53+
54+
/**
55+
* Creates a clone of this Rounded Rectangle
56+
*
57+
* @method clone
58+
* @return {rounded Rectangle} a copy of the rounded rectangle
59+
*/
60+
PIXI.RoundedRectangle.prototype.clone = function()
61+
{
62+
return new PIXI.RoundedRectangle(this.x, this.y, this.width, this.height, this.radius);
63+
};
64+
65+
/**
66+
* Checks whether the x and y coordinates given are contained within this Rounded Rectangle
67+
*
68+
* @method contains
69+
* @param x {Number} The X coordinate of the point to test
70+
* @param y {Number} The Y coordinate of the point to test
71+
* @return {Boolean} Whether the x/y coordinates are within this Rounded Rectangle
72+
*/
73+
PIXI.RoundedRectangle.prototype.contains = function(x, y)
74+
{
75+
if(this.width <= 0 || this.height <= 0)
76+
return false;
77+
78+
var x1 = this.x;
79+
if(x >= x1 && x <= x1 + this.width)
80+
{
81+
var y1 = this.y;
82+
83+
if(y >= y1 && y <= y1 + this.height)
84+
{
85+
return true;
86+
}
87+
}
88+
89+
return false;
90+
};
91+
92+
// constructor
93+
PIXI.RoundedRectangle.prototype.constructor = PIXI.RoundedRectangle;
94+

0 commit comments

Comments
 (0)