Skip to content

Commit 1c92caa

Browse files
committed
2.0.4 release build
1 parent ba3f635 commit 1c92caa

11 files changed

+10081
-2281
lines changed

build/custom/p2.js

+773-393
Large diffs are not rendered by default.

build/custom/p2.min.js

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-arcade-physics.js

+2,820-461
Large diffs are not rendered by default.

build/custom/phaser-arcade-physics.min.js

+14-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/phaser-no-libs.js

+2,726-429
Large diffs are not rendered by default.

build/custom/phaser-no-libs.min.js

+11-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/pixi.js

+46-31
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ PIXI.Polygon.prototype.constructor = PIXI.Polygon;
284284
*
285285
* @class Circle
286286
* @constructor
287-
* @param x {Number} The X coordinate of the upper-left corner of the framing rectangle of this circle
288-
* @param y {Number} The Y coordinate of the upper-left corner of the framing rectangle of this circle
287+
* @param x {Number} The X coordinate of the center of this circle
288+
* @param y {Number} The Y coordinate of the center of this circle
289289
* @param radius {Number} The radius of the circle
290290
*/
291291
PIXI.Circle = function(x, y, radius)
@@ -540,7 +540,8 @@ PIXI.identityMatrix = new PIXI.Matrix();
540540
*/
541541

542542
/**
543-
* The base class for all objects that are rendered on the screen.
543+
* The base class for all objects that are rendered on the screen.
544+
* This is an abstract class and should not be used on its own rather it should be extended.
544545
*
545546
* @class DisplayObject
546547
* @constructor
@@ -1035,7 +1036,7 @@ PIXI.DisplayObject.prototype.generateTexture = function(renderer)
10351036
var bounds = this.getLocalBounds();
10361037

10371038
var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0, renderer);
1038-
renderTexture.render(this);
1039+
renderTexture.render(this, new PIXI.Point(-bounds.x, -bounds.y) );
10391040

10401041
return renderTexture;
10411042
};
@@ -1079,7 +1080,11 @@ PIXI.DisplayObject.prototype._generateCachedSprite = function()//renderSession)
10791080
this._filters = null;
10801081

10811082
this._cachedSprite.filters = tempFilters;
1082-
this._cachedSprite.texture.render(this);
1083+
this._cachedSprite.texture.render(this, new PIXI.Point(-bounds.x, -bounds.y) );
1084+
1085+
this._cachedSprite.anchor.x = -( bounds.x / bounds.width );
1086+
this._cachedSprite.anchor.y = -( bounds.y / bounds.height );
1087+
10831088

10841089
this._filters = tempFilters;
10851090

@@ -2449,7 +2454,7 @@ PIXI.Text.prototype.updateText = function()
24492454
var width = maxLineWidth + this.style.strokeThickness;
24502455
if(this.style.dropShadow)width += this.style.dropShadowDistance;
24512456

2452-
this.canvas.width = width;
2457+
this.canvas.width = width + this.context.lineWidth;
24532458
//calculate text height
24542459
var lineHeight = this.determineFontHeight('font: ' + this.style.font + ';') + this.style.strokeThickness;
24552460

@@ -2642,21 +2647,21 @@ PIXI.Text.prototype.wordWrap = function(text)
26422647
{
26432648
var wordWidth = this.context.measureText(words[j]).width;
26442649
var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width;
2645-
if(wordWidthWithSpace > spaceLeft)
2650+
if(j === 0 || wordWidthWithSpace > spaceLeft)
26462651
{
26472652
// Skip printing the newline if it's the first word of the line that is
26482653
// greater than the word wrap width.
26492654
if(j > 0)
26502655
{
26512656
result += '\n';
26522657
}
2653-
result += words[j] + ' ';
2658+
result += words[j];
26542659
spaceLeft = this.style.wordWrapWidth - wordWidth;
26552660
}
26562661
else
26572662
{
26582663
spaceLeft -= wordWidthWithSpace;
2659-
result += words[j] + ' ';
2664+
result += ' ' + words[j];
26602665
}
26612666
}
26622667

@@ -5385,7 +5390,7 @@ PIXI.WebGLMaskManager.prototype.pushMask = function(maskData, renderSession)
53855390

53865391
this.maskStack.push(maskData);
53875392

5388-
gl.colorMask(false, false, false, true);
5393+
gl.colorMask(false, false, false, false);
53895394
gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
53905395

53915396
PIXI.WebGLGraphics.renderGraphics(maskData, renderSession);
@@ -6531,11 +6536,11 @@ PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock)
65316536

65326537
var filterArea = filterBlock._filterArea;// filterBlock.target.getBounds();///filterBlock.target.filterArea;
65336538

6534-
var padidng = filter.padding;
6535-
filterArea.x -= padidng;
6536-
filterArea.y -= padidng;
6537-
filterArea.width += padidng * 2;
6538-
filterArea.height += padidng * 2;
6539+
var padding = filter.padding;
6540+
filterArea.x -= padding;
6541+
filterArea.y -= padding;
6542+
filterArea.width += padding * 2;
6543+
filterArea.height += padding * 2;
65396544

65406545
// cap filter to screen size..
65416546
if(filterArea.x < 0)filterArea.x = 0;
@@ -6907,9 +6912,10 @@ PIXI.WebGLFilterManager.prototype.destroy = function()
69076912
* @param gl {WebGLContext} the current WebGL drawing context
69086913
* @param width {Number} the horizontal range of the filter
69096914
* @param height {Number} the vertical range of the filter
6915+
* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
69106916
* @private
69116917
*/
6912-
PIXI.FilterTexture = function(gl, width, height)
6918+
PIXI.FilterTexture = function(gl, width, height, scaleMode)
69136919
{
69146920
/**
69156921
* @property gl
@@ -6921,16 +6927,23 @@ PIXI.FilterTexture = function(gl, width, height)
69216927
this.frameBuffer = gl.createFramebuffer();
69226928
this.texture = gl.createTexture();
69236929

6930+
scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
6931+
69246932
gl.bindTexture(gl.TEXTURE_2D, this.texture);
6925-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
6926-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
6933+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
6934+
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
69276935
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
69286936
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
69296937
gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer );
69306938

69316939
gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer );
69326940
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0);
69336941

6942+
// required for masking a mask??
6943+
this.renderBuffer = gl.createRenderbuffer();
6944+
gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer);
6945+
gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.renderBuffer);
6946+
69346947
this.resize(width, height);
69356948
};
69366949

@@ -6966,6 +6979,9 @@ PIXI.FilterTexture.prototype.resize = function(width, height)
69666979
gl.bindTexture(gl.TEXTURE_2D, this.texture);
69676980
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
69686981

6982+
// update the stencil buffer width and height
6983+
gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer);
6984+
gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
69696985
};
69706986

69716987
/**
@@ -8009,7 +8025,7 @@ PIXI.Graphics = function()
80098025
/**
80108026
* the bounds' padding used for bounds calculation
80118027
*
8012-
* @property bounds
8028+
* @property boundsPadding
80138029
* @type Number
80148030
*/
80158031
this.boundsPadding = 10;
@@ -8390,28 +8406,24 @@ PIXI.Graphics.prototype.getBounds = function( matrix )
83908406
var x4 = a * w1 + c * h0 + tx;
83918407
var y4 = d * h0 + b * w1 + ty;
83928408

8393-
var maxX = -Infinity;
8394-
var maxY = -Infinity;
8409+
var maxX = x1;
8410+
var maxY = y1;
83958411

8396-
var minX = Infinity;
8397-
var minY = Infinity;
8412+
var minX = x1;
8413+
var minY = y1;
83988414

8399-
minX = x1 < minX ? x1 : minX;
84008415
minX = x2 < minX ? x2 : minX;
84018416
minX = x3 < minX ? x3 : minX;
84028417
minX = x4 < minX ? x4 : minX;
84038418

8404-
minY = y1 < minY ? y1 : minY;
84058419
minY = y2 < minY ? y2 : minY;
84068420
minY = y3 < minY ? y3 : minY;
84078421
minY = y4 < minY ? y4 : minY;
84088422

8409-
maxX = x1 > maxX ? x1 : maxX;
84108423
maxX = x2 > maxX ? x2 : maxX;
84118424
maxX = x3 > maxX ? x3 : maxX;
84128425
maxX = x4 > maxX ? x4 : maxX;
84138426

8414-
maxY = y1 > maxY ? y1 : maxY;
84158427
maxY = y2 > maxY ? y2 : maxY;
84168428
maxY = y3 > maxY ? y3 : maxY;
84178429
maxY = y4 > maxY ? y4 : maxY;
@@ -9101,7 +9113,7 @@ PIXI.BaseTexture = function(source, scaleMode)
91019113

91029114
if(!source)return;
91039115

9104-
if(this.source.complete || this.source.getContext)
9116+
if((this.source.complete || this.source.getContext) && this.source.width && this.source.height)
91059117
{
91069118
this.hasLoaded = true;
91079119
this.width = this.source.width;
@@ -9179,7 +9191,7 @@ PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode)
91799191
{
91809192
var baseTexture = PIXI.BaseTextureCache[imageUrl];
91819193

9182-
if(crossorigin === undefined)crossorigin = true;
9194+
if(crossorigin === undefined && imageUrl.indexOf('data:') === -1) crossorigin = true;
91839195

91849196
if(!baseTexture)
91859197
{
@@ -9508,8 +9520,9 @@ PIXI.TextureUvs = function()
95089520
* @constructor
95099521
* @param width {Number} The width of the render texture
95109522
* @param height {Number} The height of the render texture
9523+
* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
95119524
*/
9512-
PIXI.RenderTexture = function(width, height, renderer)
9525+
PIXI.RenderTexture = function(width, height, renderer, scaleMode)
95139526
{
95149527
PIXI.EventTarget.call( this );
95159528

@@ -9547,6 +9560,8 @@ PIXI.RenderTexture = function(width, height, renderer)
95479560
this.baseTexture.height = this.height;
95489561
this.baseTexture._glTextures = [];
95499562

9563+
this.baseTexture.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
9564+
95509565
this.baseTexture.hasLoaded = true;
95519566

95529567
// each render texture can only belong to one renderer at the moment if its webGL
@@ -9556,7 +9571,7 @@ PIXI.RenderTexture = function(width, height, renderer)
95569571
{
95579572
var gl = this.renderer.gl;
95589573

9559-
this.textureBuffer = new PIXI.FilterTexture(gl, this.width, this.height);
9574+
this.textureBuffer = new PIXI.FilterTexture(gl, this.width, this.height, this.baseTexture.scaleMode);
95609575
this.baseTexture._glTextures[gl.id] = this.textureBuffer.texture;
95619576

95629577
this.render = this.renderWebGL;

build/custom/pixi.min.js

+4-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)