mirror of
https://github.com/photonstorm/phaser
synced 2024-11-26 06:30:38 +00:00
2.0.4 release build
This commit is contained in:
parent
ba3f6355f4
commit
1c92caad42
11 changed files with 10122 additions and 2322 deletions
1170
build/custom/p2.js
1170
build/custom/p2.js
File diff suppressed because it is too large
Load diff
10
build/custom/p2.min.js
vendored
10
build/custom/p2.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
28
build/custom/phaser-arcade-physics.min.js
vendored
28
build/custom/phaser-arcade-physics.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
22
build/custom/phaser-no-libs.min.js
vendored
22
build/custom/phaser-no-libs.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -284,8 +284,8 @@ PIXI.Polygon.prototype.constructor = PIXI.Polygon;
|
||||||
*
|
*
|
||||||
* @class Circle
|
* @class Circle
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param x {Number} The X coordinate of the upper-left corner of the framing rectangle of this circle
|
* @param x {Number} The X coordinate of the center of this circle
|
||||||
* @param y {Number} The Y coordinate of the upper-left corner of the framing rectangle of this circle
|
* @param y {Number} The Y coordinate of the center of this circle
|
||||||
* @param radius {Number} The radius of the circle
|
* @param radius {Number} The radius of the circle
|
||||||
*/
|
*/
|
||||||
PIXI.Circle = function(x, y, radius)
|
PIXI.Circle = function(x, y, radius)
|
||||||
|
@ -540,7 +540,8 @@ PIXI.identityMatrix = new PIXI.Matrix();
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The base class for all objects that are rendered on the screen.
|
* The base class for all objects that are rendered on the screen.
|
||||||
|
* This is an abstract class and should not be used on its own rather it should be extended.
|
||||||
*
|
*
|
||||||
* @class DisplayObject
|
* @class DisplayObject
|
||||||
* @constructor
|
* @constructor
|
||||||
|
@ -1035,7 +1036,7 @@ PIXI.DisplayObject.prototype.generateTexture = function(renderer)
|
||||||
var bounds = this.getLocalBounds();
|
var bounds = this.getLocalBounds();
|
||||||
|
|
||||||
var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0, renderer);
|
var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0, renderer);
|
||||||
renderTexture.render(this);
|
renderTexture.render(this, new PIXI.Point(-bounds.x, -bounds.y) );
|
||||||
|
|
||||||
return renderTexture;
|
return renderTexture;
|
||||||
};
|
};
|
||||||
|
@ -1079,7 +1080,11 @@ PIXI.DisplayObject.prototype._generateCachedSprite = function()//renderSession)
|
||||||
this._filters = null;
|
this._filters = null;
|
||||||
|
|
||||||
this._cachedSprite.filters = tempFilters;
|
this._cachedSprite.filters = tempFilters;
|
||||||
this._cachedSprite.texture.render(this);
|
this._cachedSprite.texture.render(this, new PIXI.Point(-bounds.x, -bounds.y) );
|
||||||
|
|
||||||
|
this._cachedSprite.anchor.x = -( bounds.x / bounds.width );
|
||||||
|
this._cachedSprite.anchor.y = -( bounds.y / bounds.height );
|
||||||
|
|
||||||
|
|
||||||
this._filters = tempFilters;
|
this._filters = tempFilters;
|
||||||
|
|
||||||
|
@ -2449,7 +2454,7 @@ PIXI.Text.prototype.updateText = function()
|
||||||
var width = maxLineWidth + this.style.strokeThickness;
|
var width = maxLineWidth + this.style.strokeThickness;
|
||||||
if(this.style.dropShadow)width += this.style.dropShadowDistance;
|
if(this.style.dropShadow)width += this.style.dropShadowDistance;
|
||||||
|
|
||||||
this.canvas.width = width;
|
this.canvas.width = width + this.context.lineWidth;
|
||||||
//calculate text height
|
//calculate text height
|
||||||
var lineHeight = this.determineFontHeight('font: ' + this.style.font + ';') + this.style.strokeThickness;
|
var lineHeight = this.determineFontHeight('font: ' + this.style.font + ';') + this.style.strokeThickness;
|
||||||
|
|
||||||
|
@ -2642,7 +2647,7 @@ PIXI.Text.prototype.wordWrap = function(text)
|
||||||
{
|
{
|
||||||
var wordWidth = this.context.measureText(words[j]).width;
|
var wordWidth = this.context.measureText(words[j]).width;
|
||||||
var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width;
|
var wordWidthWithSpace = wordWidth + this.context.measureText(' ').width;
|
||||||
if(wordWidthWithSpace > spaceLeft)
|
if(j === 0 || wordWidthWithSpace > spaceLeft)
|
||||||
{
|
{
|
||||||
// Skip printing the newline if it's the first word of the line that is
|
// Skip printing the newline if it's the first word of the line that is
|
||||||
// greater than the word wrap width.
|
// greater than the word wrap width.
|
||||||
|
@ -2650,13 +2655,13 @@ PIXI.Text.prototype.wordWrap = function(text)
|
||||||
{
|
{
|
||||||
result += '\n';
|
result += '\n';
|
||||||
}
|
}
|
||||||
result += words[j] + ' ';
|
result += words[j];
|
||||||
spaceLeft = this.style.wordWrapWidth - wordWidth;
|
spaceLeft = this.style.wordWrapWidth - wordWidth;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
spaceLeft -= wordWidthWithSpace;
|
spaceLeft -= wordWidthWithSpace;
|
||||||
result += words[j] + ' ';
|
result += ' ' + words[j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5385,7 +5390,7 @@ PIXI.WebGLMaskManager.prototype.pushMask = function(maskData, renderSession)
|
||||||
|
|
||||||
this.maskStack.push(maskData);
|
this.maskStack.push(maskData);
|
||||||
|
|
||||||
gl.colorMask(false, false, false, true);
|
gl.colorMask(false, false, false, false);
|
||||||
gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
|
gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
|
||||||
|
|
||||||
PIXI.WebGLGraphics.renderGraphics(maskData, renderSession);
|
PIXI.WebGLGraphics.renderGraphics(maskData, renderSession);
|
||||||
|
@ -6531,11 +6536,11 @@ PIXI.WebGLFilterManager.prototype.pushFilter = function(filterBlock)
|
||||||
|
|
||||||
var filterArea = filterBlock._filterArea;// filterBlock.target.getBounds();///filterBlock.target.filterArea;
|
var filterArea = filterBlock._filterArea;// filterBlock.target.getBounds();///filterBlock.target.filterArea;
|
||||||
|
|
||||||
var padidng = filter.padding;
|
var padding = filter.padding;
|
||||||
filterArea.x -= padidng;
|
filterArea.x -= padding;
|
||||||
filterArea.y -= padidng;
|
filterArea.y -= padding;
|
||||||
filterArea.width += padidng * 2;
|
filterArea.width += padding * 2;
|
||||||
filterArea.height += padidng * 2;
|
filterArea.height += padding * 2;
|
||||||
|
|
||||||
// cap filter to screen size..
|
// cap filter to screen size..
|
||||||
if(filterArea.x < 0)filterArea.x = 0;
|
if(filterArea.x < 0)filterArea.x = 0;
|
||||||
|
@ -6907,9 +6912,10 @@ PIXI.WebGLFilterManager.prototype.destroy = function()
|
||||||
* @param gl {WebGLContext} the current WebGL drawing context
|
* @param gl {WebGLContext} the current WebGL drawing context
|
||||||
* @param width {Number} the horizontal range of the filter
|
* @param width {Number} the horizontal range of the filter
|
||||||
* @param height {Number} the vertical range of the filter
|
* @param height {Number} the vertical range of the filter
|
||||||
|
* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
PIXI.FilterTexture = function(gl, width, height)
|
PIXI.FilterTexture = function(gl, width, height, scaleMode)
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @property gl
|
* @property gl
|
||||||
|
@ -6921,9 +6927,11 @@ PIXI.FilterTexture = function(gl, width, height)
|
||||||
this.frameBuffer = gl.createFramebuffer();
|
this.frameBuffer = gl.createFramebuffer();
|
||||||
this.texture = gl.createTexture();
|
this.texture = gl.createTexture();
|
||||||
|
|
||||||
|
scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
|
||||||
|
|
||||||
gl.bindTexture(gl.TEXTURE_2D, this.texture);
|
gl.bindTexture(gl.TEXTURE_2D, this.texture);
|
||||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
|
||||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
|
||||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
||||||
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
||||||
gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer );
|
gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer );
|
||||||
|
@ -6931,6 +6939,11 @@ PIXI.FilterTexture = function(gl, width, height)
|
||||||
gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer );
|
gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer );
|
||||||
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0);
|
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0);
|
||||||
|
|
||||||
|
// required for masking a mask??
|
||||||
|
this.renderBuffer = gl.createRenderbuffer();
|
||||||
|
gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer);
|
||||||
|
gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.renderBuffer);
|
||||||
|
|
||||||
this.resize(width, height);
|
this.resize(width, height);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -6966,6 +6979,9 @@ PIXI.FilterTexture.prototype.resize = function(width, height)
|
||||||
gl.bindTexture(gl.TEXTURE_2D, this.texture);
|
gl.bindTexture(gl.TEXTURE_2D, this.texture);
|
||||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
|
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
|
||||||
|
|
||||||
|
// update the stencil buffer width and height
|
||||||
|
gl.bindRenderbuffer(gl.RENDERBUFFER, this.renderBuffer);
|
||||||
|
gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, width, height);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -8009,7 +8025,7 @@ PIXI.Graphics = function()
|
||||||
/**
|
/**
|
||||||
* the bounds' padding used for bounds calculation
|
* the bounds' padding used for bounds calculation
|
||||||
*
|
*
|
||||||
* @property bounds
|
* @property boundsPadding
|
||||||
* @type Number
|
* @type Number
|
||||||
*/
|
*/
|
||||||
this.boundsPadding = 10;
|
this.boundsPadding = 10;
|
||||||
|
@ -8390,28 +8406,24 @@ PIXI.Graphics.prototype.getBounds = function( matrix )
|
||||||
var x4 = a * w1 + c * h0 + tx;
|
var x4 = a * w1 + c * h0 + tx;
|
||||||
var y4 = d * h0 + b * w1 + ty;
|
var y4 = d * h0 + b * w1 + ty;
|
||||||
|
|
||||||
var maxX = -Infinity;
|
var maxX = x1;
|
||||||
var maxY = -Infinity;
|
var maxY = y1;
|
||||||
|
|
||||||
var minX = Infinity;
|
var minX = x1;
|
||||||
var minY = Infinity;
|
var minY = y1;
|
||||||
|
|
||||||
minX = x1 < minX ? x1 : minX;
|
|
||||||
minX = x2 < minX ? x2 : minX;
|
minX = x2 < minX ? x2 : minX;
|
||||||
minX = x3 < minX ? x3 : minX;
|
minX = x3 < minX ? x3 : minX;
|
||||||
minX = x4 < minX ? x4 : minX;
|
minX = x4 < minX ? x4 : minX;
|
||||||
|
|
||||||
minY = y1 < minY ? y1 : minY;
|
|
||||||
minY = y2 < minY ? y2 : minY;
|
minY = y2 < minY ? y2 : minY;
|
||||||
minY = y3 < minY ? y3 : minY;
|
minY = y3 < minY ? y3 : minY;
|
||||||
minY = y4 < minY ? y4 : minY;
|
minY = y4 < minY ? y4 : minY;
|
||||||
|
|
||||||
maxX = x1 > maxX ? x1 : maxX;
|
|
||||||
maxX = x2 > maxX ? x2 : maxX;
|
maxX = x2 > maxX ? x2 : maxX;
|
||||||
maxX = x3 > maxX ? x3 : maxX;
|
maxX = x3 > maxX ? x3 : maxX;
|
||||||
maxX = x4 > maxX ? x4 : maxX;
|
maxX = x4 > maxX ? x4 : maxX;
|
||||||
|
|
||||||
maxY = y1 > maxY ? y1 : maxY;
|
|
||||||
maxY = y2 > maxY ? y2 : maxY;
|
maxY = y2 > maxY ? y2 : maxY;
|
||||||
maxY = y3 > maxY ? y3 : maxY;
|
maxY = y3 > maxY ? y3 : maxY;
|
||||||
maxY = y4 > maxY ? y4 : maxY;
|
maxY = y4 > maxY ? y4 : maxY;
|
||||||
|
@ -9101,7 +9113,7 @@ PIXI.BaseTexture = function(source, scaleMode)
|
||||||
|
|
||||||
if(!source)return;
|
if(!source)return;
|
||||||
|
|
||||||
if(this.source.complete || this.source.getContext)
|
if((this.source.complete || this.source.getContext) && this.source.width && this.source.height)
|
||||||
{
|
{
|
||||||
this.hasLoaded = true;
|
this.hasLoaded = true;
|
||||||
this.width = this.source.width;
|
this.width = this.source.width;
|
||||||
|
@ -9179,7 +9191,7 @@ PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode)
|
||||||
{
|
{
|
||||||
var baseTexture = PIXI.BaseTextureCache[imageUrl];
|
var baseTexture = PIXI.BaseTextureCache[imageUrl];
|
||||||
|
|
||||||
if(crossorigin === undefined)crossorigin = true;
|
if(crossorigin === undefined && imageUrl.indexOf('data:') === -1) crossorigin = true;
|
||||||
|
|
||||||
if(!baseTexture)
|
if(!baseTexture)
|
||||||
{
|
{
|
||||||
|
@ -9508,8 +9520,9 @@ PIXI.TextureUvs = function()
|
||||||
* @constructor
|
* @constructor
|
||||||
* @param width {Number} The width of the render texture
|
* @param width {Number} The width of the render texture
|
||||||
* @param height {Number} The height of the render texture
|
* @param height {Number} The height of the render texture
|
||||||
|
* @param scaleMode {Number} Should be one of the PIXI.scaleMode consts
|
||||||
*/
|
*/
|
||||||
PIXI.RenderTexture = function(width, height, renderer)
|
PIXI.RenderTexture = function(width, height, renderer, scaleMode)
|
||||||
{
|
{
|
||||||
PIXI.EventTarget.call( this );
|
PIXI.EventTarget.call( this );
|
||||||
|
|
||||||
|
@ -9547,6 +9560,8 @@ PIXI.RenderTexture = function(width, height, renderer)
|
||||||
this.baseTexture.height = this.height;
|
this.baseTexture.height = this.height;
|
||||||
this.baseTexture._glTextures = [];
|
this.baseTexture._glTextures = [];
|
||||||
|
|
||||||
|
this.baseTexture.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
|
||||||
|
|
||||||
this.baseTexture.hasLoaded = true;
|
this.baseTexture.hasLoaded = true;
|
||||||
|
|
||||||
// each render texture can only belong to one renderer at the moment if its webGL
|
// 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)
|
||||||
{
|
{
|
||||||
var gl = this.renderer.gl;
|
var gl = this.renderer.gl;
|
||||||
|
|
||||||
this.textureBuffer = new PIXI.FilterTexture(gl, this.width, this.height);
|
this.textureBuffer = new PIXI.FilterTexture(gl, this.width, this.height, this.baseTexture.scaleMode);
|
||||||
this.baseTexture._glTextures[gl.id] = this.textureBuffer.texture;
|
this.baseTexture._glTextures[gl.id] = this.textureBuffer.texture;
|
||||||
|
|
||||||
this.render = this.renderWebGL;
|
this.render = this.renderWebGL;
|
||||||
|
|
7
build/custom/pixi.min.js
vendored
7
build/custom/pixi.min.js
vendored
File diff suppressed because one or more lines are too long
4604
build/phaser.js
4604
build/phaser.js
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
40
build/phaser.min.js
vendored
40
build/phaser.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue