Fixed FF tiling sprite bug

added chaining to graphics object
This commit is contained in:
Mat Groves 2014-02-13 15:44:26 +00:00
parent 2d74436c00
commit f8a6285f7f
6 changed files with 143 additions and 108 deletions

View file

@ -5,6 +5,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-yuidoc');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadTasks('tasks');

View file

@ -4,7 +4,7 @@
* Copyright (c) 2012-2014, Mat Groves
* http://goodboydigital.com/
*
* Compiled: 2014-02-10
* Compiled: 2014-02-13
*
* pixi.js is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license.php
@ -954,8 +954,8 @@ PIXI.DisplayObject.prototype.updateTransform = function()
a01 = -this._sr * this.scale.y,
a10 = this._sr * this.scale.x,
a11 = this._cr * this.scale.y,
a02 = this.position.x + a00 * px - py * a01,
a12 = this.position.y + a11 * py - px * a10,
a02 = this.position.x - a00 * px - py * a01,
a12 = this.position.y - a11 * py - px * a10,
b00 = parentTransform.a, b01 = parentTransform.b,
b10 = parentTransform.c, b11 = parentTransform.d;
@ -1946,9 +1946,9 @@ PIXI.Sprite.fromFrame = function(frameId)
* @param imageId {String} The image url of the texture
* @return {Sprite} A new Sprite using a texture from the texture cache matching the image id
*/
PIXI.Sprite.fromImage = function(imageId)
PIXI.Sprite.fromImage = function(imageId, crossorigin, scaleMode)
{
var texture = PIXI.Texture.fromImage(imageId);
var texture = PIXI.Texture.fromImage(imageId, crossorigin, scaleMode);
return new PIXI.Sprite(texture);
};
@ -3945,7 +3945,7 @@ PIXI.getNextPowerOfTwo = function(number)
* Adds event emitter functionality to a class
*
* @class EventTarget
*
* @example
* function MyEmitter() {
* PIXI.EventTarget.call(this); //mixes in event target stuff
* }
@ -6619,7 +6619,7 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite)
// set the textures uvs temporarily
// TODO create a separate texture so that we can tile part of a texture
if(!tilingSprite._uvs)tilingSprite._uvs = new Float32Array(8);
if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs();
var uvs = tilingSprite._uvs;
@ -6644,7 +6644,6 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite)
uvs.x3 = 0 - offsetX;
uvs.y3 = (1 *scaleY) - offsetY;
// get the tilingSprites current alpha
var alpha = tilingSprite.worldAlpha;
var tint = tilingSprite.tint;
@ -8814,6 +8813,8 @@ PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha)
fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, points:[], type:PIXI.Graphics.POLY};
this.graphicsData.push(this.currentPath);
return this;
};
/**
@ -8833,6 +8834,8 @@ PIXI.Graphics.prototype.moveTo = function(x, y)
this.currentPath.points.push(x, y);
this.graphicsData.push(this.currentPath);
return this;
};
/**
@ -8847,6 +8850,8 @@ PIXI.Graphics.prototype.lineTo = function(x, y)
{
this.currentPath.points.push(x, y);
this.dirty = true;
return this;
};
/**
@ -8863,6 +8868,8 @@ PIXI.Graphics.prototype.beginFill = function(color, alpha)
this.filling = true;
this.fillColor = color || 0;
this.fillAlpha = (arguments.length < 2) ? 1 : alpha;
return this;
};
/**
@ -8875,6 +8882,8 @@ PIXI.Graphics.prototype.endFill = function()
this.filling = false;
this.fillColor = null;
this.fillAlpha = 1;
return this;
};
/**
@ -8895,6 +8904,8 @@ PIXI.Graphics.prototype.drawRect = function( x, y, width, height )
this.graphicsData.push(this.currentPath);
this.dirty = true;
return this;
};
/**
@ -8916,6 +8927,8 @@ PIXI.Graphics.prototype.drawCircle = function( x, y, radius)
this.graphicsData.push(this.currentPath);
this.dirty = true;
return this;
};
/**
@ -8938,6 +8951,8 @@ PIXI.Graphics.prototype.drawEllipse = function( x, y, width, height)
this.graphicsData.push(this.currentPath);
this.dirty = true;
return this;
};
/**
@ -8955,6 +8970,8 @@ PIXI.Graphics.prototype.clear = function()
this.graphicsData = [];
this.bounds = null; //new PIXI.Rectangle();
return this;
};
/**

File diff suppressed because one or more lines are too long

View file

@ -169,6 +169,8 @@ PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha)
fillColor:this.fillColor, fillAlpha:this.fillAlpha, fill:this.filling, points:[], type:PIXI.Graphics.POLY};
this.graphicsData.push(this.currentPath);
return this;
};
/**
@ -188,6 +190,8 @@ PIXI.Graphics.prototype.moveTo = function(x, y)
this.currentPath.points.push(x, y);
this.graphicsData.push(this.currentPath);
return this;
};
/**
@ -202,6 +206,8 @@ PIXI.Graphics.prototype.lineTo = function(x, y)
{
this.currentPath.points.push(x, y);
this.dirty = true;
return this;
};
/**
@ -218,6 +224,8 @@ PIXI.Graphics.prototype.beginFill = function(color, alpha)
this.filling = true;
this.fillColor = color || 0;
this.fillAlpha = (arguments.length < 2) ? 1 : alpha;
return this;
};
/**
@ -230,6 +238,8 @@ PIXI.Graphics.prototype.endFill = function()
this.filling = false;
this.fillColor = null;
this.fillAlpha = 1;
return this;
};
/**
@ -250,6 +260,8 @@ PIXI.Graphics.prototype.drawRect = function( x, y, width, height )
this.graphicsData.push(this.currentPath);
this.dirty = true;
return this;
};
/**
@ -271,6 +283,8 @@ PIXI.Graphics.prototype.drawCircle = function( x, y, radius)
this.graphicsData.push(this.currentPath);
this.dirty = true;
return this;
};
/**
@ -293,6 +307,8 @@ PIXI.Graphics.prototype.drawEllipse = function( x, y, width, height)
this.graphicsData.push(this.currentPath);
this.dirty = true;
return this;
};
/**
@ -310,6 +326,8 @@ PIXI.Graphics.prototype.clear = function()
this.graphicsData = [];
this.bounds = null; //new PIXI.Rectangle();
return this;
};
/**

View file

@ -273,7 +273,7 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite)
// set the textures uvs temporarily
// TODO create a separate texture so that we can tile part of a texture
if(!tilingSprite._uvs)tilingSprite._uvs = new Float32Array(8);
if(!tilingSprite._uvs)tilingSprite._uvs = new PIXI.TextureUvs();
var uvs = tilingSprite._uvs;
@ -298,7 +298,6 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite)
uvs.x3 = 0 - offsetX;
uvs.y3 = (1 *scaleY) - offsetY;
// get the tilingSprites current alpha
var alpha = tilingSprite.worldAlpha;
var tint = tilingSprite.tint;

View file

@ -11,7 +11,7 @@
* Adds event emitter functionality to a class
*
* @class EventTarget
*
* @example
* function MyEmitter() {
* PIXI.EventTarget.call(this); //mixes in event target stuff
* }