mirror of
https://github.com/photonstorm/phaser
synced 2024-11-10 15:14:47 +00:00
Pixi 2.1.1 merge.
This commit is contained in:
parent
515dff3b04
commit
e7356fc575
11 changed files with 70 additions and 15 deletions
|
@ -113,7 +113,6 @@ Version 2.2.0 - "Bethal" - in development
|
|||
supported via a non-exported reused wrapper object; WheelEventProxy.
|
||||
The proxy methods are generated one-time dynamically but only when needed.
|
||||
|
||||
|
||||
### Updates
|
||||
|
||||
* TypeScript definitions fixes and updates (thanks @clark-stevenson)
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
|
||||
echo <<<EOL
|
||||
|
||||
<script src="$path/src/polyfills.js"></script>
|
||||
|
||||
<script src="$path/src/pixi/Pixi.js"></script>
|
||||
<script src="$path/src/pixi/geom/Matrix.js"></script>
|
||||
<script src="$path/src/pixi/geom/Polygon.js"></script>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*/
|
||||
var Phaser = Phaser || {
|
||||
|
||||
VERSION: '2.2.0-RC4',
|
||||
VERSION: '2.2.0-RC5',
|
||||
GAMES: [],
|
||||
|
||||
AUTO: 0,
|
||||
|
|
|
@ -765,6 +765,13 @@ Phaser.Game.prototype = {
|
|||
|
||||
},
|
||||
|
||||
/**
|
||||
* Updates all logic subsystems in Phaser. Called automatically by Game.update.
|
||||
*
|
||||
* @method Phaser.Game#updateLogic
|
||||
* @protected
|
||||
* @param {number} timeStep - The current timeStep value as determined by Game.update.
|
||||
*/
|
||||
updateLogic: function (timeStep) {
|
||||
|
||||
if (!this._paused && !this.pendingStep)
|
||||
|
@ -811,6 +818,13 @@ Phaser.Game.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Renders the display list. Called automatically by Game.update.
|
||||
*
|
||||
* @method Phaser.Game#updateRender
|
||||
* @protected
|
||||
* @param {number} elapsedTime - The time elapsed since the last update.
|
||||
*/
|
||||
updateRender: function (elapsedTime) {
|
||||
|
||||
// update tweens once every frame along with the render logic (to keep them smooth in slowMotion scenarios)
|
||||
|
|
|
@ -48,7 +48,7 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width', {
|
|||
|
||||
if(width !== 0)
|
||||
{
|
||||
this.scale.x = value / ( width/this.scale.x );
|
||||
this.scale.x = value / width;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', {
|
|||
|
||||
if(height !== 0)
|
||||
{
|
||||
this.scale.y = value / ( height/this.scale.y );
|
||||
this.scale.y = value / height ;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -48,7 +48,15 @@ PIXI.Strip = function(texture)
|
|||
*/
|
||||
this.dirty = true;
|
||||
|
||||
|
||||
/**
|
||||
* The blend mode to be applied to the sprite. Set to PIXI.blendModes.NORMAL to remove any blend mode.
|
||||
*
|
||||
* @property blendMode
|
||||
* @type Number
|
||||
* @default PIXI.blendModes.NORMAL;
|
||||
*/
|
||||
this.blendMode = PIXI.blendModes.NORMAL;
|
||||
|
||||
/**
|
||||
* if you need a padding, not yet implemented
|
||||
*
|
||||
|
@ -119,7 +127,8 @@ PIXI.Strip.prototype._renderStrip = function(renderSession)
|
|||
|
||||
// gl.uniformMatrix4fv(shaderProgram.mvMatrixUniform, false, mat4Real);
|
||||
|
||||
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
|
||||
renderSession.blendModeManager.setBlendMode(this.blendMode);
|
||||
|
||||
|
||||
// set uniforms
|
||||
gl.uniformMatrix3fv(shader.translationMatrix, false, this.worldTransform.toArray(true));
|
||||
|
|
|
@ -539,4 +539,3 @@ PIXI.WebGLRenderer.prototype.mapBlendModes = function()
|
|||
};
|
||||
|
||||
PIXI.WebGLRenderer.glContextId = 0;
|
||||
PIXI.WebGLRenderer.instances = [];
|
||||
|
|
|
@ -327,7 +327,7 @@ PIXI.PixiShader.prototype.syncUniforms = function()
|
|||
|
||||
if(uniform.value.baseTexture._dirty[gl.id])
|
||||
{
|
||||
PIXI.WebGLRenderer.instances[gl.id].updateTexture(uniform.value.baseTexture);
|
||||
PIXI.instances[gl.id].updateTexture(uniform.value.baseTexture);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -147,15 +147,25 @@ PIXI.WebGLGraphics.updateGraphics = function(graphics, gl)
|
|||
{
|
||||
if(data.points.length >= 6)
|
||||
{
|
||||
if(data.points.length > 5 * 2)
|
||||
if(data.points.length < 6 * 2)
|
||||
{
|
||||
webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1);
|
||||
PIXI.WebGLGraphics.buildComplexPoly(data, webGLData);
|
||||
webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0);
|
||||
|
||||
var canDrawUsingSimple = PIXI.WebGLGraphics.buildPoly(data, webGLData);
|
||||
// console.log(canDrawUsingSimple);
|
||||
|
||||
if(!canDrawUsingSimple)
|
||||
{
|
||||
// console.log("<>>>")
|
||||
webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1);
|
||||
PIXI.WebGLGraphics.buildComplexPoly(data, webGLData);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
webGLData = PIXI.WebGLGraphics.switchMode(webGL, 0);
|
||||
PIXI.WebGLGraphics.buildPoly(data, webGLData);
|
||||
webGLData = PIXI.WebGLGraphics.switchMode(webGL, 1);
|
||||
PIXI.WebGLGraphics.buildComplexPoly(data, webGLData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -803,6 +813,9 @@ PIXI.WebGLGraphics.buildPoly = function(graphicsData, webGLData)
|
|||
var b = color[2] * alpha;
|
||||
|
||||
var triangles = PIXI.PolyK.Triangulate(points);
|
||||
|
||||
if(!triangles)return false;
|
||||
|
||||
var vertPos = verts.length / 6;
|
||||
|
||||
var i = 0;
|
||||
|
@ -822,6 +835,7 @@ PIXI.WebGLGraphics.buildPoly = function(graphicsData, webGLData)
|
|||
r, g, b, alpha);
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
PIXI.WebGLGraphics.graphicsDataPool = [];
|
||||
|
|
|
@ -489,6 +489,24 @@ PIXI.Text.prototype.wordWrap = function(text)
|
|||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the bounds of the Text as a rectangle. The bounds calculation takes the worldTransform into account.
|
||||
*
|
||||
* @method getBounds
|
||||
* @param matrix {Matrix} the transformation matrix of the Text
|
||||
* @return {Rectangle} the framing rectangle
|
||||
*/
|
||||
PIXI.Text.prototype.getBounds = function(matrix)
|
||||
{
|
||||
if(this.dirty)
|
||||
{
|
||||
this.updateText();
|
||||
this.dirty = false;
|
||||
}
|
||||
|
||||
return PIXI.Sprite.prototype.getBounds.call(this, matrix);
|
||||
};
|
||||
|
||||
/**
|
||||
* Destroys this text object.
|
||||
*
|
||||
|
|
|
@ -107,8 +107,8 @@ PIXI.PolyK.Triangulate = function(p)
|
|||
}
|
||||
else
|
||||
{
|
||||
window.console.log("PIXI Warning: shape too complex to fill");
|
||||
return [];
|
||||
// window.console.log("PIXI Warning: shape too complex to fill");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue