From 847eb6c48ee2dfc2655348bedc6f27a325fbfcf9 Mon Sep 17 00:00:00 2001
From: Mat Groves
Date: Tue, 28 Jan 2014 00:08:50 +0000
Subject: [PATCH] Docs updated
Fixed issue where alpha not being set correctly in canvas spriteBatch
Fixed issue where previous stage events did not get removed correctly
---
bin/pixi.dev.js | 1099 ++++--
bin/pixi.js | 12 +-
docs/api.js | 5 +-
docs/assets/css/external-small.png | Bin
docs/assets/css/logo.png | Bin
docs/assets/favicon.png | Bin
docs/assets/img/spinner.gif | Bin
docs/assets/index.html | 0
docs/assets/js/api-filter.js | 0
docs/assets/js/api-list.js | 0
docs/assets/js/api-search.js | 0
docs/assets/js/apidocs.js | 0
docs/assets/js/yui-prettify.js | 0
docs/assets/vendor/prettify/CHANGES.html | 0
docs/assets/vendor/prettify/COPYING | 0
docs/assets/vendor/prettify/README.html | 0
docs/assets/vendor/prettify/prettify-min.css | 0
docs/assets/vendor/prettify/prettify-min.js | 0
docs/classes/AbstractFilter.html | 14 +-
docs/classes/AlphaMaskFilter.html | 118 +-
docs/classes/AssetLoader.html | 12 +-
docs/classes/AtlasLoader.html | 16 +-
docs/classes/BaseTexture.html | 38 +-
docs/classes/BitmapFontLoader.html | 14 +-
docs/classes/BitmapText.html | 98 +-
docs/classes/BlurFilter.html | 16 +-
docs/classes/CanvasGraphics.html | 18 +-
docs/classes/CanvasRenderer.html | 30 +-
docs/classes/Circle.html | 14 +-
docs/classes/ColorMatrixFilter.html | 12 +-
docs/classes/ColorStepFilter.html | 14 +-
docs/classes/DisplacementFilter.html | 12 +-
docs/classes/DisplayObject.html | 52 +-
docs/classes/DisplayObjectContainer.html | 66 +-
docs/classes/DotScreenFilter.html | 377 ++
docs/classes/Ellipse.html | 16 +-
docs/classes/EventTarget.html | 14 +-
docs/classes/Graphics.html | 250 +-
docs/classes/GrayFilter.html | 12 +-
docs/classes/ImageLoader.html | 16 +-
docs/classes/InvertFilter.html | 12 +-
docs/classes/JsonLoader.html | 16 +-
docs/classes/MovieClip.html | 3290 +++++++++++++++-
docs/classes/PIXI.PixiFastShader.html | 559 +++
docs/classes/PIXI.PixiShader.html | 22 +-
docs/classes/PixelateFilter.html | 276 +-
docs/classes/Point.html | 12 +-
docs/classes/PolyK.AjaxRequest.html | 12 +-
docs/classes/PolyK.InteractionData.html | 26 +-
docs/classes/PolyK.InteractionManager.html | 36 +-
docs/classes/PolyK._PointInTriangle.html | 12 +-
docs/classes/PolyK._convex.html | 12 +-
docs/classes/Polygon.html | 14 +-
docs/classes/Rectangle.html | 14 +-
docs/classes/RenderTexture.html | 28 +-
docs/classes/SepiaFilter.html | 12 +-
docs/classes/Spine.html | 160 +-
docs/classes/{Sprite™.html => Sprite.html} | 140 +-
docs/classes/SpriteSheetLoader.html | 86 +-
docs/classes/Stage.html | 98 +-
docs/classes/Text.html | 3322 ++++++++++++++++-
docs/classes/Texture.html | 38 +-
docs/classes/TilingSprite.html | 100 +-
docs/classes/TwistFilter.html | 429 +++
docs/classes/WebGLRenderer.html | 136 +-
docs/data.json | 612 +--
.../files/src_pixi_InteractionManager.js.html | 139 +-
docs/files/src_pixi_Intro.js.html | 12 +-
docs/files/src_pixi_Outro.js.html | 12 +-
docs/files/src_pixi_Pixi.js.html | 46 +-
docs/files/src_pixi_core_Circle.js.html | 14 +-
docs/files/src_pixi_core_Ellipse.js.html | 16 +-
docs/files/src_pixi_core_Point.js.html | 18 +-
docs/files/src_pixi_core_Polygon.js.html | 14 +-
docs/files/src_pixi_core_Rectangle.js.html | 14 +-
.../src_pixi_display_DisplayObject.js.html | 39 +-
...ixi_display_DisplayObjectContainer.js.html | 51 +-
docs/files/src_pixi_display_MovieClip.js.html | 14 +-
docs/files/src_pixi_display_Sprite.js.html | 68 +-
docs/files/src_pixi_display_Stage.js.html | 21 +-
docs/files/src_pixi_extras_Rope.js.html | 12 +-
docs/files/src_pixi_extras_Spine.js.html | 12 +-
docs/files/src_pixi_extras_Strip.js.html | 12 +-
.../src_pixi_extras_TilingSprite.js.html | 131 +-
.../src_pixi_filters_AbstractFilter.js.html | 14 +-
.../src_pixi_filters_AlphaMaskFilter.js.html | 82 +-
.../files/src_pixi_filters_BlurFilter.js.html | 16 +-
.../src_pixi_filters_BlurXFilter.js.html | 12 +-
.../src_pixi_filters_BlurYFilter.js.html | 12 +-
...src_pixi_filters_ColorMatrixFilter.js.html | 12 +-
.../src_pixi_filters_ColorStepFilter.js.html | 14 +-
.../src_pixi_filters_CrossHatchFilter.js.html | 12 +-
...rc_pixi_filters_DisplacementFilter.js.html | 12 +-
.../src_pixi_filters_DotScreenFilter.js.html | 16 +-
.../src_pixi_filters_FilterBlock.js.html | 12 +-
.../files/src_pixi_filters_GrayFilter.js.html | 12 +-
.../src_pixi_filters_InvertFilter.js.html | 12 +-
.../src_pixi_filters_PixelateFilter.js.html | 14 +-
.../src_pixi_filters_RGBSplitFilter.js.html | 12 +-
.../src_pixi_filters_SepiaFilter.js.html | 12 +-
.../src_pixi_filters_SmartBlurFilter.js.html | 12 +-
.../src_pixi_filters_TwistFilter.js.html | 16 +-
.../src_pixi_loaders_AssetLoader.js.html | 12 +-
.../src_pixi_loaders_AtlasLoader.js.html | 16 +-
.../src_pixi_loaders_BitmapFontLoader.js.html | 62 +-
.../src_pixi_loaders_ImageLoader.js.html | 16 +-
.../files/src_pixi_loaders_JsonLoader.js.html | 16 +-
.../src_pixi_loaders_SpineLoader.js.html | 31 +-
...src_pixi_loaders_SpriteSheetLoader.js.html | 60 +-
.../src_pixi_primitives_Graphics.js.html | 184 +-
...xi_renderers_canvas_CanvasGraphics.js.html | 12 +-
...xi_renderers_canvas_CanvasRenderer.js.html | 107 +-
...ers_canvas_utils_CanvasMaskManager.js.html | 12 +-
...enderers_canvas_utils_CanvasTinter.js.html | 24 +-
...pixi_renderers_webgl_WebGLRenderer.js.html | 214 +-
...erers_webgl_shaders_PixiFastShader.js.html | 332 ++
...renderers_webgl_shaders_PixiShader.js.html | 30 +-
...rers_webgl_shaders_PrimitiveShader.js.html | 23 +-
...enderers_webgl_shaders_StripShader.js.html | 12 +-
...s_webgl_utils_WebGLFastSpriteBatch.js.html | 552 +++
...ers_webgl_utils_WebGLFilterManager.js.html | 52 +-
...enderers_webgl_utils_WebGLGraphics.js.html | 33 +-
...erers_webgl_utils_WebGLMaskManager.js.html | 20 +-
...ers_webgl_utils_WebGLShaderManager.js.html | 117 +-
...erers_webgl_utils_WebGLShaderUtils.js.html | 12 +-
...erers_webgl_utils_WebGLSpriteBatch.js.html | 54 +-
docs/files/src_pixi_text_BitmapText.js.html | 18 +-
docs/files/src_pixi_text_Text.js.html | 36 +-
.../src_pixi_textures_BaseTexture.js.html | 49 +-
.../src_pixi_textures_RenderTexture.js.html | 25 +-
docs/files/src_pixi_textures_Texture.js.html | 26 +-
docs/files/src_pixi_utils_Detector.js.html | 20 +-
docs/files/src_pixi_utils_EventTarget.js.html | 12 +-
docs/files/src_pixi_utils_Polyk.js.html | 12 +-
docs/files/src_pixi_utils_Utils.js.html | 12 +-
docs/index.html | 12 +-
docs/modules/PIXI.html | 40 +-
src/pixi/InteractionManager.js | 41 +-
src/pixi/display/SpriteBatch.js | 2 +
src/pixi/renderers/webgl/WebGLRenderer.js | 10 +
140 files changed, 12651 insertions(+), 2435 deletions(-)
mode change 100755 => 100644 docs/assets/css/external-small.png
mode change 100755 => 100644 docs/assets/css/logo.png
mode change 100755 => 100644 docs/assets/favicon.png
mode change 100755 => 100644 docs/assets/img/spinner.gif
mode change 100755 => 100644 docs/assets/index.html
mode change 100755 => 100644 docs/assets/js/api-filter.js
mode change 100755 => 100644 docs/assets/js/api-list.js
mode change 100755 => 100644 docs/assets/js/api-search.js
mode change 100755 => 100644 docs/assets/js/apidocs.js
mode change 100755 => 100644 docs/assets/js/yui-prettify.js
mode change 100755 => 100644 docs/assets/vendor/prettify/CHANGES.html
mode change 100755 => 100644 docs/assets/vendor/prettify/COPYING
mode change 100755 => 100644 docs/assets/vendor/prettify/README.html
mode change 100755 => 100644 docs/assets/vendor/prettify/prettify-min.css
mode change 100755 => 100644 docs/assets/vendor/prettify/prettify-min.js
create mode 100644 docs/classes/DotScreenFilter.html
create mode 100644 docs/classes/PIXI.PixiFastShader.html
rename docs/classes/{Sprite™.html => Sprite.html} (94%)
create mode 100644 docs/classes/TwistFilter.html
create mode 100644 docs/files/src_pixi_renderers_webgl_shaders_PixiFastShader.js.html
create mode 100644 docs/files/src_pixi_renderers_webgl_utils_WebGLFastSpriteBatch.js.html
diff --git a/bin/pixi.dev.js b/bin/pixi.dev.js
index d98c1cf..f0722ba 100644
--- a/bin/pixi.dev.js
+++ b/bin/pixi.dev.js
@@ -4,7 +4,7 @@
* Copyright (c) 2012, Mat Groves
* http://goodboydigital.com/
*
- * Compiled: 2014-01-24
+ * Compiled: 2014-01-28
*
* pixi.js is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license.php
@@ -60,6 +60,9 @@ PIXI.scaleModes = {
NEAREST:1
};
+// interaction frequency
+PIXI.INTERACTION_FREQUENCY = 30;
+PIXI.AUTO_PREVENT_DEFAULT = true;
/**
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
@@ -69,8 +72,8 @@ PIXI.scaleModes = {
*
* @class Point
* @constructor
- * @param x {Number} position of the point
- * @param y {Number} position of the point
+ * @param x {Number} position of the point on the x axis
+ * @param y {Number} position of the point on the y axis
*/
PIXI.Point = function(x, y)
{
@@ -167,12 +170,12 @@ PIXI.Rectangle.prototype.clone = function()
};
/**
- * Checks if the x and y coords passed to this function are contained within this Rectangle
+ * Checks whether the x and y coordinates passed to this function are contained within this Rectangle
*
* @method contains
- * @param x {Number} The X coord of the point to test
- * @param y {Number} The Y coord of the point to test
- * @return {Boolean} if the x/y coords are within this Rectangle
+ * @param x {Number} The X coordinate of the point to test
+ * @param y {Number} The Y coordinate of the point to test
+ * @return {Boolean} Whether the x/y coords are within this Rectangle
*/
PIXI.Rectangle.prototype.contains = function(x, y)
{
@@ -196,7 +199,7 @@ PIXI.Rectangle.prototype.contains = function(x, y)
// constructor
PIXI.Rectangle.prototype.constructor = PIXI.Rectangle;
-
+PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0);
/**
* @author Adrien Brault
*/
@@ -248,12 +251,12 @@ PIXI.Polygon.prototype.clone = function()
};
/**
- * Checks if the x and y coords passed to this function are contained within this polygon
+ * Checks whether the x and y coordinates passed to this function are contained within this polygon
*
* @method contains
- * @param x {Number} The X coord of the point to test
- * @param y {Number} The Y coord of the point to test
- * @return {Boolean} if the x/y coords are within this polygon
+ * @param x {Number} The X coordinate of the point to test
+ * @param y {Number} The Y coordinate of the point to test
+ * @return {Boolean} Whether the x/y coordinates are within this polygon
*/
PIXI.Polygon.prototype.contains = function(x, y)
{
@@ -284,8 +287,8 @@ PIXI.Polygon.prototype.constructor = PIXI.Polygon;
*
* @class Circle
* @constructor
- * @param x {Number} The X coord of the upper-left corner of the framing rectangle of this circle
- * @param y {Number} The Y coord of the upper-left corner of the framing rectangle of this circle
+ * @param x {Number} The X coordinate of the upper-left corner of the framing rectangle of this circle
+ * @param y {Number} The Y coordinate of the upper-left corner of the framing rectangle of this circle
* @param radius {Number} The radius of the circle
*/
PIXI.Circle = function(x, y, radius)
@@ -324,12 +327,12 @@ PIXI.Circle.prototype.clone = function()
};
/**
- * Checks if the x, and y coords passed to this function are contained within this circle
+ * Checks whether the x, and y coordinates passed to this function are contained within this circle
*
* @method contains
- * @param x {Number} The X coord of the point to test
- * @param y {Number} The Y coord of the point to test
- * @return {Boolean} if the x/y coords are within this polygon
+ * @param x {Number} The X coordinate of the point to test
+ * @param y {Number} The Y coordinate of the point to test
+ * @return {Boolean} Whether the x/y coordinates are within this polygon
*/
PIXI.Circle.prototype.contains = function(x, y)
{
@@ -359,8 +362,8 @@ PIXI.Circle.prototype.constructor = PIXI.Circle;
*
* @class Ellipse
* @constructor
- * @param x {Number} The X coord of the upper-left corner of the framing rectangle of this ellipse
- * @param y {Number} The Y coord of the upper-left corner of the framing rectangle of this ellipse
+ * @param x {Number} The X coordinate of the upper-left corner of the framing rectangle of this ellipse
+ * @param y {Number} The Y coordinate of the upper-left corner of the framing rectangle of this ellipse
* @param width {Number} The overall width of this ellipse
* @param height {Number} The overall height of this ellipse
*/
@@ -407,12 +410,12 @@ PIXI.Ellipse.prototype.clone = function()
};
/**
- * Checks if the x and y coords passed to this function are contained within this ellipse
+ * Checks whether the x and y coordinates passed to this function are contained within this ellipse
*
* @method contains
- * @param x {Number} The X coord of the point to test
- * @param y {Number} The Y coord of the point to test
- * @return {Boolean} if the x/y coords are within this ellipse
+ * @param x {Number} The X coordinate of the point to test
+ * @param y {Number} The Y coordinate of the point to test
+ * @return {Boolean} Whether the x/y coords are within this ellipse
*/
PIXI.Ellipse.prototype.contains = function(x, y)
{
@@ -430,6 +433,12 @@ PIXI.Ellipse.prototype.contains = function(x, y)
return (normx + normy < 0.25);
};
+/**
+* Returns the framing rectangle of the ellipse as a PIXI.Rectangle object
+*
+* @method getBounds
+* @return {Rectangle} the framing rectangle
+*/
PIXI.Ellipse.prototype.getBounds = function()
{
return new PIXI.Rectangle(this.x, this.y, this.width, this.height);
@@ -438,22 +447,39 @@ PIXI.Ellipse.prototype.getBounds = function()
// constructor
PIXI.Ellipse.prototype.constructor = PIXI.Ellipse;
-
-
-/*
- * A lighter version of the rad gl-matrix created by Brandon Jones, Colin MacKenzie IV
- * you both rock!
+/**
+ * @author Mat Groves http://matgroves.com/ @Doormat23
*/
-function determineMatrixArrayType() {
- PIXI.Matrix = (typeof Float32Array !== 'undefined') ? Float32Array : Array;
- return PIXI.Matrix;
-}
+/*
+* @class Matrix
+* The Matrix class will choose the best type of array to use between
+* a regular javascript Array and a Float32Array if the latter is available
+*
+*/
+PIXI.determineMatrixArrayType = function() {
+ return (typeof Float32Array !== 'undefined') ? Float32Array : Array;
+};
-determineMatrixArrayType();
+PIXI.Matrix = PIXI.determineMatrixArrayType();
+
+
+/**
+ * A lighter version of the rad gl-matrix created by Brandon Jones, Colin MacKenzie IV
+ * you both rock!
+ *
+ * @class mat3
+ * @static
+*/
PIXI.mat3 = {};
+/*
+* Creates a mat3 object
+*
+* @method mat3.create
+* @static
+*/
PIXI.mat3.create = function()
{
var matrix = new PIXI.Matrix(9);
@@ -471,7 +497,14 @@ PIXI.mat3.create = function()
return matrix;
};
-
+/*
+* Creates a mat3 identity matrix
+*
+* @method mat3.indentity
+* @static
+* @param matrix {Array|Float32Array}
+*
+*/
PIXI.mat3.identity = function(matrix)
{
matrix[0] = 1;
@@ -487,33 +520,15 @@ PIXI.mat3.identity = function(matrix)
return matrix;
};
-
-PIXI.mat4 = {};
-
-PIXI.mat4.create = function()
-{
- var matrix = new PIXI.Matrix(16);
-
- matrix[0] = 1;
- matrix[1] = 0;
- matrix[2] = 0;
- matrix[3] = 0;
- matrix[4] = 0;
- matrix[5] = 1;
- matrix[6] = 0;
- matrix[7] = 0;
- matrix[8] = 0;
- matrix[9] = 0;
- matrix[10] = 1;
- matrix[11] = 0;
- matrix[12] = 0;
- matrix[13] = 0;
- matrix[14] = 0;
- matrix[15] = 1;
-
- return matrix;
-};
-
+/*
+* Multiplies the matrices given as parameters by themselves
+*
+* @method mat3.multiply
+* @static
+* @param mat {Array|Float32Array} the first operand (matrix)
+* @param mat2 {Array|Float32Array} the second operand (matrix)
+* @param [dest] {Array|Float32Array} the matrix which will hold the resulting matrix
+*/
PIXI.mat3.multiply = function (mat, mat2, dest)
{
if (!dest) { dest = mat; }
@@ -542,6 +557,14 @@ PIXI.mat3.multiply = function (mat, mat2, dest)
return dest;
};
+/*
+* Makes a copy of the matrix given in parameter
+*
+* @method mat3.clone
+* @static
+* @param mat {Array|Float32Array}
+*
+*/
PIXI.mat3.clone = function(mat)
{
var matrix = new PIXI.Matrix(9);
@@ -559,6 +582,14 @@ PIXI.mat3.clone = function(mat)
return matrix;
};
+/*
+* Re-arranges the matrix
+*
+* @method mat3.transpose
+* @static
+* @param mat {Array|Float32Array}
+* @param [dest] {Array|Float32Array} the matrix which will hold the resulting matrix
+*/
PIXI.mat3.transpose = function (mat, dest)
{
// If we are transposing ourselves we can skip a few steps but have to cache some values
@@ -587,6 +618,17 @@ PIXI.mat3.transpose = function (mat, dest)
return dest;
};
+PIXI.mat4 = {};
+
+/*
+* Appends the mat3 into a mat4, therefore making it a regular mat4 object
+*
+* @method mat3.toMat4
+* @static
+* @param mat {Array|Float32Array}
+* @param [dest] {Array|Float32Array} the matrix which will hold the resulting matrix
+*
+*/
PIXI.mat3.toMat4 = function (mat, dest)
{
if (!dest) { dest = PIXI.mat4.create(); }
@@ -615,9 +657,13 @@ PIXI.mat3.toMat4 = function (mat, dest)
};
-/////
-
-
+/*
+* Creates a new mat4 matrix
+*
+* @method mat4.create
+* @static
+*
+*/
PIXI.mat4.create = function()
{
var matrix = new PIXI.Matrix(16);
@@ -642,6 +688,16 @@ PIXI.mat4.create = function()
return matrix;
};
+/*
+* Re-arranges the matrix
+*
+*
+* @method mat4.transpose
+* @static
+* @param mat {Array|Float32Array}
+* @param [dest] {Array|Float32Array} the matrix which will hold the resulting matrix
+*
+*/
PIXI.mat4.transpose = function (mat, dest)
{
// If we are transposing ourselves we can skip a few steps but have to cache some values
@@ -685,6 +741,15 @@ PIXI.mat4.transpose = function (mat, dest)
return dest;
};
+/*
+* Multiplies the matrices given as parameters by themselves
+*
+* @method mat4.multiply
+* @static
+* @param mat {Array|Float32Array} the first operand (matrix)
+* @param mat2 {Array|Float32Array} the second operand (matrix)
+* @param [dest] {Array|Float32Array} the matrix which will hold the resulting matrix
+*/
PIXI.mat4.multiply = function (mat, mat2, dest)
{
if (!dest) { dest = mat; }
@@ -733,7 +798,7 @@ PIXI.mat4.multiply = function (mat, mat2, dest)
};
PIXI.identityMatrix = PIXI.mat3.create();
-
+PIXI.tempMatrix = PIXI.mat3.create();
/**
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
@@ -909,12 +974,37 @@ PIXI.DisplayObject = function()
this._sr = 0;
this._cr = 1;
-
+ /**
+ * The area the filter is applied to
+ *
+ * @property filterArea
+ * @type Rectangle
+ */
this.filterArea = new PIXI.Rectangle(0,0,1,1);
-
+ /**
+ * The original, cached bounds of the object
+ *
+ * @property _bounds
+ * @type Rectangle
+ * @private
+ */
this._bounds = new PIXI.Rectangle(0, 0, 1, 1);
+ /**
+ * The most up-to-date bounds of the object
+ *
+ * @property _currentBounds
+ * @type Rectangle
+ * @private
+ */
this._currentBounds = null;
+ /**
+ * The original, cached mask of the object
+ *
+ * @property _currentBounds
+ * @type Rectangle
+ * @private
+ */
this._mask = null;
/*
@@ -1155,11 +1245,23 @@ PIXI.DisplayObject.prototype.updateTransform = function()
this.worldAlpha = this.alpha * this.parent.worldAlpha;
};
+/**
+ * Retrieves the bounds of the displayObject as a rectangle object
+ *
+ * @method getBounds
+ * @return {Rectangle} the rectangular bounding area
+ */
PIXI.DisplayObject.prototype.getBounds = function()
{
return PIXI.EmptyRectangle;
};
+/**
+ * Retrieves the local bounds of the displayObject as a rectangle object
+ *
+ * @method getLocalBounds
+ * @return {Rectangle} the rectangular bounding area
+ */
PIXI.DisplayObject.prototype.getLocalBounds = function()
{
var matrixCache = this.worldTransform;
@@ -1175,12 +1277,25 @@ PIXI.DisplayObject.prototype.getLocalBounds = function()
return bounds;
};
+/**
+ * Sets the object's stage reference, the stage this object is connected to
+ *
+ * @method setStageReference
+ * @param stage {Stage} the stage that the object will have as its current stage reference
+ */
PIXI.DisplayObject.prototype.setStageReference = function(stage)
{
this.stage = stage;
if(this._interactive)this.stage.dirty = true;
};
+/**
+* Renders the object using the WebGL renderer
+*
+* @method _renderWebGL
+* @param renderSession {RenderSession}
+* @private
+*/
PIXI.DisplayObject.prototype._renderWebGL = function(renderSession)
{
// OVERWRITE;
@@ -1188,16 +1303,19 @@ PIXI.DisplayObject.prototype._renderWebGL = function(renderSession)
renderSession = renderSession;
};
+/**
+* Renders the object using the Canvas renderer
+*
+* @method _renderCanvas
+* @param renderSession {RenderSession}
+* @private
+*/
PIXI.DisplayObject.prototype._renderCanvas = function(renderSession)
{
// OVERWRITE;
// this line is just here to pass jshinting :)
renderSession = renderSession;
};
-
-PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0);
-
-
/**
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
@@ -1275,21 +1393,7 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height', {
*/
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
{
- if(child.parent && child !== this)
- {
- //// COULD BE THIS???
- child.parent.removeChild(child);
- // return;
- }
-
- child.parent = this;
-
- this.children.push(child);
-
- // update the stage reference..
-
- if(this.stage)child.setStageReference(this.stage);
-
+ this.addChildAt(child, this.children.length);
};
/**
@@ -1407,6 +1511,12 @@ PIXI.DisplayObjectContainer.prototype.updateTransform = function()
}
};
+/**
+ * Retrieves the bounds of the displayObjectContainer as a rectangle object
+ *
+ * @method getBounds
+ * @return {Rectangle} the rectangular bounding area
+ */
PIXI.DisplayObjectContainer.prototype.getBounds = function()
{
if(this.children.length === 0)return PIXI.EmptyRectangle;
@@ -1455,6 +1565,12 @@ PIXI.DisplayObjectContainer.prototype.getBounds = function()
return bounds;
};
+/**
+ * Sets the container's stage reference, the stage this object is connected to
+ *
+ * @method setStageReference
+ * @param stage {Stage} the stage that the container will have as its current stage reference
+ */
PIXI.DisplayObjectContainer.prototype.setStageReference = function(stage)
{
this.stage = stage;
@@ -1467,6 +1583,11 @@ PIXI.DisplayObjectContainer.prototype.setStageReference = function(stage)
}
};
+/**
+ * removes the current stage reference of the container
+ *
+ * @method removeStageReference
+ */
PIXI.DisplayObjectContainer.prototype.removeStageReference = function()
{
@@ -1481,6 +1602,13 @@ PIXI.DisplayObjectContainer.prototype.removeStageReference = function()
this.stage = null;
};
+/**
+* Renders the object using the WebGL renderer
+*
+* @method _renderWebGL
+* @param renderSession {RenderSession}
+* @private
+*/
PIXI.DisplayObjectContainer.prototype._renderWebGL = function(renderSession)
{
if(!this.visible || this.alpha <= 0)return;
@@ -1525,6 +1653,13 @@ PIXI.DisplayObjectContainer.prototype._renderWebGL = function(renderSession)
}
};
+/**
+* Renders the object using the Canvas renderer
+*
+* @method _renderCanvas
+* @param renderSession {RenderSession}
+* @private
+*/
PIXI.DisplayObjectContainer.prototype._renderCanvas = function(renderSession)
{
if(this.visible === false || this.alpha === 0)return;
@@ -1547,8 +1682,9 @@ PIXI.DisplayObjectContainer.prototype._renderCanvas = function(renderSession)
};
-
-
+/**
+ * @author Mat Groves http://matgroves.com/ @Doormat23
+ */
/**
* The Sprite object is the base for all textured objects that are rendered to the screen
@@ -1557,7 +1693,11 @@ PIXI.DisplayObjectContainer.prototype._renderCanvas = function(renderSession)
* @extends DisplayObjectContainer
* @constructor
* @param texture {Texture} The texture for this sprite
- * @type String
+ *
+ * A sprite can be created directly from an image like this :
+ * var sprite = nex PIXI.Sprite.FromImage('assets/image.png');
+ * yourStage.addChild(sprite);
+ * then obviously don't forget to add it to the stage you have already created
*/
PIXI.Sprite = function(texture)
{
@@ -1565,9 +1705,9 @@ PIXI.Sprite = function(texture)
/**
* The anchor sets the origin point of the texture.
- * The default is 0,0 this means the textures origin is the top left
- * Setting than anchor to 0.5,0.5 means the textures origin is centered
- * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
+ * The default is 0,0 this means the texture's origin is the top left
+ * Setting than anchor to 0.5,0.5 means the textures origin is centred
+ * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right corner
*
* @property anchor
* @type Point
@@ -1708,6 +1848,12 @@ PIXI.Sprite.prototype.onTextureUpdate = function()
this.updateFrame = true;
};
+/**
+ * Retrieves the bounds of the sprite as a rectangle object
+ *
+ * @method getBounds
+ * @return {Rectangle} the rectangular bounding area
+ */
PIXI.Sprite.prototype.getBounds = function()
{
@@ -1781,7 +1927,13 @@ PIXI.Sprite.prototype.getBounds = function()
return bounds;
};
-
+/**
+* Renders the object using the WebGL renderer
+*
+* @method _renderWebGL
+* @param renderSession {RenderSession}
+* @private
+*/
PIXI.Sprite.prototype._renderWebGL = function(renderSession)
{
// if the sprite is not visible or the alpha is 0 then no need to render this element
@@ -1839,6 +1991,13 @@ PIXI.Sprite.prototype._renderWebGL = function(renderSession)
//TODO check culling
};
+/**
+* Renders the object using the Canvas renderer
+*
+* @method _renderCanvas
+* @param renderSession {RenderSession}
+* @private
+*/
PIXI.Sprite.prototype._renderCanvas = function(renderSession)
{
// if the sprite is not visible or the alpha is 0 then no need to render this element
@@ -1987,8 +2146,17 @@ PIXI.Sprite.fromImage = function(imageId)
return new PIXI.Sprite(texture);
};
+/**
+ * @author Mat Groves http://matgroves.com/
+ */
-
+/**
+ * TODO-Alvin
+ *
+ * @class SpriteBatch
+ * @constructor
+ * @param texture {Texture}
+ */
PIXI.SpriteBatch = function(texture)
{
PIXI.DisplayObjectContainer.call( this);
@@ -2011,6 +2179,12 @@ PIXI.SpriteBatch.prototype.initWebGL = function(gl)
// alert("!")
};
+/*
+ * Updates the object transform for rendering
+ *
+ * @method updateTransform
+ * @private
+ */
PIXI.SpriteBatch.prototype.updateTransform = function()
{
// dont need to!
@@ -2018,6 +2192,13 @@ PIXI.SpriteBatch.prototype.updateTransform = function()
// PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
};
+/**
+* Renders the object using the WebGL renderer
+*
+* @method _renderWebGL
+* @param renderSession {RenderSession}
+* @private
+*/
PIXI.SpriteBatch.prototype._renderWebGL = function(renderSession)
{
if(!this.visible || this.alpha <= 0 || !this.children.length)return;
@@ -2037,6 +2218,13 @@ PIXI.SpriteBatch.prototype._renderWebGL = function(renderSession)
};
+/**
+* Renders the object using the Canvas renderer
+*
+* @method _renderCanvas
+* @param renderSession {RenderSession}
+* @private
+*/
PIXI.SpriteBatch.prototype._renderCanvas = function(renderSession)
{
var context = renderSession.context;
@@ -2055,6 +2243,8 @@ PIXI.SpriteBatch.prototype._renderCanvas = function(renderSession)
var texture = child.texture;
var frame = texture.frame;
+ context.globalAlpha = this.worldAlpha * child.alpha;
+
if(child.rotation % (Math.PI * 2) === 0)
{
@@ -2726,12 +2916,76 @@ PIXI.BitmapText.prototype.updateTransform = function()
PIXI.BitmapText.fonts = {};
+/**
+ * @author Mat Groves http://matgroves.com/ @Doormat23
+ */
+
+/**
+ * Holds all information related to an Interaction event
+ *
+ * @class InteractionData
+ * @constructor
+ */
+PIXI.InteractionData = function()
+{
+ /**
+ * This point stores the global coords of where the touch/mouse event happened
+ *
+ * @property global
+ * @type Point
+ */
+ this.global = new PIXI.Point();
+
+ // this is here for legacy... but will remove
+ this.local = new PIXI.Point();
+
+ /**
+ * The target Sprite that was interacted with
+ *
+ * @property target
+ * @type Sprite
+ */
+ this.target = null;
+
+ /**
+ * When passed to an event handler, this will be the original DOM Event that was captured
+ *
+ * @property originalEvent
+ * @type Event
+ */
+ this.originalEvent = null;
+};
+
+/**
+ * This will return the local coordinates of the specified displayObject for this InteractionData
+ *
+ * @method getLocalPosition
+ * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off
+ * @return {Point} A point containing the coordinates of the InteractionData position relative to the DisplayObject
+ */
+PIXI.InteractionData.prototype.getLocalPosition = function(displayObject)
+{
+ var worldTransform = displayObject.worldTransform;
+ var global = this.global;
+
+ // do a cheeky transform to get the mouse coords;
+ var a00 = worldTransform[0], a01 = worldTransform[1], a02 = worldTransform[2],
+ a10 = worldTransform[3], a11 = worldTransform[4], a12 = worldTransform[5],
+ id = 1 / (a00 * a11 + a01 * -a10);
+ // set the mouse coords...
+ return new PIXI.Point(a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id,
+ a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id);
+};
+
+// constructor
+PIXI.InteractionData.prototype.constructor = PIXI.InteractionData;
/**
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
/**
* The interaction manager deals with mouse and touch events. Any DisplayObject can be interactive
+ * if its interactive parameter is set to true
* This manager also supports multitouch.
*
* @class InteractionManager
@@ -2852,36 +3106,24 @@ PIXI.InteractionManager.prototype.setTarget = function(target)
this.setTargetDomElement( target.view );
}
- document.body.addEventListener('mouseup', this.onMouseUp, true);
+
};
/**
- * Sets the dom element which will receive mouse/touch events. This is useful for when you have other DOM
- * elements ontop of the renderers Canvas element. With this you'll be able to delegate another dom element
+ * Sets the DOM element which will receive mouse/touch events. This is useful for when you have other DOM
+ * elements on top of the renderers Canvas element. With this you'll be able to delegate another DOM element
* to receive those events
*
* @method setTargetDomElement
- * @param domElement {DOMElement} the dom element which will receive mouse and touch events
+ * @param domElement {DOMElement} the DOM element which will receive mouse and touch events
* @private
*/
PIXI.InteractionManager.prototype.setTargetDomElement = function(domElement)
{
//remove previouse listeners
- if( this.interactionDOMElement !== null )
- {
- this.interactionDOMElement.style['-ms-content-zooming'] = '';
- this.interactionDOMElement.style['-ms-touch-action'] = '';
- this.interactionDOMElement.removeEventListener('mousemove', this.onMouseMove, true);
- this.interactionDOMElement.removeEventListener('mousedown', this.onMouseDown, true);
- this.interactionDOMElement.removeEventListener('mouseout', this.onMouseOut, true);
-
- // aint no multi touch just yet!
- this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true);
- this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true);
- this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true);
- }
+ this.removeEvents();
if (window.navigator.msPointerEnabled)
@@ -2903,6 +3145,31 @@ PIXI.InteractionManager.prototype.setTargetDomElement = function(domElement)
domElement.addEventListener('touchstart', this.onTouchStart, true);
domElement.addEventListener('touchend', this.onTouchEnd, true);
domElement.addEventListener('touchmove', this.onTouchMove, true);
+
+ document.body.addEventListener('mouseup', this.onMouseUp, true);
+};
+
+
+PIXI.InteractionManager.prototype.removeEvents = function()
+{
+ if(!this.interactionDOMElement)return;
+
+ console.log( this.interactionDOMElement)
+ this.interactionDOMElement.style['-ms-content-zooming'] = '';
+ this.interactionDOMElement.style['-ms-touch-action'] = '';
+
+ this.interactionDOMElement.removeEventListener('mousemove', this.onMouseMove, true);
+ this.interactionDOMElement.removeEventListener('mousedown', this.onMouseDown, true);
+ this.interactionDOMElement.removeEventListener('mouseout', this.onMouseOut, true);
+
+ // aint no multi touch just yet!
+ this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true);
+ this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true);
+ this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true);
+
+ this.interactionDOMElement = null;
+
+ document.body.removeEventListener('mouseup', this.onMouseUp, true);
};
/**
@@ -2918,7 +3185,7 @@ PIXI.InteractionManager.prototype.update = function()
// frequency of 30fps??
var now = Date.now();
var diff = now - this.last;
- diff = (diff * 30) / 1000;
+ diff = (diff * PIXI.INTERACTION_FREQUENCY ) / 1000;
if(diff < 1)return;
this.last = now;
//
@@ -3043,6 +3310,8 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
{
this.mouse.originalEvent = event || window.event; //IE uses window.event
+ if(PIXI.AUTO_PREVENT_DEFAULT)this.mouse.originalEvent.preventDefault();
+
// loop through interaction tree...
// hit test each item! ->
// get interactive items under point??
@@ -3073,7 +3342,13 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
}
};
-
+/**
+ * Is called when the mouse button is moved out of the renderer element
+ *
+ * @method onMouseDown
+ * @param event {Event} The DOM event of a mouse button being moved out
+ * @private
+ */
PIXI.InteractionManager.prototype.onMouseOut = function()
{
var length = this.interactiveItems.length;
@@ -3102,6 +3377,7 @@ PIXI.InteractionManager.prototype.onMouseOut = function()
*/
PIXI.InteractionManager.prototype.onMouseUp = function(event)
{
+
this.mouse.originalEvent = event || window.event; //IE uses window.event
var length = this.interactiveItems.length;
@@ -3143,11 +3419,11 @@ PIXI.InteractionManager.prototype.onMouseUp = function(event)
};
/**
- * Tests if the current mouse coords hit a sprite
+ * Tests if the current mouse coordinates hit a sprite
*
* @method hitTest
* @param item {DisplayObject} The displayObject to test for a hit
- * @param interactionData {InteractionData} The interactionData object to update in the case of a hit
+ * @param interactionData {InteractionData} The interactionData object to update in the case there is a hit
* @private
*/
PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
@@ -3266,6 +3542,8 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
{
var rect = this.interactionDOMElement.getBoundingClientRect();
+ if(PIXI.AUTO_PREVENT_DEFAULT)event.preventDefault();
+
var changedTouches = event.changedTouches;
for (var i=0; i < changedTouches.length; i++)
{
@@ -3384,67 +3662,6 @@ PIXI.InteractionManager.prototype.onTouchEnd = function(event)
this.touchs[touchEvent.identifier] = null;
}
};
-
-/**
- * Holds all information related to an Interaction event
- *
- * @class InteractionData
- * @constructor
- */
-PIXI.InteractionData = function()
-{
- /**
- * This point stores the global coords of where the touch/mouse event happened
- *
- * @property global
- * @type Point
- */
- this.global = new PIXI.Point();
-
- // this is here for legacy... but will remove
- this.local = new PIXI.Point();
-
- /**
- * The target Sprite that was interacted with
- *
- * @property target
- * @type Sprite
- */
- this.target = null;
-
- /**
- * When passed to an event handler, this will be the original DOM Event that was captured
- *
- * @property originalEvent
- * @type Event
- */
- this.originalEvent = null;
-};
-
-/**
- * This will return the local coords of the specified displayObject for this InteractionData
- *
- * @method getLocalPosition
- * @param displayObject {DisplayObject} The DisplayObject that you would like the local coords off
- * @return {Point} A point containing the coords of the InteractionData position relative to the DisplayObject
- */
-PIXI.InteractionData.prototype.getLocalPosition = function(displayObject)
-{
- var worldTransform = displayObject.worldTransform;
- var global = this.global;
-
- // do a cheeky transform to get the mouse coords;
- var a00 = worldTransform[0], a01 = worldTransform[1], a02 = worldTransform[2],
- a10 = worldTransform[3], a11 = worldTransform[4], a12 = worldTransform[5],
- id = 1 / (a00 * a11 + a01 * -a10);
- // set the mouse coords...
- return new PIXI.Point(a11 * id * global.x + -a01 * id * global.y + (a12 * a01 - a02 * a11) * id,
- a00 * id * global.y + -a10 * id * global.x + (-a12 * a00 + a02 * a10) * id);
-};
-
-// constructor
-PIXI.InteractionData.prototype.constructor = PIXI.InteractionData;
-
/**
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
@@ -3455,8 +3672,15 @@ PIXI.InteractionData.prototype.constructor = PIXI.InteractionData;
* @class Stage
* @extends DisplayObjectContainer
* @constructor
- * @param backgroundColor {Number} the background color of the stage, easiest way to pass this in is in hex format
+ * @param backgroundColor {Number} the background color of the stage, you have to pass this in is in hex format
* like: 0xFFFFFF for white
+ *
+ * @example Creating a stage is a mandatory process when you use Pixi, which is as simple as this :
+ * var stage = new PIXI.Stage(0xFFFFFF);
+ * where the parameter given is the background colour of the stage, in hex
+ * you will use this stage instance to add your sprites to it and therefore to the renderer
+ * Here is how to add a sprite to the stage :
+ * stage.addChild(sprite);
*/
PIXI.Stage = function(backgroundColor)
{
@@ -3574,6 +3798,10 @@ PIXI.Stage.prototype.getMousePosition = function()
return this.interactionManager.mouse.global;
};
+/**
+ * @author Mat Groves http://matgroves.com/ @Doormat23
+ */
+
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
@@ -3583,6 +3811,8 @@ PIXI.Stage.prototype.getMousePosition = function()
/**
* A polyfill for requestAnimationFrame
+ * You can actually use both requestAnimationFrame and requestAnimFrame,
+ * you will still benefit from the polyfill
*
* @method requestAnimationFrame
*/
@@ -3628,7 +3858,12 @@ PIXI.hex2rgb = function(hex) {
return [(hex >> 16 & 0xFF) / 255, ( hex >> 8 & 0xFF) / 255, (hex & 0xFF)/ 255];
};
-
+/**
+ * Converts a color as an [R, G, B] array to a hex number
+ *
+ * @method rgb2hex
+ * @param rgb {Array}
+ */
PIXI.rgb2hex = function(rgb) {
return ((rgb[0]*255 << 16) + (rgb[1]*255 << 8) + rgb[2]*255);
};
@@ -3721,6 +3956,12 @@ PIXI.unpackColorRGB = function(r, g, b)//r, g, b, a)
};
*/
+/**
+ * Checks whether the Canvas BlendModes are supported by the current browser
+ *
+ * @method canUseNewCanvasBlendModes
+ * @return {Boolean} whether they are supported
+ */
PIXI.canUseNewCanvasBlendModes = function()
{
var canvas = document.createElement('canvas');
@@ -3735,7 +3976,14 @@ PIXI.canUseNewCanvasBlendModes = function()
return context.getImageData(0,0,1,1).data[0] === 0;
};
-// this function is taken from Starling Framework as its pretty neat ;)
+/**
+ * Given a number, this function returns the closest number that is a power of two
+ * this function is taken from Starling Framework as its pretty neat ;)
+ *
+ * @method getNextPowerOfTwo
+ * @param number {Number}
+ * @return {Number} the closest number that is a power of two
+ */
PIXI.getNextPowerOfTwo = function(number)
{
if (number > 0 && (number & (number - 1)) === 0) // see: http://goo.gl/D9kPj
@@ -3748,8 +3996,10 @@ PIXI.getNextPowerOfTwo = function(number)
}
};
-
-
+/**
+ * @author Mat Groves http://matgroves.com/ @Doormat23
+ */
+
/**
* https://github.com/mrdoob/eventtarget.js/
* THankS mr DOob!
@@ -3831,13 +4081,11 @@ PIXI.EventTarget = function () {
* WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by
* the browser then this function will return a canvas renderer
*
- * @method autoDetectRenderer
- * @static
- * @param width {Number} the width of the renderers view
- * @param height {Number} the height of the renderers view
- * @param view {Canvas} the canvas to use as a view, optional
- * @param transparent=false {Boolean} the transparency of the render view, default false
- * @param antialias=false {Boolean} sets antialias (only applicable in webGL chrome at the moment)
+ * @param width=800 {Number} the width of the renderers view
+ * @param height=600 {Number} the height of the renderers view
+ * @param [view] {Canvas} the canvas to use as a view, optional
+ * @param [transparent=false] {Boolean} the transparency of the render view, default false
+ * @param [antialias=false] {Boolean} sets antialias (only applicable in webGL chrome at the moment)
*
* antialias
*/
@@ -5252,7 +5500,7 @@ PIXI.glContexts = []; // this is where we store the webGL contexts for easy acce
* @constructor
* @param width=0 {Number} the width of the canvas view
* @param height=0 {Number} the height of the canvas view
- * @param view {Canvas} the canvas to use as a view, optional
+ * @param view {HTMLCanvasElement} the canvas to use as a view, optional
* @param transparent=false {Boolean} If the render view is transparent, default false
* @param antialias=false {Boolean} sets antialias (only applicable in chrome at the moment)
*
@@ -5264,17 +5512,44 @@ PIXI.WebGLRenderer = function(width, height, view, transparent, antialias)
this.type = PIXI.WEBGL_RENDERER;
// do a catch.. only 1 webGL renderer..
+ /**
+ * Whether the render view is transparent
+ *
+ * @property transparent
+ * @type Boolean
+ */
this.transparent = !!transparent;
+ /**
+ * The width of the canvas view
+ *
+ * @property width
+ * @type Number
+ * @default 800
+ */
this.width = width || 800;
+
+ /**
+ * The height of the canvas view
+ *
+ * @property height
+ * @type Number
+ * @default 600
+ */
this.height = height || 600;
+ /**
+ * The canvas element that everything is drawn to
+ *
+ * @property view
+ * @type HTMLCanvasElement
+ */
this.view = view || document.createElement( 'canvas' );
this.view.width = this.width;
this.view.height = this.height;
// deal with losing context..
-
+ // TODO-Alvin
this.contextLost = this.handleContextLost.bind(this);
this.contextRestoredLost = this.handleContextRestored.bind(this);
// console.log(this.handleContextRestored)
@@ -5383,6 +5658,8 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
// if rendering a new stage clear the batches..
if(this.__stage !== stage)
{
+ if(stage.interactive)stage.interactionManager.removeEvents();
+
// TODO make this work
// dont think this is needed any more?
this.__stage = stage;
@@ -5430,6 +5707,14 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
stage.interactionManager.setTarget(this);
}
}
+ else
+ {
+ if(stage._interactiveEventsAdded)
+ {
+ stage._interactiveEventsAdded = false;
+ stage.interactionManager.setTarget(this);
+ }
+ }
/*
//can simulate context loss in Chrome like so:
@@ -5453,6 +5738,14 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
*/
};
+/**
+ * Renders a display Object
+ *
+ * @method renderDIsplayObject
+ * @param displayObject {DisplayObject} The DisplayObject to render
+ * @param projection {Point}
+ * @param buffer {Array} buffer TODO-Alvin
+ */
PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection, buffer)
{
// reset the render session data..
@@ -5527,6 +5820,13 @@ PIXI.WebGLRenderer.destroyTexture = function(texture)
texture._glTextures.length = 0;
};
+/**
+ * TODO-Alvin
+ *
+ * @method updateTextureFrame
+ * @param texture {Texture} The texture to update the frame from
+ * @private
+ */
PIXI.WebGLRenderer.updateTextureFrame = function(texture)
{
texture.updateFrame = false;
@@ -5557,6 +5857,14 @@ PIXI.WebGLRenderer.prototype.resize = function(width, height)
this.projection.y = -this.height/2;
};
+/**
+ * Creates a WebGL texture
+ *
+ * @method createWebGLTexture
+ * @param texture {Texture} the texture to render
+ * @param gl {webglContext} the WebGL context
+ * @static
+ */
PIXI.createWebGLTexture = function(texture, gl)
{
@@ -5591,6 +5899,14 @@ PIXI.createWebGLTexture = function(texture, gl)
return texture._glTextures[gl.id];
};
+/**
+ * Updates a WebGL texture
+ *
+ * @method updateWebGLTexture
+ * @param texture {Texture} the texture to update
+ * @param gl {webglContext} the WebGL context
+ * @private
+ */
PIXI.updateWebGLTexture = function(texture, gl)
{
if( texture._glTextures[gl.id] )
@@ -5684,10 +6000,20 @@ PIXI.WebGLRenderer.prototype.handleContextRestored = function()
texture._glTextures = [];
}
+ /**
+ * Whether the context was lost
+ * @property contextLost
+ * @type Boolean
+ */
this.contextLost = false;
};
+/**
+ * Destroy TODO-Alvin
+ *
+ * @method destroy
+ */
PIXI.WebGLRenderer.prototype.destroy = function()
{
@@ -7157,12 +7483,23 @@ PIXI.FilterTexture.prototype.destroy = function()
*
*
*/
-
+/**
+ * A set of functions used to handle masking
+ *
+ * @class CanvasMaskManager
+ */
PIXI.CanvasMaskManager = function()
{
};
+/**
+ * TODO-Alvin
+ *
+ * @method pushMask
+ * @param maskData TODO-Alvin
+ * @param context {Context2D} the 2d drawing method of the canvas
+ */
PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, context)
{
context.save();
@@ -7182,6 +7519,12 @@ PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, context)
maskData.worldAlpha = cacheAlpha;
};
+/**
+ * Restores the current drawing context to the state it was before the mask was applied
+ *
+ * @method popMask
+ * @param context {Context2D} the 2d drawing method of the canvas
+ */
PIXI.CanvasMaskManager.prototype.popMask = function(context)
{
context.restore();
@@ -7193,6 +7536,11 @@ PIXI.CanvasMaskManager.prototype.popMask = function(context)
*
*/
+/**
+ * @class CanvasTinter
+ * @constructor
+ * @static
+ */
PIXI.CanvasTinter = function()
{
/// this.textureCach
@@ -7201,6 +7549,12 @@ PIXI.CanvasTinter = function()
//PIXI.CanvasTinter.cachTint = true;
+/**
+ * TODO-Alvin
+ * @method getTintedTexture
+ * @param sprite {Sprite} the sprite to tint
+ * @param color {Number} the color to use to tint the sprite with
+ */
PIXI.CanvasTinter.getTintedTexture = function(sprite, color)
{
//
@@ -7246,6 +7600,13 @@ PIXI.CanvasTinter.getTintedTexture = function(sprite, color)
return canvas;
};
+/**
+ * Tint a texture using the "multiply" operation
+ * @method tintWithMultiply
+ * @param texture {texture} the texture to tint
+ * @param color {Number} the color to use to tint the sprite with
+ * @param canvas {HTMLCanvasElement} the current canvas
+ */
PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas)
{
var context = canvas.getContext( "2d" );
@@ -7284,6 +7645,13 @@ PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas)
frame.height);
};
+/**
+ * Tint a texture using the "overlay" operation
+ * @method tintWithOverlay
+ * @param texture {texture} the texture to tint
+ * @param color {Number} the color to use to tint the sprite with
+ * @param canvas {HTMLCanvasElement} the current canvas
+ */
PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas)
{
var context = canvas.getContext( "2d" );
@@ -7315,7 +7683,13 @@ PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas)
};
-
+/**
+ * Tint a texture pixel per pixel
+ * @method tintPerPixel
+ * @param texture {texture} the texture to tint
+ * @param color {Number} the color to use to tint the sprite with
+ * @param canvas {HTMLCanvasElement} the current canvas
+ */
PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas)
{
var context = canvas.getContext( "2d" );
@@ -7353,6 +7727,11 @@ PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas)
context.putImageData(pixelData, 0, 0);
};
+/**
+ * Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel
+ * @method roundColor
+ * @param color {number} the color to round, should be a hex color
+ */
PIXI.CanvasTinter.roundColor = function(color)
{
var step = PIXI.CanvasTinter.cacheStepsPerColorChannel;
@@ -7366,15 +7745,34 @@ PIXI.CanvasTinter.roundColor = function(color)
return PIXI.rgb2hex(rgbValues);
};
+/**
+ *
+ * Number of steps which will be used as a cap when rounding colors
+ *
+ * @property cacheStepsPerColorChannel
+ * @type Number
+ */
PIXI.CanvasTinter.cacheStepsPerColorChannel = 8;
+/**
+ *
+ * Number of steps which will be used as a cap when rounding colors
+ *
+ * @property convertTintToImage
+ * @type Boolean
+ */
PIXI.CanvasTinter.convertTintToImage = false;
+/**
+ * Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method
+ *
+ * @property canUseMultiply
+ * @type Boolean
+ */
PIXI.CanvasTinter.canUseMultiply = PIXI.canUseNewCanvasBlendModes();
PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTinter.tintWithMultiply : PIXI.CanvasTinter.tintWithPerPixel;
-
/**
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
@@ -7385,10 +7783,10 @@ PIXI.CanvasTinter.tintMethod = PIXI.CanvasTinter.canUseMultiply ? PIXI.CanvasTin
*
* @class CanvasRenderer
* @constructor
- * @param width=0 {Number} the width of the canvas view
- * @param height=0 {Number} the height of the canvas view
- * @param view {Canvas} the canvas to use as a view, optional
- * @param transparent=false {Boolean} the transparency of the render view, default false
+ * @param width=800 {Number} the width of the canvas view
+ * @param height=600 {Number} the height of the canvas view
+ * @param [view] {HTMLCanvasElement} the canvas to use as a view, optional
+ * @param [transparent=false] {Boolean} the transparency of the render view, default false
*/
PIXI.CanvasRenderer = function(width, height, view, transparent)
{
@@ -7396,6 +7794,13 @@ PIXI.CanvasRenderer = function(width, height, view, transparent)
this.type = PIXI.CANVAS_RENDERER;
+
+ /**
+ * Whether the render view is transparent
+ *
+ * @property transparent
+ * @type Boolean
+ */
this.transparent = !!transparent;
if(!PIXI.blendModesCanvas)
@@ -7464,17 +7869,17 @@ PIXI.CanvasRenderer = function(width, height, view, transparent)
this.height = height || 600;
/**
- * The canvas element that the everything is drawn to
+ * The canvas element that everything is drawn to
*
* @property view
- * @type Canvas
+ * @type HTMLCanvasElement
*/
this.view = view || document.createElement( "canvas" );
/**
- * The canvas context that the everything is drawn to
+ * The canvas 2d context that everything is drawn to
* @property context
- * @type Canvas 2d Context
+ * @type HTMLCanvasElement 2d Context
*/
this.context = this.view.getContext( "2d", { alpha: this.transparent } );
@@ -7486,8 +7891,18 @@ PIXI.CanvasRenderer = function(width, height, view, transparent)
this.view.height = this.height;
this.count = 0;
+ /**
+ * Instance of a PIXI.CanvasMaskManager, handles masking when using the canvas renderer
+ * @property CanvasMaskManager
+ * @type CanvasMaskManager
+ */
this.maskManager = new PIXI.CanvasMaskManager();
+ /**
+ * RenderSession TODO-Alvin
+ * @property renderSession
+ * @type Object
+ */
this.renderSession = {
context: this.context,
maskManager: this.maskManager,
@@ -7567,7 +7982,7 @@ PIXI.CanvasRenderer.prototype.render = function(stage)
};
/**
- * resizes the canvas view to the specified width and height
+ * Resizes the canvas view to the specified width and height
*
* @method resize
* @param width {Number} the new width of the canvas view
@@ -7587,11 +8002,12 @@ PIXI.CanvasRenderer.prototype.resize = function(width, height)
*
* @method renderDisplayObject
* @param displayObject {DisplayObject} The displayObject to render
+ * @param context {Context2D} the context 2d method of the canvas
* @private
*/
PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, context)
{
- // no longer recurrsive!
+ // no longer recursive!
//var transform;
//var context = this.context;
@@ -7689,6 +8105,15 @@ PIXI.CanvasRenderer.prototype.renderStrip = function(strip)
}
};
+/**
+ * Creates a Canvas element of the given size
+ *
+ * @method CanvasBuffer
+ * @param width {Number} the width for the newly created canvas
+ * @param height {Number} the height for the newly created canvas
+ * @static
+ * @private
+ */
PIXI.CanvasBuffer = function(width, height)
{
this.width = width;
@@ -7701,11 +8126,26 @@ PIXI.CanvasBuffer = function(width, height)
this.canvas.height = height;
};
+/**
+ * Clears the canvas that was created by the CanvasBuffer class
+ *
+ * @method clear
+ * @private
+ */
PIXI.CanvasBuffer.prototype.clear = function()
{
this.context.clearRect(0,0, this.width, this.height);
};
+/**
+ * Resizes the canvas that was created by the CanvasBuffer class to the specified width and height
+ *
+ * @method resize
+ * @param width {Number} the new width of the canvas
+ * @param height {Number} the new height of the canvas
+ * @private
+ */
+
PIXI.CanvasBuffer.prototype.resize = function(width, height)
{
this.width = this.canvas.width = width;
@@ -7735,8 +8175,8 @@ PIXI.CanvasGraphics = function()
* @static
* @private
* @method renderGraphics
- * @param graphics {Graphics}
- * @param context {Context2D}
+ * @param graphics {Graphics} the actual graphics object to render
+ * @param context {Context2D} the 2d drawing method of the canvas
*/
PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
{
@@ -7869,8 +8309,8 @@ PIXI.CanvasGraphics.renderGraphics = function(graphics, context)
* @static
* @private
* @method renderGraphicsMask
- * @param graphics {Graphics}
- * @param context {Context2D}
+ * @param graphics {Graphics} the graphics which will be used as a mask
+ * @param context {Context2D} the context 2d method of the canvas
*/
PIXI.CanvasGraphics.renderGraphicsMask = function(graphics, context)
{
@@ -7958,8 +8398,8 @@ PIXI.CanvasGraphics.renderGraphicsMask = function(graphics, context)
/**
* The Graphics class contains a set of methods that you can use to create primitive shapes and lines.
- * It is important to know that with the webGL renderer only simple polys can be filled at this stage
- * Complex polys will not be filled. Heres an example of a complex poly: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
+ * It is important to know that with the webGL renderer only simple polygons can be filled at this stage
+ * Complex polygons will not be filled. Heres an example of a complex polygon: http://www.goodboydigital.com/wp-content/uploads/2013/06/complexPolygon.png
*
* @class Graphics
* @extends DisplayObjectContainer
@@ -8004,8 +8444,23 @@ PIXI.Graphics = function()
*/
this.graphicsData = [];
- this.tint = 0xFFFFFF;// * Math.random();
+ /**
+ * The tint applied to the graphic shape. This is a hex value
+ *
+ * @property tint
+ * @type Number
+ * @default 0xFFFFFF
+ */
+ this.tint = 0xFFFFFF;// * Math.random();
+
+ /**
+ * The blend mode to be applied to the graphic shape
+ *
+ * @property blendMode
+ * @type Number
+ * @default PIXI.blendModes.NORMAL;
+ */
this.blendMode = PIXI.blendModes.NORMAL;
/**
@@ -8017,12 +8472,37 @@ PIXI.Graphics = function()
*/
this.currentPath = {points:[]};
+ /**
+ * WebGL lines ? TODO-Alvin
+ *
+ * @property _webGL
+ * @type Array
+ * @private
+ */
this._webGL = [];
+ /**
+ * Whether this shape is used as a mask
+ *
+ * @property isMask
+ * @type isMask
+ */
this.isMask = false;
+ /**
+ * The bounds of the graphic shape as rectangle object
+ *
+ * @property bounds
+ * @type Rectangle
+ */
this.bounds = null;
+ /**
+ * the bound padding TODO-Alvin
+ *
+ * @property bounds
+ * @type Number
+ */
this.boundsPadding = 10;
};
@@ -8063,7 +8543,7 @@ Object.defineProperty(PIXI.Graphics.prototype, "cacheAsBitmap", {
/**
- * Specifies a line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.
+ * Specifies the line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.
*
* @method lineStyle
* @param lineWidth {Number} width of the line to draw, will update the object's stored style
@@ -8088,8 +8568,8 @@ PIXI.Graphics.prototype.lineStyle = function(lineWidth, color, alpha)
* Moves the current drawing position to (x, y).
*
* @method moveTo
- * @param x {Number} the X coord to move to
- * @param y {Number} the Y coord to move to
+ * @param x {Number} the X coordinate to move to
+ * @param y {Number} the Y coordinate to move to
*/
PIXI.Graphics.prototype.moveTo = function(x, y)
{
@@ -8108,8 +8588,8 @@ PIXI.Graphics.prototype.moveTo = function(x, y)
* the current drawing position is then set to (x, y).
*
* @method lineTo
- * @param x {Number} the X coord to draw to
- * @param y {Number} the Y coord to draw to
+ * @param x {Number} the X coordinate to draw to
+ * @param y {Number} the Y coordinate to draw to
*/
PIXI.Graphics.prototype.lineTo = function(x, y)
{
@@ -8122,8 +8602,8 @@ PIXI.Graphics.prototype.lineTo = function(x, y)
* (such as lineTo() or drawCircle()) use when drawing.
*
* @method beginFill
- * @param color {uint} the color of the fill
- * @param alpha {Number} the alpha
+ * @param color {Number} the color of the fill
+ * @param alpha {Number} the alpha of the fill
*/
PIXI.Graphics.prototype.beginFill = function(color, alpha)
{
@@ -8169,8 +8649,8 @@ PIXI.Graphics.prototype.drawRect = function( x, y, width, height )
* Draws a circle.
*
* @method drawCircle
- * @param x {Number} The X coord of the center of the circle
- * @param y {Number} The Y coord of the center of the circle
+ * @param x {Number} The X coordinate of the center of the circle
+ * @param y {Number} The Y coordinate of the center of the circle
* @param radius {Number} The radius of the circle
*/
PIXI.Graphics.prototype.drawCircle = function( x, y, radius)
@@ -8190,10 +8670,10 @@ PIXI.Graphics.prototype.drawCircle = function( x, y, radius)
* Draws an ellipse.
*
* @method drawEllipse
- * @param x {Number}
- * @param y {Number}
- * @param width {Number}
- * @param height {Number}
+ * @param x {Number} The X coordinate of the upper-left corner of the framing rectangle of this ellipse
+ * @param y {Number} The Y coordinate of the upper-left corner of the framing rectangle of this ellipse
+ * @param width {Number} The width of the ellipse
+ * @param height {Number} The height of the ellipse
*/
PIXI.Graphics.prototype.drawEllipse = function( x, y, width, height)
{
@@ -8246,6 +8726,13 @@ PIXI.Graphics.prototype.generateTexture = function()
return texture;
};
+/**
+* Renders the object using the WebGL renderer
+*
+* @method _renderWebGL
+* @param renderSession {RenderSession}
+* @private
+*/
PIXI.Graphics.prototype._renderWebGL = function(renderSession)
{
// if the sprite is not visible or the alpha is 0 then no need to render this element
@@ -8307,6 +8794,13 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession)
}
};
+/**
+* Renders the object using the Canvas renderer
+*
+* @method _renderCanvas
+* @param renderSession {RenderSession}
+* @private
+*/
PIXI.Graphics.prototype._renderCanvas = function(renderSession)
{
// if the sprite is not visible or the alpha is 0 then no need to render this element
@@ -8331,6 +8825,12 @@ PIXI.Graphics.prototype._renderCanvas = function(renderSession)
}
};
+/**
+ * Retrieves the bounds of the graphic shape as a rectangle object
+ *
+ * @method getBounds
+ * @return {Rectangle} the rectangular bounding area
+ */
PIXI.Graphics.prototype.getBounds = function()
{
if(!this.bounds)this.updateBounds();
@@ -8399,6 +8899,11 @@ PIXI.Graphics.prototype.getBounds = function()
return bounds;
};
+/**
+ * Update the bounds of the object
+ *
+ * @method updateBounds
+ */
PIXI.Graphics.prototype.updateBounds = function()
{
@@ -8463,6 +8968,13 @@ PIXI.Graphics.prototype.updateBounds = function()
this.bounds = new PIXI.Rectangle(minX - padding, minY - padding, (maxX - minX) + padding * 2, (maxY - minY) + padding * 2);
};
+
+/**
+ * Generates the cached sprite that was made using the generate TODO-Alvin
+ *
+ * @method _generateCachedSprite
+ * @private
+ */
PIXI.Graphics.prototype._generateCachedSprite = function()
{
var bounds = this.getBounds();
@@ -8509,12 +9021,20 @@ PIXI.Graphics.RECT = 1;
PIXI.Graphics.CIRC = 2;
PIXI.Graphics.ELIP = 3;
-PIXI.tempMatrix = PIXI.mat3.create();
-
/**
* @author Mat Groves http://matgroves.com/
*/
+ /**
+ *
+ * @class Strip
+ * @constructor
+ * @param texture {Texture} TODO-Alvin
+ * @param width {Number} the width of the TODO-Alvin
+ * @param height {Number} the height of the TODO-Alvin
+ *
+ */
+
PIXI.Strip = function(texture, width, height)
{
PIXI.DisplayObjectContainer.call( this );
@@ -8582,6 +9102,14 @@ PIXI.Strip = function(texture, width, height)
PIXI.Strip.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
PIXI.Strip.prototype.constructor = PIXI.Strip;
+/*
+ * Sets the texture that the Strip will use
+ * TODO-Alvin
+ *
+ * @method setTexture
+ * @param texture {Texture} the texture that will be used
+ * @private
+ */
PIXI.Strip.prototype.setTexture = function(texture)
{
//TODO SET THE TEXTURES
@@ -8594,16 +9122,30 @@ PIXI.Strip.prototype.setTexture = function(texture)
this.updateFrame = true;
};
+/**
+ * When the texture is updated, this event will fire to update the scale and frame
+ *
+ * @method onTextureUpdate
+ * @param event
+ * @private
+ */
PIXI.Strip.prototype.onTextureUpdate = function()
{
this.updateFrame = true;
};
// some helper functions..
-/**
- * @author Mat Groves http://matgroves.com/
+/* @author Mat Groves http://matgroves.com/ @Doormat23
*/
+/**
+ *
+ * @class Rope
+ * @constructor
+ * @param texture {Texture} TODO-Alvin
+ * @param y {Array} TODO-Alvin
+ *
+ */
PIXI.Rope = function(texture, points)
{
PIXI.Strip.call( this, texture );
@@ -8632,6 +9174,11 @@ PIXI.Rope = function(texture, points)
PIXI.Rope.prototype = Object.create( PIXI.Strip.prototype );
PIXI.Rope.prototype.constructor = PIXI.Rope;
+/*
+ * Refreshes TODO-Alvin
+ *
+ * @method refresh
+ */
PIXI.Rope.prototype.refresh = function()
{
var points = this.points;
@@ -8698,6 +9245,12 @@ PIXI.Rope.prototype.refresh = function()
}
};
+/*
+ * Updates the object transform for rendering
+ *
+ * @method updateTransform
+ * @private
+ */
PIXI.Rope.prototype.updateTransform = function()
{
@@ -8759,7 +9312,13 @@ PIXI.Rope.prototype.updateTransform = function()
PIXI.DisplayObjectContainer.prototype.updateTransform.call( this );
};
-
+/*
+ * Sets the texture that the Rope will use
+ * TODO-Alvin
+ *
+ * @method setTexture
+ * @param texture {Texture} the texture that will be used
+ */
PIXI.Rope.prototype.setTexture = function(texture)
{
// stop current texture
@@ -8785,7 +9344,19 @@ PIXI.TilingSprite = function(texture, width, height)
{
PIXI.Sprite.call( this, texture);
+ /**
+ * The with of the tiling sprite
+ *
+ * @property width
+ * @type Number
+ */
this.width = width || 100;
+ /**
+ * The height of the tiling sprite
+ *
+ * @property height
+ * @type Number
+ */
this.height = height || 100;
/**
@@ -8796,7 +9367,12 @@ PIXI.TilingSprite = function(texture, width, height)
*/
this.tileScale = new PIXI.Point(1,1);
-
+ /**
+ *
+ *
+ * @property tileScaleOffset
+ * @type Point
+ */
this.tileScaleOffset = new PIXI.Point(1,1);
/**
@@ -8809,7 +9385,22 @@ PIXI.TilingSprite = function(texture, width, height)
this.renderable = true;
+ /**
+ * The tint applied to the sprite. This is a hex value
+ *
+ * @property tint
+ * @type Number
+ * @default 0xFFFFFF
+ */
this.tint = 0xFFFFFF;
+
+ /**
+ * The blend mode to be applied to the sprite
+ *
+ * @property blendMode
+ * @type Number
+ * @default PIXI.blendModes.NORMAL;
+ */
this.blendMode = PIXI.blendModes.NORMAL;
};
@@ -8849,6 +9440,13 @@ Object.defineProperty(PIXI.TilingSprite.prototype, 'height', {
}
});
+/**
+ * When the texture is updated, this event will fire to update the scale and frame
+ *
+ * @method onTextureUpdate
+ * @param event
+ * @private
+ */
PIXI.TilingSprite.prototype.onTextureUpdate = function()
{
// so if _width is 0 then width was not set..
@@ -10734,6 +11332,8 @@ PIXI.BaseTexture.prototype.updateSourceImage = function(newSrc)
PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode)
{
var baseTexture = PIXI.BaseTextureCache[imageUrl];
+ crossorigin = !crossorigin;
+
if(!baseTexture)
{
// new Image() breaks tex loading in some versions of Chrome.
@@ -11269,7 +11869,12 @@ PIXI.AssetLoader = function(assetURLs, crossorigin)
// constructor
PIXI.AssetLoader.prototype.constructor = PIXI.AssetLoader;
-
+/**
+ * Given a filename, returns its extension, wil
+ *
+ * @method _getDataType
+ * @param str {String} the name of the asset
+ */
PIXI.AssetLoader.prototype._getDataType = function(str)
{
var test = 'data:';
@@ -11554,8 +12159,11 @@ PIXI.AtlasLoader = function (url, crossorigin) {
// constructor
PIXI.AtlasLoader.constructor = PIXI.AtlasLoader;
-/**
- * This will begin loading the JSON file
+
+ /**
+ * Starts loading the JSON file
+ *
+ * @method load
*/
PIXI.AtlasLoader.prototype.load = function () {
this.ajaxRequest = new PIXI.AjaxRequest();
@@ -11568,6 +12176,7 @@ PIXI.AtlasLoader.prototype.load = function () {
/**
* Invoke when JSON file is loaded
+ * @method onAtlasLoaded
* @private
*/
PIXI.AtlasLoader.prototype.onAtlasLoaded = function () {
@@ -11685,7 +12294,8 @@ PIXI.AtlasLoader.prototype.onAtlasLoaded = function () {
};
/**
- * Invoke when json file loaded
+ * Invoke when json file has loaded
+ * @method onLoaded
* @private
*/
PIXI.AtlasLoader.prototype.onLoaded = function () {
@@ -11703,6 +12313,7 @@ PIXI.AtlasLoader.prototype.onLoaded = function () {
/**
* Invoke when error occured
+ * @method onError
* @private
*/
PIXI.AtlasLoader.prototype.onError = function () {
@@ -11946,7 +12557,7 @@ PIXI.ImageLoader.prototype.loadFramedSpriteSheet = function(frameWidth, frameHei
PIXI.BitmapFontLoader = function(url, crossorigin)
{
/*
- * i use texture packer to load the assets..
+ * I use texture packer to load the assets..
* http://www.codeandweb.com/texturepacker
* make sure to set the format as 'JSON'
*/
@@ -12208,17 +12819,27 @@ PIXI.AbstractFilter = function(fragmentSrc, uniforms)
*/
this.passes = [this];
+ /**
+ * @property shaders
+ * @type Array an array of shaders
+ * @private
+ */
this.shaders = [];
this.dirty = true;
this.padding = 0;
/**
- @property uniforms
- @private
+ * @property uniforms
+ * @type object
+ * @private
*/
this.uniforms = uniforms || {};
-
+ /**
+ * @property fragmentSrc
+ * @type Array
+ * @private
+ */
this.fragmentSrc = fragmentSrc || [];
};
@@ -12230,7 +12851,7 @@ PIXI.AbstractFilter = function(fragmentSrc, uniforms)
*
* The AlphaMaskFilter class uses the pixel values from the specified texture (called the displacement map) to perform a displacement of an object.
* You can use this filter to apply all manor of crazy warping effects
- * Currently the r property of the texture is used offset the x and the g propery of the texture is used to offset the y.
+ * Currently the r property of the texture is used to offset the x and the g propery of the texture is used to offset the y.
* @class AlphaMaskFilter
* @contructor
* @param texture {Texture} The texture used for the displacemtent map * must be power of 2 texture at the moment
diff --git a/bin/pixi.js b/bin/pixi.js
index 78501ab..97c49bc 100644
--- a/bin/pixi.js
+++ b/bin/pixi.js
@@ -4,13 +4,13 @@
* Copyright (c) 2012, Mat Groves
* http://goodboydigital.com/
*
- * Compiled: 2014-01-24
+ * Compiled: 2014-01-27
*
* pixi.js is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license.php
*/
-(function(){function c(){return e.Matrix="undefined"!=typeof Float32Array?Float32Array:Array,e.Matrix}var d=this,e=e||{};e.WEBGL_RENDERER=0,e.CANVAS_RENDERER=1,e.VERSION="v1.4.4",e.blendModes={NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},e.scaleModes={DEFAULT:0,LINEAR:0,NEAREST:1},e.Point=function(a,b){this.x=a||0,this.y=b||0},e.Point.prototype.clone=function(){return new e.Point(this.x,this.y)},e.Point.prototype.constructor=e.Point,e.Point.prototype.set=function(a,b){this.x=a||0,this.y=b||(0!==b?this.x:0)},e.Rectangle=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},e.Rectangle.prototype.clone=function(){return new e.Rectangle(this.x,this.y,this.width,this.height)},e.Rectangle.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=this.x;if(a>=c&&a<=c+this.width){var d=this.y;if(b>=d&&b<=d+this.height)return!0}return!1},e.Rectangle.prototype.constructor=e.Rectangle,e.Polygon=function(a){if(a instanceof Array||(a=Array.prototype.slice.call(arguments)),"number"==typeof a[0]){for(var b=[],c=0,d=a.length;d>c;c+=2)b.push(new e.Point(a[c],a[c+1]));a=b}this.points=a},e.Polygon.prototype.clone=function(){for(var a=[],b=0;bb!=i>b&&(h-f)*(b-g)/(i-g)+f>a;j&&(c=!c)}return c},e.Polygon.prototype.constructor=e.Polygon,e.Circle=function(a,b,c){this.x=a||0,this.y=b||0,this.radius=c||0},e.Circle.prototype.clone=function(){return new e.Circle(this.x,this.y,this.radius)},e.Circle.prototype.contains=function(a,b){if(this.radius<=0)return!1;var c=this.x-a,d=this.y-b,e=this.radius*this.radius;return c*=c,d*=d,e>=c+d},e.Circle.prototype.constructor=e.Circle,e.Ellipse=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},e.Ellipse.prototype.clone=function(){return new e.Ellipse(this.x,this.y,this.width,this.height)},e.Ellipse.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=(a-this.x)/this.width-.5,d=(b-this.y)/this.height-.5;return c*=c,d*=d,.25>c+d},e.Ellipse.prototype.getBounds=function(){return new e.Rectangle(this.x,this.y,this.width,this.height)},e.Ellipse.prototype.constructor=e.Ellipse,c(),e.mat3={},e.mat3.create=function(){var a=new e.Matrix(9);return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},e.mat3.identity=function(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},e.mat4={},e.mat4.create=function(){var a=new e.Matrix(16);return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a},e.mat3.multiply=function(a,b,c){c||(c=a);var d=a[0],e=a[1],f=a[2],g=a[3],h=a[4],i=a[5],j=a[6],k=a[7],l=a[8],m=b[0],n=b[1],o=b[2],p=b[3],q=b[4],r=b[5],s=b[6],t=b[7],u=b[8];return c[0]=m*d+n*g+o*j,c[1]=m*e+n*h+o*k,c[2]=m*f+n*i+o*l,c[3]=p*d+q*g+r*j,c[4]=p*e+q*h+r*k,c[5]=p*f+q*i+r*l,c[6]=s*d+t*g+u*j,c[7]=s*e+t*h+u*k,c[8]=s*f+t*i+u*l,c},e.mat3.clone=function(a){var b=new e.Matrix(9);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b},e.mat3.transpose=function(a,b){if(!b||a===b){var c=a[1],d=a[2],e=a[5];return a[1]=a[3],a[2]=a[6],a[3]=c,a[5]=a[7],a[6]=d,a[7]=e,a}return b[0]=a[0],b[1]=a[3],b[2]=a[6],b[3]=a[1],b[4]=a[4],b[5]=a[7],b[6]=a[2],b[7]=a[5],b[8]=a[8],b},e.mat3.toMat4=function(a,b){return b||(b=e.mat4.create()),b[15]=1,b[14]=0,b[13]=0,b[12]=0,b[11]=0,b[10]=a[8],b[9]=a[7],b[8]=a[6],b[7]=0,b[6]=a[5],b[5]=a[4],b[4]=a[3],b[3]=0,b[2]=a[2],b[1]=a[1],b[0]=a[0],b},e.mat4.create=function(){var a=new e.Matrix(16);return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a},e.mat4.transpose=function(a,b){if(!b||a===b){var c=a[1],d=a[2],e=a[3],f=a[6],g=a[7],h=a[11];return a[1]=a[4],a[2]=a[8],a[3]=a[12],a[4]=c,a[6]=a[9],a[7]=a[13],a[8]=d,a[9]=f,a[11]=a[14],a[12]=e,a[13]=g,a[14]=h,a}return b[0]=a[0],b[1]=a[4],b[2]=a[8],b[3]=a[12],b[4]=a[1],b[5]=a[5],b[6]=a[9],b[7]=a[13],b[8]=a[2],b[9]=a[6],b[10]=a[10],b[11]=a[14],b[12]=a[3],b[13]=a[7],b[14]=a[11],b[15]=a[15],b},e.mat4.multiply=function(a,b,c){c||(c=a);var d=a[0],e=a[1],f=a[2],g=a[3],h=a[4],i=a[5],j=a[6],k=a[7],l=a[8],m=a[9],n=a[10],o=a[11],p=a[12],q=a[13],r=a[14],s=a[15],t=b[0],u=b[1],v=b[2],w=b[3];return c[0]=t*d+u*h+v*l+w*p,c[1]=t*e+u*i+v*m+w*q,c[2]=t*f+u*j+v*n+w*r,c[3]=t*g+u*k+v*o+w*s,t=b[4],u=b[5],v=b[6],w=b[7],c[4]=t*d+u*h+v*l+w*p,c[5]=t*e+u*i+v*m+w*q,c[6]=t*f+u*j+v*n+w*r,c[7]=t*g+u*k+v*o+w*s,t=b[8],u=b[9],v=b[10],w=b[11],c[8]=t*d+u*h+v*l+w*p,c[9]=t*e+u*i+v*m+w*q,c[10]=t*f+u*j+v*n+w*r,c[11]=t*g+u*k+v*o+w*s,t=b[12],u=b[13],v=b[14],w=b[15],c[12]=t*d+u*h+v*l+w*p,c[13]=t*e+u*i+v*m+w*q,c[14]=t*f+u*j+v*n+w*r,c[15]=t*g+u*k+v*o+w*s,c},e.identityMatrix=e.mat3.create(),e.DisplayObject=function(){this.last=this,this.first=this,this.position=new e.Point,this.scale=new e.Point(1,1),this.pivot=new e.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.hitArea=null,this.buttonMode=!1,this.renderable=!1,this.parent=null,this.stage=null,this.worldAlpha=1,this._interactive=!1,this.defaultCursor="pointer",this.worldTransform=e.mat3.create(),this.localTransform=e.mat3.create(),this.color=[],this.dynamic=!0,this._sr=0,this._cr=1,this.filterArea=new e.Rectangle(0,0,1,1),this._bounds=new e.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null},e.DisplayObject.prototype.constructor=e.DisplayObject,e.DisplayObject.prototype.setInteractive=function(a){this.interactive=a},Object.defineProperty(e.DisplayObject.prototype,"interactive",{get:function(){return this._interactive},set:function(a){this._interactive=a,this.stage&&(this.stage.dirty=!0)}}),Object.defineProperty(e.DisplayObject.prototype,"worldVisible",{get:function(){var a=this;do{if(!a.visible)return!1;a=a.parent}while(a);return!0}}),Object.defineProperty(e.DisplayObject.prototype,"mask",{get:function(){return this._mask},set:function(a){this._mask&&(this._mask.isMask=!1),this._mask=a,this._mask&&(this._mask.isMask=!0)}}),Object.defineProperty(e.DisplayObject.prototype,"filters",{get:function(){return this._filters},set:function(a){if(a){for(var b=[],c=0;c=0&&b<=this.children.length))throw new Error(a+" The index "+b+" supplied is out of bounds "+this.children.length);a.parent&&a.parent.removeChild(a),a.parent=this,this.children.splice(b,0,a),this.stage&&a.setStageReference(this.stage)},e.DisplayObjectContainer.prototype.swapChildren=function(a,b){if(a!==b){var c=this.children.indexOf(a),d=this.children.indexOf(b);if(0>c||0>d)throw new Error("swapChildren: Both the supplied DisplayObjects must be a child of the caller.");this.children[c]=b,this.children[d]=a}},e.DisplayObjectContainer.prototype.getChildAt=function(a){if(a>=0&&aa;a++)this.children[a].updateTransform()}},e.DisplayObjectContainer.prototype.getBounds=function(){if(0===this.children.length)return e.EmptyRectangle;for(var a,b,c,d=1/0,f=1/0,g=-1/0,h=-1/0,i=0,j=this.children.length;j>i;i++){var k=this.children[i];k.visible&&(a=this.children[i].getBounds(),d=db?g:b,h=h>c?h:c)}var l=this._bounds;return l.x=d,l.y=f,l.width=g-d,l.height=h-f,l},e.DisplayObjectContainer.prototype.setStageReference=function(a){this.stage=a,this._interactive&&(this.stage.dirty=!0);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d.setStageReference(a)}},e.DisplayObjectContainer.prototype.removeStageReference=function(){for(var a=0,b=this.children.length;b>a;a++){var c=this.children[a];c.removeStageReference()}this._interactive&&(this.stage.dirty=!0),this.stage=null},e.DisplayObjectContainer.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){var b,c;if(this._mask||this._filters){for(this._mask&&(a.spriteBatch.stop(),a.maskManager.pushMask(this.mask,a),a.spriteBatch.start()),this._filters&&(a.spriteBatch.flush(),a.filterManager.pushFilter(this._filterBlock)),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);a.spriteBatch.stop(),this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),a.spriteBatch.start()}else for(b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},e.DisplayObjectContainer.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){this._mask&&a.maskManager.pushMask(this._mask,a.context);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d._renderCanvas(a)}this._mask&&a.maskManager.popMask(a.context)}},e.Sprite=function(a){e.DisplayObjectContainer.call(this),this.anchor=new e.Point,this.texture=a,this._width=0,this._height=0,this.tint=16777215,this.blendMode=e.blendModes.NORMAL,a.baseTexture.hasLoaded?this.onTextureUpdate():(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},e.Sprite.prototype=Object.create(e.DisplayObjectContainer.prototype),e.Sprite.prototype.constructor=e.Sprite,Object.defineProperty(e.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(a){this.scale.x=a/this.texture.frame.width,this._width=a}}),Object.defineProperty(e.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(a){this.scale.y=a/this.texture.frame.height,this._height=a}}),e.Sprite.prototype.setTexture=function(a){this.texture.baseTexture!==a.baseTexture?(this.textureChange=!0,this.texture=a):this.texture=a,this.cachedTint=16777215,this.updateFrame=!0},e.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height),this.updateFrame=!0},e.Sprite.prototype.getBounds=function(){var a=this.texture.frame.width,b=this.texture.frame.height,c=a*(1-this.anchor.x),d=a*-this.anchor.x,e=b*(1-this.anchor.y),f=b*-this.anchor.y,g=this.worldTransform,h=g[0],i=g[3],j=g[1],k=g[4],l=g[2],m=g[5],n=h*d+j*f+l,o=k*f+i*d+m,p=h*c+j*f+l,q=k*f+i*c+m,r=h*c+j*e+l,s=k*e+i*c+m,t=h*d+j*e+l,u=k*e+i*d+m,v=-1/0,w=-1/0,x=1/0,y=1/0;x=x>n?n:x,x=x>p?p:x,x=x>r?r:x,x=x>t?t:x,y=y>o?o:y,y=y>q?q:y,y=y>s?s:y,y=y>u?u:y,v=n>v?n:v,v=p>v?p:v,v=r>v?r:v,v=t>v?t:v,w=o>w?o:w,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w;var z=this._bounds;return z.x=x,z.width=v-x,z.y=y,z.height=w-y,this._currentBounds=z,z},e.Sprite.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){var b,c;if(this._mask||this._filters){var d=a.spriteBatch;for(this._mask&&(d.stop(),a.maskManager.pushMask(this.mask,a),d.start()),this._filters&&(d.flush(),a.filterManager.pushFilter(this._filterBlock)),d.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);d.stop(),this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),d.start()}else for(a.spriteBatch.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},e.Sprite.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){var b=this.texture.frame,c=a.context,d=this.texture;if(this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=e.blendModesCanvas[a.currentBlendMode]),this._mask&&a.maskManager.pushMask(this._mask,a.context),b&&b.width&&b.height&&d.baseTexture.source){c.globalAlpha=this.worldAlpha;var f=this.worldTransform;if(c.setTransform(f[0],f[3],f[1],f[4],f[2],f[5]),a.smoothProperty&&a.scaleMode!==this.texture.baseTexture.scaleMode&&(a.scaleMode=this.texture.baseTexture.scaleMode,c[a.smoothProperty]=a.scaleMode===e.scaleModes.LINEAR),16777215!==this.tint){if(this.cachedTint!==this.tint){if(!d.baseTexture.hasLoaded)return;this.cachedTint=this.tint,this.tintedTexture=e.CanvasTinter.getTintedTexture(this,this.tint)}c.drawImage(this.tintedTexture,0,0,b.width,b.height,this.anchor.x*-b.width,this.anchor.y*-b.height,b.width,b.height)}else if(d.trimmed){var g=d.trim;c.drawImage(this.texture.baseTexture.source,b.x,b.y,b.width,b.height,g.x-this.anchor.x*g.realWidth,g.y-this.anchor.y*g.realHeight,b.width,b.height)}else c.drawImage(this.texture.baseTexture.source,b.x,b.y,b.width,b.height,this.anchor.x*-b.width,this.anchor.y*-b.height,b.width,b.height)}for(var h=0,i=this.children.length;i>h;h++){var j=this.children[h];j._renderCanvas(a)}this._mask&&a.maskManager.popMask(a.context)}},e.Sprite.fromFrame=function(a){var b=e.TextureCache[a];if(!b)throw new Error('The frameId "'+a+'" does not exist in the texture cache'+this);return new e.Sprite(b)},e.Sprite.fromImage=function(a){var b=e.Texture.fromImage(a);return new e.Sprite(b)},e.SpriteBatch=function(a){e.DisplayObjectContainer.call(this),this.textureThing=a,this.ready=!1},e.SpriteBatch.prototype=Object.create(e.DisplayObjectContainer.prototype),e.SpriteBatch.constructor=e.SpriteBatch,e.SpriteBatch.prototype.initWebGL=function(a){this.fastSpriteBatch=new e.WebGLFastSpriteBatch(a),this.ready=!0},e.SpriteBatch.prototype.updateTransform=function(){e.DisplayObject.prototype.updateTransform.call(this)},e.SpriteBatch.prototype._renderWebGL=function(a){!this.visible||this.alpha<=0||!this.children.length||(this.ready||this.initWebGL(a.gl),a.spriteBatch.stop(),a.shaderManager.activateShader(a.shaderManager.fastShader),this.fastSpriteBatch.begin(this,a),this.fastSpriteBatch.render(this),a.shaderManager.activateShader(a.shaderManager.defaultShader),a.spriteBatch.start())},e.SpriteBatch.prototype._renderCanvas=function(a){var b=a.context;b.globalAlpha=this.worldAlpha;var c=this.worldTransform;b.setTransform(c[0],c[3],c[1],c[4],c[2],c[5]),b.save();for(var d=0;d=this.textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())}},e.FilterBlock=function(){this.visible=!0,this.renderable=!0},e.Text=function(a,b){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),e.Sprite.call(this,e.Texture.fromCanvas(this.canvas)),this.setText(a),this.setStyle(b),this.updateText(),this.dirty=!1},e.Text.prototype=Object.create(e.Sprite.prototype),e.Text.prototype.constructor=e.Text,e.Text.prototype.setStyle=function(a){a=a||{},a.font=a.font||"bold 20pt Arial",a.fill=a.fill||"black",a.align=a.align||"left",a.stroke=a.stroke||"black",a.strokeThickness=a.strokeThickness||0,a.wordWrap=a.wordWrap||!1,a.wordWrapWidth=a.wordWrapWidth||100,this.style=a,this.dirty=!0},e.Text.prototype.setText=function(a){this.text=a.toString()||" ",this.dirty=!0},e.Text.prototype.updateText=function(){this.context.font=this.style.font;var a=this.text;this.style.wordWrap&&(a=this.wordWrap(this.text));for(var b=a.split(/(?:\r\n|\r|\n)/),c=[],d=0,f=0;fe?(g>0&&(b+="\n"),b+=f[g]+" ",e=this.style.wordWrapWidth-h):(e-=i,b+=f[g]+" ")}b+="\n"}return b},e.Text.prototype.destroy=function(a){a&&this.texture.destroy()},e.Text.heightCache={},e.BitmapText=function(a,b){e.DisplayObjectContainer.call(this),this.setText(a),this.setStyle(b),this.updateText(),this.dirty=!1},e.BitmapText.prototype=Object.create(e.DisplayObjectContainer.prototype),e.BitmapText.prototype.constructor=e.BitmapText,e.BitmapText.prototype.setText=function(a){this.text=a||" ",this.dirty=!0},e.BitmapText.prototype.setStyle=function(a){a=a||{},a.align=a.align||"left",this.style=a;var b=a.font.split(" ");this.fontName=b[b.length-1],this.fontSize=b.length>=2?parseInt(b[b.length-2],10):e.BitmapText.fonts[this.fontName].size,this.dirty=!0},e.BitmapText.prototype.updateText=function(){for(var a=e.BitmapText.fonts[this.fontName],b=new e.Point,c=null,d=[],f=0,g=[],h=0,i=this.fontSize/a.size,j=0;j=j;j++){var n=0;"right"===this.style.align?n=f-g[j]:"center"===this.style.align&&(n=(f-g[j])/2),m.push(n)}for(j=0;j0;)this.removeChild(this.getChildAt(0));this.updateText(),this.dirty=!1}e.DisplayObjectContainer.prototype.updateTransform.call(this)},e.BitmapText.fonts={},e.InteractionManager=function(a){this.stage=a,this.mouse=new e.InteractionData,this.touchs={},this.tempPoint=new e.Point,this.mouseoverEnabled=!0,this.pool=[],this.interactiveItems=[],this.interactionDOMElement=null,this.onMouseMove=this.onMouseMove.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.last=0},e.InteractionManager.prototype.constructor=e.InteractionManager,e.InteractionManager.prototype.collectInteractiveSprite=function(a,b){for(var c=a.children,d=c.length,e=d-1;e>=0;e--){var f=c[e];f.interactive?(b.interactiveChildren=!0,this.interactiveItems.push(f),f.children.length>0&&this.collectInteractiveSprite(f,f)):(f.__iParent=null,f.children.length>0&&this.collectInteractiveSprite(f,b))}},e.InteractionManager.prototype.setTarget=function(a){this.target=a,null===this.interactionDOMElement&&this.setTargetDomElement(a.view),document.body.addEventListener("mouseup",this.onMouseUp,!0)},e.InteractionManager.prototype.setTargetDomElement=function(a){null!==this.interactionDOMElement&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]="",this.interactionDOMElement.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0)),window.navigator.msPointerEnabled&&(a.style["-ms-content-zooming"]="none",a.style["-ms-touch-action"]="none"),this.interactionDOMElement=a,a.addEventListener("mousemove",this.onMouseMove,!0),a.addEventListener("mousedown",this.onMouseDown,!0),a.addEventListener("mouseout",this.onMouseOut,!0),a.addEventListener("touchstart",this.onTouchStart,!0),a.addEventListener("touchend",this.onTouchEnd,!0),a.addEventListener("touchmove",this.onTouchMove,!0)},e.InteractionManager.prototype.update=function(){if(this.target){var a=Date.now(),b=a-this.last;if(b=30*b/1e3,!(1>b)){this.last=a;var c=0;if(this.dirty){this.dirty=!1;var d=this.interactiveItems.length;for(c=0;d>c;c++)this.interactiveItems[c].interactiveChildren=!1;this.interactiveItems=[],this.stage.interactive&&this.interactiveItems.push(this.stage),this.collectInteractiveSprite(this.stage,this.stage)}var e=this.interactiveItems.length;this.interactionDOMElement.style.cursor="inherit";var f=!1;for(c=0;e>c;c++){var g=this.interactiveItems[c];g.__hit=this.hitTest(g,this.mouse),this.mouse.target=g,g.__hit&&!f?(g.buttonMode&&(this.interactionDOMElement.style.cursor=g.defaultCursor),g.interactiveChildren||(f=!0),g.__isOver||(g.mouseover&&g.mouseover(this.mouse),g.__isOver=!0)):g.__isOver&&(g.mouseout&&g.mouseout(this.mouse),g.__isOver=!1)}}}},e.InteractionManager.prototype.onMouseMove=function(a){this.mouse.originalEvent=a||window.event;var b=this.interactionDOMElement.getBoundingClientRect();this.mouse.global.x=(a.clientX-b.left)*(this.target.width/b.width),this.mouse.global.y=(a.clientY-b.top)*(this.target.height/b.height);for(var c=this.interactiveItems.length,d=0;c>d;d++){var e=this.interactiveItems[d];e.mousemove&&e.mousemove(this.mouse)}},e.InteractionManager.prototype.onMouseDown=function(a){this.mouse.originalEvent=a||window.event;for(var b=this.interactiveItems.length,c=0;b>c;c++){var d=this.interactiveItems[c];if((d.mousedown||d.click)&&(d.__mouseIsDown=!0,d.__hit=this.hitTest(d,this.mouse),d.__hit&&(d.mousedown&&d.mousedown(this.mouse),d.__isDown=!0,!d.interactiveChildren)))break}},e.InteractionManager.prototype.onMouseOut=function(){var a=this.interactiveItems.length;this.interactionDOMElement.style.cursor="inherit";for(var b=0;a>b;b++){var c=this.interactiveItems[b];c.__isOver&&(this.mouse.target=c,c.mouseout&&c.mouseout(this.mouse),c.__isOver=!1)}},e.InteractionManager.prototype.onMouseUp=function(a){this.mouse.originalEvent=a||window.event;for(var b=this.interactiveItems.length,c=!1,d=0;b>d;d++){var e=this.interactiveItems[d];e.__hit=this.hitTest(e,this.mouse),e.__hit&&!c?(e.mouseup&&e.mouseup(this.mouse),e.__isDown&&e.click&&e.click(this.mouse),e.interactiveChildren||(c=!0)):e.__isDown&&e.mouseupoutside&&e.mouseupoutside(this.mouse),e.__isDown=!1}},e.InteractionManager.prototype.hitTest=function(a,b){var c=b.global;if(!a.worldVisible)return!1;var d=a instanceof e.Sprite,f=a.worldTransform,g=f[0],h=f[1],i=f[2],j=f[3],k=f[4],l=f[5],m=1/(g*k+h*-j),n=k*m*c.x+-h*m*c.y+(l*h-i*k)*m,o=g*m*c.y+-j*m*c.x+(-l*g+i*j)*m;if(b.target=a,a.hitArea&&a.hitArea.contains)return a.hitArea.contains(n,o)?(b.target=a,!0):!1;if(d){var p,q=a.texture.frame.width,r=a.texture.frame.height,s=-q*a.anchor.x;if(n>s&&s+q>n&&(p=-r*a.anchor.y,o>p&&p+r>o))return b.target=a,!0}for(var t=a.children.length,u=0;t>u;u++){var v=a.children[u],w=this.hitTest(v,b);if(w)return b.target=a,!0}return!1},e.InteractionManager.prototype.onTouchMove=function(a){var b,c=this.interactionDOMElement.getBoundingClientRect(),d=a.changedTouches,e=0;for(e=0;ee;e++){var h=this.interactiveItems[e];h.touchmove&&h.touchmove(b)}},e.InteractionManager.prototype.onTouchStart=function(a){for(var b=this.interactionDOMElement.getBoundingClientRect(),c=a.changedTouches,d=0;di;i++){var j=this.interactiveItems[i];if((j.touchstart||j.tap)&&(j.__hit=this.hitTest(j,g),j.__hit&&(j.touchstart&&j.touchstart(g),j.__isDown=!0,j.__touchData=g,!j.interactiveChildren)))break}}},e.InteractionManager.prototype.onTouchEnd=function(a){for(var b=this.interactionDOMElement.getBoundingClientRect(),c=a.changedTouches,d=0;di;i++){var j=this.interactiveItems[i],k=j.__touchData;j.__hit=this.hitTest(j,f),k===f&&(f.originalEvent=a||window.event,(j.touchend||j.tap)&&(j.__hit&&!g?(j.touchend&&j.touchend(f),j.__isDown&&j.tap&&j.tap(f),j.interactiveChildren||(g=!0)):j.__isDown&&j.touchendoutside&&j.touchendoutside(f),j.__isDown=!1),j.__touchData=null)}this.pool.push(f),this.touchs[e.identifier]=null}},e.InteractionData=function(){this.global=new e.Point,this.local=new e.Point,this.target=null,this.originalEvent=null},e.InteractionData.prototype.getLocalPosition=function(a){var b=a.worldTransform,c=this.global,d=b[0],f=b[1],g=b[2],h=b[3],i=b[4],j=b[5],k=1/(d*i+f*-h);return new e.Point(i*k*c.x+-f*k*c.y+(j*f-g*i)*k,d*k*c.y+-h*k*c.x+(-j*d+g*h)*k)},e.InteractionData.prototype.constructor=e.InteractionData,e.Stage=function(a){e.DisplayObjectContainer.call(this),this.worldTransform=e.mat3.create(),this.interactive=!0,this.interactionManager=new e.InteractionManager(this),this.dirty=!0,this.stage=this,this.stage.hitArea=new e.Rectangle(0,0,1e5,1e5),this.setBackgroundColor(a)},e.Stage.prototype=Object.create(e.DisplayObjectContainer.prototype),e.Stage.prototype.constructor=e.Stage,e.Stage.prototype.setInteractionDelegate=function(a){this.interactionManager.setTargetDomElement(a)},e.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var a=0,b=this.children.length;b>a;a++)this.children[a].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},e.Stage.prototype.setBackgroundColor=function(a){this.backgroundColor=a||0,this.backgroundColorSplit=e.hex2rgb(this.backgroundColor);var b=this.backgroundColor.toString(16);b="000000".substr(0,6-b.length)+b,this.backgroundColorString="#"+b},e.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global};for(var f=0,h=["ms","moz","webkit","o"],i=0;i>16&255)/255,(a>>8&255)/255,(255&a)/255]},e.rgb2hex=function(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]},"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var a=Array.prototype.slice;return function(b){function c(){var f=e.concat(a.call(arguments));d.apply(this instanceof c?this:b,f)}var d=this,e=a.call(arguments,1);if("function"!=typeof d)throw new TypeError;return c.prototype=function f(a){return a&&(f.prototype=a),this instanceof f?void 0:new f}(d.prototype),c}}()),e.AjaxRequest=function(){var a=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new window.XMLHttpRequest:!1;for(var b=0;b0&&0===(a&a-1))return a;for(var b=1;a>b;)b<<=1;return b},e.EventTarget=function(){var a={};this.addEventListener=this.on=function(b,c){void 0===a[b]&&(a[b]=[]),-1===a[b].indexOf(c)&&a[b].push(c)},this.dispatchEvent=this.emit=function(b){if(a[b.type]&&a[b.type].length)for(var c=0,d=a[b.type].length;d>c;c++)a[b.type][c](b)},this.removeEventListener=this.off=function(b,c){var d=a[b].indexOf(c);-1!==d&&a[b].splice(d,1)},this.removeAllEventListeners=function(b){var c=a[b];c&&(c.length=0)}},e.autoDetectRenderer=function(a,b,c,d,f){a||(a=800),b||(b=600);var g=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}();return g?new e.WebGLRenderer(a,b,c,d,f):new e.CanvasRenderer(a,b,c,d)},e.PolyK={},e.PolyK.Triangulate=function(a){var b=!0,c=a.length>>1;if(3>c)return[];for(var d=[],f=[],g=0;c>g;g++)f.push(g);g=0;for(var h=c;h>3;){var i=f[(g+0)%h],j=f[(g+1)%h],k=f[(g+2)%h],l=a[2*i],m=a[2*i+1],n=a[2*j],o=a[2*j+1],p=a[2*k],q=a[2*k+1],r=!1;if(e.PolyK._convex(l,m,n,o,p,q,b)){r=!0;for(var s=0;h>s;s++){var t=f[s];if(t!==i&&t!==j&&t!==k&&e.PolyK._PointInTriangle(a[2*t],a[2*t+1],l,m,n,o,p,q)){r=!1;break}}}if(r)d.push(i,j,k),f.splice((g+1)%h,1),h--,g=0;else if(g++>3*h){if(!b)return window.console.log("PIXI Warning: shape too complex to fill"),[];for(d=[],f=[],g=0;c>g;g++)f.push(g);g=0,h=c,b=!1}}return d.push(f[0],f[1],f[2]),d},e.PolyK._PointInTriangle=function(a,b,c,d,e,f,g,h){var i=g-c,j=h-d,k=e-c,l=f-d,m=a-c,n=b-d,o=i*i+j*j,p=i*k+j*l,q=i*m+j*n,r=k*k+l*l,s=k*m+l*n,t=1/(o*r-p*p),u=(r*q-p*s)*t,v=(o*s-p*q)*t;return u>=0&&v>=0&&1>u+v},e.PolyK._convex=function(a,b,c,d,e,f,g){return(b-d)*(e-c)+(c-a)*(f-d)>=0===g},e.initDefaultShaders=function(){},e.CompileVertexShader=function(a,b){return e._CompileShader(a,b,a.VERTEX_SHADER)},e.CompileFragmentShader=function(a,b){return e._CompileShader(a,b,a.FRAGMENT_SHADER)},e._CompileShader=function(a,b,c){var d=b.join("\n"),e=a.createShader(c);return a.shaderSource(e,d),a.compileShader(e),a.getShaderParameter(e,a.COMPILE_STATUS)?e:(window.console.log(a.getShaderInfoLog(e)),null)},e.compileProgram=function(a,b,c){var d=e.CompileFragmentShader(a,c),f=e.CompileVertexShader(a,b),g=a.createProgram();return a.attachShader(g,f),a.attachShader(g,d),a.linkProgram(g),a.getProgramParameter(g,a.LINK_STATUS)||window.console.log("Could not initialise shaders"),g},e.PixiShader=function(a){this.gl=a,this.program=null,this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"],this.textureCount=0,this.attributes=[],this.init()},e.PixiShader.prototype.init=function(){var a=this.gl,b=e.compileProgram(a,this.vertexSrc||e.PixiShader.defaultVertexSrc,this.fragmentSrc);a.useProgram(b),this.uSampler=a.getUniformLocation(b,"uSampler"),this.projectionVector=a.getUniformLocation(b,"projectionVector"),this.offsetVector=a.getUniformLocation(b,"offsetVector"),this.dimensions=a.getUniformLocation(b,"dimensions"),this.aVertexPosition=a.getAttribLocation(b,"aVertexPosition"),this.aTextureCoord=a.getAttribLocation(b,"aTextureCoord"),this.colorAttribute=a.getAttribLocation(b,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aTextureCoord,this.colorAttribute];for(var c in this.uniforms)this.uniforms[c].uniformLocation=a.getUniformLocation(b,c);this.initUniforms(),this.program=b},e.PixiShader.prototype.initUniforms=function(){this.textureCount=1;var a,b=this.gl;for(var c in this.uniforms){a=this.uniforms[c];var d=a.type;"sampler2D"===d?(a._init=!1,null!==a.value&&this.initSampler2D(a)):"mat2"===d||"mat3"===d||"mat4"===d?(a.glMatrix=!0,a.glValueLength=1,"mat2"===d?a.glFunc=b.uniformMatrix2fv:"mat3"===d?a.glFunc=b.uniformMatrix3fv:"mat4"===d&&(a.glFunc=b.uniformMatrix4fv)):(a.glFunc=b["uniform"+d],a.glValueLength="2f"===d||"2i"===d?2:"3f"===d||"3i"===d?3:"4f"===d||"4i"===d?4:1)}},e.PixiShader.prototype.initSampler2D=function(a){if(a.value&&a.value.baseTexture&&a.value.baseTexture.hasLoaded){var b=this.gl;if(b.activeTexture(b["TEXTURE"+this.textureCount]),b.bindTexture(b.TEXTURE_2D,a.value.baseTexture._glTexture),a.textureData){var c=a.textureData,d=c.magFilter?c.magFilter:b.LINEAR,e=c.minFilter?c.minFilter:b.LINEAR,f=c.wrapS?c.wrapS:b.CLAMP_TO_EDGE,g=c.wrapT?c.wrapT:b.CLAMP_TO_EDGE,h=c.luminance?b.LUMINANCE:b.RGBA;if(c.repeat&&(f=b.REPEAT,g=b.REPEAT),b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1),c.width){var i=c.width?c.width:512,j=c.height?c.height:2,k=c.border?c.border:0;b.texImage2D(b.TEXTURE_2D,0,h,i,j,k,h,b.UNSIGNED_BYTE,null)}else b.texImage2D(b.TEXTURE_2D,0,h,b.RGBA,b.UNSIGNED_BYTE,a.value.baseTexture.source);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,d),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,e),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,f),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,g)}b.uniform1i(a.uniformLocation,this.textureCount),a._init=!0,this.textureCount++}},e.PixiShader.prototype.syncUniforms=function(){this.textureCount=1;var a,b=this.gl;for(var c in this.uniforms)a=this.uniforms[c],1===a.glValueLength?a.glMatrix===!0?a.glFunc.call(b,a.uniformLocation,a.transpose,a.value):a.glFunc.call(b,a.uniformLocation,a.value):2===a.glValueLength?a.glFunc.call(b,a.uniformLocation,a.value.x,a.value.y):3===a.glValueLength?a.glFunc.call(b,a.uniformLocation,a.value.x,a.value.y,a.value.z):4===a.glValueLength?a.glFunc.call(b,a.uniformLocation,a.value.x,a.value.y,a.value.z,a.value.w):"sampler2D"===a.type&&(a._init?(b.activeTexture(b["TEXTURE"+this.textureCount]),b.bindTexture(b.TEXTURE_2D,a.value.baseTexture._glTextures[b.id]||e.createWebGLTexture(a.value.baseTexture,b)),b.uniform1i(a.uniformLocation,this.textureCount),this.textureCount++):this.initSampler2D(a))},e.PixiShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},e.PixiShader.defaultVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec2 aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","varying vec2 vTextureCoord;","varying vec4 vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;"," vColor = vec4(color * aColor.x, aColor.x);","}"],e.PixiFastShader=function(a){this.gl=a,this.program=null,this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform mat3 uMatrix;","varying vec2 vTextureCoord;","varying float vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," vec2 v;"," vec2 sv = aVertexPosition * aScale;"," v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);"," v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);"," v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;"," gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"],this.textureCount=0,this.init()},e.PixiFastShader.prototype.init=function(){var a=this.gl,b=e.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(b),this.uSampler=a.getUniformLocation(b,"uSampler"),this.projectionVector=a.getUniformLocation(b,"projectionVector"),this.offsetVector=a.getUniformLocation(b,"offsetVector"),this.dimensions=a.getUniformLocation(b,"dimensions"),this.uMatrix=a.getUniformLocation(b,"uMatrix"),this.aVertexPosition=a.getAttribLocation(b,"aVertexPosition"),this.aPositionCoord=a.getAttribLocation(b,"aPositionCoord"),this.aScale=a.getAttribLocation(b,"aScale"),this.aRotation=a.getAttribLocation(b,"aRotation"),this.aTextureCoord=a.getAttribLocation(b,"aTextureCoord"),this.colorAttribute=a.getAttribLocation(b,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aPositionCoord,this.aScale,this.aRotation,this.aTextureCoord,this.colorAttribute],this.program=b},e.PixiFastShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},e.StripShader=function(){this.program=null,this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform float alpha;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));"," gl_FragColor = gl_FragColor * alpha;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","varying vec2 vTextureCoord;","uniform vec2 offsetVector;","varying float vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / projectionVector.y + 1.0 , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"]},e.StripShader.prototype.init=function(){var a=e.gl,b=e.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(b),this.uSampler=a.getUniformLocation(b,"uSampler"),this.projectionVector=a.getUniformLocation(b,"projectionVector"),this.offsetVector=a.getUniformLocation(b,"offsetVector"),this.colorAttribute=a.getAttribLocation(b,"aColor"),this.aVertexPosition=a.getAttribLocation(b,"aVertexPosition"),this.aTextureCoord=a.getAttribLocation(b,"aTextureCoord"),this.translationMatrix=a.getUniformLocation(b,"translationMatrix"),this.alpha=a.getUniformLocation(b,"alpha"),this.program=b},e.PrimitiveShader=function(a){this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {"," gl_FragColor = vColor;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform float alpha;","uniform vec3 tint;","varying vec4 vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"],this.init()},e.PrimitiveShader.prototype.init=function(){var a=this.gl,b=e.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(b),this.projectionVector=a.getUniformLocation(b,"projectionVector"),this.offsetVector=a.getUniformLocation(b,"offsetVector"),this.tintColor=a.getUniformLocation(b,"tint"),this.aVertexPosition=a.getAttribLocation(b,"aVertexPosition"),this.colorAttribute=a.getAttribLocation(b,"aColor"),this.attributes=[this.aVertexPosition,this.colorAttribute],this.translationMatrix=a.getUniformLocation(b,"translationMatrix"),this.alpha=a.getUniformLocation(b,"alpha"),this.program=b},e.PrimitiveShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attribute=null},e.WebGLGraphics=function(){},e.WebGLGraphics.renderGraphics=function(a,b){var c=b.gl,d=b.projection,f=b.offset,g=b.shaderManager.primitiveShader;a._webGL[c.id]||(a._webGL[c.id]={points:[],indices:[],lastIndex:0,buffer:c.createBuffer(),indexBuffer:c.createBuffer()});var h=a._webGL[c.id];a.dirty&&(a.dirty=!1,a.clearDirty&&(a.clearDirty=!1,h.lastIndex=0,h.points=[],h.indices=[]),e.WebGLGraphics.updateGraphics(a,c)),b.shaderManager.activatePrimitiveShader(),e.mat3.transpose(a.worldTransform,e.tempMatrix),c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA),c.uniformMatrix3fv(g.translationMatrix,!1,e.tempMatrix),c.uniform2f(g.projectionVector,d.x,-d.y),c.uniform2f(g.offsetVector,-f.x,-f.y),c.uniform3fv(g.tintColor,e.hex2rgb(a.tint)),c.uniform1f(g.alpha,a.worldAlpha),c.bindBuffer(c.ARRAY_BUFFER,h.buffer),c.vertexAttribPointer(g.aVertexPosition,2,c.FLOAT,!1,24,0),c.vertexAttribPointer(g.colorAttribute,4,c.FLOAT,!1,24,8),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,h.indexBuffer),c.drawElements(c.TRIANGLE_STRIP,h.indices.length,c.UNSIGNED_SHORT,0),b.shaderManager.deactivatePrimitiveShader()},e.WebGLGraphics.updateGraphics=function(a,b){for(var c=a._webGL[b.id],d=c.lastIndex;d3&&e.WebGLGraphics.buildPoly(f,c),f.lineWidth>0&&e.WebGLGraphics.buildLine(f,c)):f.type===e.Graphics.RECT?e.WebGLGraphics.buildRectangle(f,c):(f.type===e.Graphics.CIRC||f.type===e.Graphics.ELIP)&&e.WebGLGraphics.buildCircle(f,c)}c.lastIndex=a.graphicsData.length,c.glPoints=new Float32Array(c.points),b.bindBuffer(b.ARRAY_BUFFER,c.buffer),b.bufferData(b.ARRAY_BUFFER,c.glPoints,b.STATIC_DRAW),c.glIndicies=new Uint16Array(c.indices),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,c.indexBuffer),b.bufferData(b.ELEMENT_ARRAY_BUFFER,c.glIndicies,b.STATIC_DRAW)},e.WebGLGraphics.buildRectangle=function(a,b){var c=a.points,d=c[0],f=c[1],g=c[2],h=c[3];if(a.fill){var i=e.hex2rgb(a.fillColor),j=a.fillAlpha,k=i[0]*j,l=i[1]*j,m=i[2]*j,n=b.points,o=b.indices,p=n.length/6;n.push(d,f),n.push(k,l,m,j),n.push(d+g,f),n.push(k,l,m,j),n.push(d,f+h),n.push(k,l,m,j),n.push(d+g,f+h),n.push(k,l,m,j),o.push(p,p,p+1,p+2,p+3,p+3)}if(a.lineWidth){var q=a.points;a.points=[d,f,d+g,f,d+g,f+h,d,f+h,d,f],e.WebGLGraphics.buildLine(a,b),a.points=q}},e.WebGLGraphics.buildCircle=function(a,b){var c=a.points,d=c[0],f=c[1],g=c[2],h=c[3],i=40,j=2*Math.PI/i,k=0;if(a.fill){var l=e.hex2rgb(a.fillColor),m=a.fillAlpha,n=l[0]*m,o=l[1]*m,p=l[2]*m,q=b.points,r=b.indices,s=q.length/6;for(r.push(s),k=0;i+1>k;k++)q.push(d,f,n,o,p,m),q.push(d+Math.sin(j*k)*g,f+Math.cos(j*k)*h,n,o,p,m),r.push(s++,s++);r.push(s-1)}if(a.lineWidth){var t=a.points;for(a.points=[],k=0;i+1>k;k++)a.points.push(d+Math.sin(j*k)*g,f+Math.cos(j*k)*h);e.WebGLGraphics.buildLine(a,b),a.points=t}},e.WebGLGraphics.buildLine=function(a,b){var c=0,d=a.points;if(0!==d.length){if(a.lineWidth%2)for(c=0;cc;c++)l=d[2*(c-1)],m=d[2*(c-1)+1],n=d[2*c],o=d[2*c+1],p=d[2*(c+1)],q=d[2*(c+1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,t=-(o-q),u=n-p,F=Math.sqrt(t*t+u*u),t/=F,u/=F,t*=L,u*=L,x=-s+m-(-s+o),y=-r+n-(-r+l),z=(-r+l)*(-s+o)-(-r+n)*(-s+m),A=-u+q-(-u+o),B=-t+n-(-t+p),C=(-t+p)*(-u+o)-(-t+n)*(-u+q),D=x*B-A*y,Math.abs(D)<.1?(D+=10.1,G.push(n-r,o-s,O,P,Q,N),G.push(n+r,o+s,O,P,Q,N)):(j=(y*C-B*z)/D,k=(A*z-x*C)/D,E=(j-n)*(j-n)+(k-o)+(k-o),E>19600?(v=r-t,w=s-u,F=Math.sqrt(v*v+w*w),v/=F,w/=F,v*=L,w*=L,G.push(n-v,o-w),G.push(O,P,Q,N),G.push(n+v,o+w),G.push(O,P,Q,N),G.push(n-v,o-w),G.push(O,P,Q,N),J++):(G.push(j,k),G.push(O,P,Q,N),G.push(n-(j-n),o-(k-o)),G.push(O,P,Q,N)));for(l=d[2*(I-2)],m=d[2*(I-2)+1],n=d[2*(I-1)],o=d[2*(I-1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,G.push(n-r,o-s),G.push(O,P,Q,N),G.push(n+r,o+s),G.push(O,P,Q,N),H.push(K),c=0;J>c;c++)H.push(K++);H.push(K-1)}},e.WebGLGraphics.buildPoly=function(a,b){var c=a.points;if(!(c.length<6)){var d=b.points,f=b.indices,g=c.length/2,h=e.hex2rgb(a.fillColor),i=a.fillAlpha,j=h[0]*i,k=h[1]*i,l=h[2]*i,m=e.PolyK.Triangulate(c),n=d.length/6,o=0;for(o=0;oo;o++)d.push(c[2*o],c[2*o+1],j,k,l,i)}},e.glContexts=[],e.WebGLRenderer=function(a,b,c,d,f){e.defaultRenderer||(e.defaultRenderer=this),this.type=e.WEBGL_RENDERER,this.transparent=!!d,this.width=a||800,this.height=b||600,this.view=c||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height,this.contextLost=this.handleContextLost.bind(this),this.contextRestoredLost=this.handleContextRestored.bind(this),this.view.addEventListener("webglcontextlost",this.contextLost,!1),this.view.addEventListener("webglcontextrestored",this.contextRestoredLost,!1),this.options={alpha:this.transparent,antialias:!!f,premultipliedAlpha:!!d,stencil:!0};try{this.gl=this.view.getContext("experimental-webgl",this.options)}catch(g){try{this.gl=this.view.getContext("webgl",this.options)}catch(h){throw new Error(" This browser does not support webGL. Try using the canvas renderer"+this)}}var i=this.gl;this.glContextId=i.id=e.WebGLRenderer.glContextId++,e.glContexts[this.glContextId]=i,e.blendModesWebGL||(e.blendModesWebGL=[],e.blendModesWebGL[e.blendModes.NORMAL]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e.blendModesWebGL[e.blendModes.ADD]=[i.SRC_ALPHA,i.DST_ALPHA],e.blendModesWebGL[e.blendModes.MULTIPLY]=[i.DST_COLOR,i.ONE_MINUS_SRC_ALPHA],e.blendModesWebGL[e.blendModes.SCREEN]=[i.SRC_ALPHA,i.ONE],e.blendModesWebGL[e.blendModes.OVERLAY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e.blendModesWebGL[e.blendModes.DARKEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e.blendModesWebGL[e.blendModes.LIGHTEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e.blendModesWebGL[e.blendModes.COLOR_DODGE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e.blendModesWebGL[e.blendModes.COLOR_BURN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e.blendModesWebGL[e.blendModes.HARD_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e.blendModesWebGL[e.blendModes.SOFT_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e.blendModesWebGL[e.blendModes.DIFFERENCE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e.blendModesWebGL[e.blendModes.EXCLUSION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e.blendModesWebGL[e.blendModes.HUE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e.blendModesWebGL[e.blendModes.SATURATION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e.blendModesWebGL[e.blendModes.COLOR]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],e.blendModesWebGL[e.blendModes.LUMINOSITY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA]),this.projection=new e.Point,this.projection.x=this.width/2,this.projection.y=-this.height/2,this.offset=new e.Point(0,0),this.resize(this.width,this.height),this.contextLost=!1,this.shaderManager=new e.WebGLShaderManager(i),this.spriteBatch=new e.WebGLSpriteBatch(i),this.maskManager=new e.WebGLMaskManager(i),this.filterManager=new e.WebGLFilterManager(i,this.transparent),this.renderSession={},this.renderSession.gl=this.gl,this.renderSession.drawCount=0,this.renderSession.shaderManager=this.shaderManager,this.renderSession.maskManager=this.maskManager,this.renderSession.filterManager=this.filterManager,this.renderSession.spriteBatch=this.spriteBatch,i.useProgram(this.shaderManager.defaultShader.program),i.disable(i.DEPTH_TEST),i.disable(i.CULL_FACE),i.enable(i.BLEND),i.colorMask(!0,!0,!0,this.transparent)},e.WebGLRenderer.prototype.constructor=e.WebGLRenderer,e.WebGLRenderer.prototype.render=function(a){if(!this.contextLost){this.__stage!==a&&(this.__stage=a),e.WebGLRenderer.updateTextures(),a.updateTransform();var b=this.gl;b.viewport(0,0,this.width,this.height),b.bindFramebuffer(b.FRAMEBUFFER,null),this.transparent?b.clearColor(0,0,0,0):b.clearColor(a.backgroundColorSplit[0],a.backgroundColorSplit[1],a.backgroundColorSplit[2],1),b.clear(b.COLOR_BUFFER_BIT),this.renderDisplayObject(a,this.projection),a.interactive&&(a._interactiveEventsAdded||(a._interactiveEventsAdded=!0,a.interactionManager.setTarget(this)))}},e.WebGLRenderer.prototype.renderDisplayObject=function(a,b,c){this.renderSession.drawCount=0,this.renderSession.currentBlendMode=9999,this.renderSession.projection=b,this.renderSession.offset=this.offset,this.spriteBatch.begin(this.renderSession),this.filterManager.begin(this.renderSession,c),a._renderWebGL(this.renderSession),this.spriteBatch.end()},e.WebGLRenderer.updateTextures=function(){var a=0;for(a=0;a=0;b--){var c=a._glTextures[b],d=e.glContexts[b];d&&c&&d.deleteTexture(c)}a._glTextures.length=0},e.WebGLRenderer.updateTextureFrame=function(a){a.updateFrame=!1,a._updateWebGLuvs()},e.WebGLRenderer.prototype.resize=function(a,b){this.width=a,this.height=b,this.view.width=a,this.view.height=b,this.gl.viewport(0,0,this.width,this.height),this.projection.x=this.width/2,this.projection.y=-this.height/2},e.createWebGLTexture=function(a,b){return a.hasLoaded&&(a._glTextures[b.id]=b.createTexture(),b.bindTexture(b.TEXTURE_2D,a._glTextures[b.id]),b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,a.source),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,a.scaleMode===e.scaleModes.LINEAR?b.LINEAR:b.NEAREST),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,a.scaleMode===e.scaleModes.LINEAR?b.LINEAR:b.NEAREST),a._powerOf2?(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.REPEAT),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.REPEAT)):(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE)),b.bindTexture(b.TEXTURE_2D,null)),a._glTextures[b.id]},e.updateWebGLTexture=function(a,b){a._glTextures[b.id]&&(b.bindTexture(b.TEXTURE_2D,a._glTextures[b.id]),b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,a.source),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,a.scaleMode===e.scaleModes.LINEAR?b.LINEAR:b.NEAREST),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,a.scaleMode===e.scaleModes.LINEAR?b.LINEAR:b.NEAREST),a._powerOf2?(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.REPEAT),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.REPEAT)):(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE)),b.bindTexture(b.TEXTURE_2D,null))},e.WebGLRenderer.prototype.handleContextLost=function(a){a.preventDefault(),this.contextLost=!0},e.WebGLRenderer.prototype.handleContextRestored=function(){try{this.gl=this.view.getContext("experimental-webgl",this.options)}catch(a){try{this.gl=this.view.getContext("webgl",this.options)}catch(b){throw new Error(" This browser does not support webGL. Try using the canvas renderer"+this)}}var c=this.gl;c.id=e.WebGLRenderer.glContextId++,this.shaderManager.setContext(c),this.spriteBatch.setContext(c),this.maskManager.setContext(c),this.filterManager.setContext(c),this.renderSession.gl=this.gl,c.disable(c.DEPTH_TEST),c.disable(c.CULL_FACE),c.enable(c.BLEND),c.colorMask(!0,!0,!0,this.transparent),this.gl.viewport(0,0,this.width,this.height);for(var d in e.TextureCache){var f=e.TextureCache[d].baseTexture;f._glTextures=[]}this.contextLost=!1},e.WebGLRenderer.prototype.destroy=function(){this.view.removeEventListener("webglcontextlost",this.contextLost),this.view.removeEventListener("webglcontextrestored",this.contextRestoredLost),e.glContexts[this.glContextId]=null,this.projection=null,this.offset=null,this.shaderManager.destroy(),this.spriteBatch.destroy(),this.maskManager.destroy(),this.filterManager.destroy(),this.shaderManager=null,this.spriteBatch=null,this.maskManager=null,this.filterManager=null,this.gl=null,this.renderSession=null},e.WebGLRenderer.glContextId=0,e.WebGLMaskManager=function(a){this.maskStack=[],this.maskPosition=0,this.setContext(a)},e.WebGLMaskManager.prototype.setContext=function(a){this.gl=a},e.WebGLMaskManager.prototype.pushMask=function(a,b){var c=this.gl;0===this.maskStack.length&&(c.enable(c.STENCIL_TEST),c.stencilFunc(c.ALWAYS,1,1)),this.maskStack.push(a),c.colorMask(!1,!1,!1,!0),c.stencilOp(c.KEEP,c.KEEP,c.INCR),e.WebGLGraphics.renderGraphics(a,b),c.colorMask(!0,!0,!0,!0),c.stencilFunc(c.NOTEQUAL,0,this.maskStack.length),c.stencilOp(c.KEEP,c.KEEP,c.KEEP)},e.WebGLMaskManager.prototype.popMask=function(a){var b=this.gl,c=this.maskStack.pop();c&&(b.colorMask(!1,!1,!1,!1),b.stencilOp(b.KEEP,b.KEEP,b.DECR),e.WebGLGraphics.renderGraphics(c,a),b.colorMask(!0,!0,!0,!0),b.stencilFunc(b.NOTEQUAL,0,this.maskStack.length),b.stencilOp(b.KEEP,b.KEEP,b.KEEP)),0===this.maskStack.length&&b.disable(b.STENCIL_TEST)},e.WebGLMaskManager.prototype.destroy=function(){this.maskStack=null,this.gl=null},e.WebGLShaderManager=function(a){this.maxAttibs=10,this.attribState=[],this.tempAttribState=[];for(var b=0;bd;d+=6,e+=4)this.indices[d+0]=e+0,this.indices[d+1]=e+1,this.indices[d+2]=e+2,this.indices[d+3]=e+0,this.indices[d+4]=e+2,this.indices[d+5]=e+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.setContext(a)},e.WebGLSpriteBatch.prototype.setContext=function(a){this.gl=a,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW),this.currentBlendMode=99999},e.WebGLSpriteBatch.prototype.begin=function(a){this.renderSession=a,this.shader=this.renderSession.shaderManager.defaultShader,this.start()},e.WebGLSpriteBatch.prototype.end=function(){this.flush()},e.WebGLSpriteBatch.prototype.render=function(a){(a.texture.baseTexture!==this.currentBaseTexture||this.currentBatchSize>=this.size)&&(this.flush(),this.currentBaseTexture=a.texture.baseTexture),a.blendMode!==this.currentBlendMode&&this.setBlendMode(a.blendMode);var b=a._uvs||a.texture._uvs;if(b){var c,d,e,f,g=a.worldAlpha,h=a.tint,i=this.vertices,j=a.texture.frame.width,k=a.texture.frame.height,l=a.anchor.x,m=a.anchor.y;if(a.texture.trimmed){var n=a.texture.trim;d=n.x-l*n.realWidth,c=d+j,f=n.y-m*n.realHeight,e=f+k}else c=j*(1-l),d=j*-l,e=k*(1-m),f=k*-m;var o=4*this.currentBatchSize*this.vertSize,p=a.worldTransform,q=p[0],r=p[3],s=p[1],t=p[4],u=p[2],v=p[5];i[o++]=q*d+s*f+u,i[o++]=t*f+r*d+v,i[o++]=b[0],i[o++]=b[1],i[o++]=g,i[o++]=h,i[o++]=q*c+s*f+u,i[o++]=t*f+r*c+v,i[o++]=b[2],i[o++]=b[3],i[o++]=g,i[o++]=h,i[o++]=q*c+s*e+u,i[o++]=t*e+r*c+v,i[o++]=b[4],i[o++]=b[5],i[o++]=g,i[o++]=h,i[o++]=q*d+s*e+u,i[o++]=t*e+r*d+v,i[o++]=b[6],i[o++]=b[7],i[o++]=g,i[o++]=h,this.currentBatchSize++}},e.WebGLSpriteBatch.prototype.renderTilingSprite=function(a){var b=a.tilingTexture;(b.baseTexture!==this.currentBaseTexture||this.currentBatchSize>=this.size)&&(this.flush(),this.currentBaseTexture=b.baseTexture),a.blendMode!==this.currentBlendMode&&this.setBlendMode(a.blendMode),a._uvs||(a._uvs=new Float32Array(8));var c=a._uvs,d=a.tilePosition.x/b.baseTexture.width,e=a.tilePosition.y/b.baseTexture.height,f=a.width/b.baseTexture.width/(a.tileScale.x*a.tileScaleOffset.x),g=a.height/b.baseTexture.height/(a.tileScale.y*a.tileScaleOffset.y);c[0]=0-d,c[1]=0-e,c[2]=1*f-d,c[3]=0-e,c[4]=1*f-d,c[5]=1*g-e,c[6]=0-d,c[7]=1*g-e;var h=a.worldAlpha,i=a.tint,j=this.vertices,k=a.width,l=a.height,m=a.anchor.x,n=a.anchor.y,o=k*(1-m),p=k*-m,q=l*(1-n),r=l*-n,s=4*this.currentBatchSize*this.vertSize,t=a.worldTransform,u=t[0],v=t[3],w=t[1],x=t[4],y=t[2],z=t[5];j[s++]=u*p+w*r+y,j[s++]=x*r+v*p+z,j[s++]=c[0],j[s++]=c[1],j[s++]=h,j[s++]=i,j[s++]=u*o+w*r+y,j[s++]=x*r+v*o+z,j[s++]=c[2],j[s++]=c[3],j[s++]=h,j[s++]=i,j[s++]=u*o+w*q+y,j[s++]=x*q+v*o+z,j[s++]=c[4],j[s++]=c[5],j[s++]=h,j[s++]=i,j[s++]=u*p+w*q+y,j[s++]=x*q+v*p+z,j[s++]=c[6],j[s++]=c[7],j[s++]=h,j[s++]=i,this.currentBatchSize++},e.WebGLSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a=this.gl;if(a.bindTexture(a.TEXTURE_2D,this.currentBaseTexture._glTextures[a.id]||e.createWebGLTexture(this.currentBaseTexture,a)),this.currentBatchSize>.5*this.size)a.bufferSubData(a.ARRAY_BUFFER,0,this.vertices);else{var b=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);a.bufferSubData(a.ARRAY_BUFFER,0,b)}a.drawElements(a.TRIANGLES,6*this.currentBatchSize,a.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}},e.WebGLSpriteBatch.prototype.stop=function(){this.flush()},e.WebGLSpriteBatch.prototype.start=function(){var a=this.gl;a.activeTexture(a.TEXTURE0),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var b=this.renderSession.projection;a.uniform2f(this.shader.projectionVector,b.x,b.y);var c=4*this.vertSize;a.vertexAttribPointer(this.shader.aVertexPosition,2,a.FLOAT,!1,c,0),a.vertexAttribPointer(this.shader.aTextureCoord,2,a.FLOAT,!1,c,8),a.vertexAttribPointer(this.shader.colorAttribute,2,a.FLOAT,!1,c,16),this.currentBlendMode!==e.blendModes.NORMAL&&this.setBlendMode(e.blendModes.NORMAL)
-},e.WebGLSpriteBatch.prototype.setBlendMode=function(a){this.flush(),this.currentBlendMode=a;var b=e.blendModesWebGL[this.currentBlendMode];this.gl.blendFunc(b[0],b[1])},e.WebGLSpriteBatch.prototype.destroy=function(){this.vertices=null,this.indices=null,this.gl.deleteBuffer(this.vertexBuffer),this.gl.deleteBuffer(this.indexBuffer),this.currentBaseTexture=null,this.gl=null},e.WebGLFastSpriteBatch=function(a){this.vertSize=10,this.maxSize=6e3,this.size=this.maxSize;var b=4*this.size*this.vertSize,c=6*this.maxSize;this.vertices=new Float32Array(b),this.indices=new Uint16Array(c),this.vertexBuffer=null,this.indexBuffer=null,this.lastIndexCount=0;for(var d=0,f=0;c>d;d+=6,f+=4)this.indices[d+0]=f+0,this.indices[d+1]=f+1,this.indices[d+2]=f+2,this.indices[d+3]=f+0,this.indices[d+4]=f+2,this.indices[d+5]=f+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.currentBlendMode=0,this.renderSession=null,this.shader=null,this.tempMatrix=e.mat3.create(),this.setContext(a)},e.WebGLFastSpriteBatch.prototype.setContext=function(a){this.gl=a,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW),this.currentBlendMode=99999},e.WebGLFastSpriteBatch.prototype.begin=function(a,b){this.renderSession=b,this.shader=this.renderSession.shaderManager.fastShader,e.mat3.transpose(a.worldTransform,this.tempMatrix),this.start()},e.WebGLFastSpriteBatch.prototype.end=function(){this.flush()},e.WebGLFastSpriteBatch.prototype.render=function(a){var b=a.children,c=b[0];if(c.texture._uvs){this.currentBaseTexture=c.texture.baseTexture,c.blendMode!==this.currentBlendMode&&this.setBlendMode(c.blendMode);for(var d=0,e=b.length;e>d;d++)this.renderSprite(b[d]);this.flush()}},e.WebGLFastSpriteBatch.prototype.renderSprite=function(a){if(a.texture.baseTexture===this.currentBaseTexture||(this.currentBaseTexture=a.texture.baseTexture,this.flush(),a.texture._uvs)){var b,c,d,e,f,g,h,i,j=this.vertices;if(b=a.texture._uvs,c=a.texture.frame.width,d=a.texture.frame.height,a.texture.trimmed){var k=a.texture.trim;f=k.x-a.anchor.x*k.realWidth,e=f+a.texture.frame.width,h=k.y-a.anchor.y*k.realHeight,g=h+a.texture.frame.height}else e=a.texture.frame.width*(1-a.anchor.x),f=a.texture.frame.width*-a.anchor.x,g=a.texture.frame.height*(1-a.anchor.y),h=a.texture.frame.height*-a.anchor.y;i=4*this.currentBatchSize*this.vertSize,j[i++]=f,j[i++]=h,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b[0],j[i++]=b[1],j[i++]=a.alpha,j[i++]=e,j[i++]=h,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b[2],j[i++]=b[3],j[i++]=a.alpha,j[i++]=e,j[i++]=g,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b[4],j[i++]=b[5],j[i++]=a.alpha,j[i++]=f,j[i++]=g,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b[6],j[i++]=b[7],j[i++]=a.alpha,this.currentBatchSize++,this.currentBatchSize>=this.size&&this.flush()}},e.WebGLFastSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a=this.gl;if(this.currentBaseTexture._glTextures[a.id]||e.createWebGLTexture(this.currentBaseTexture,a),a.bindTexture(a.TEXTURE_2D,this.currentBaseTexture._glTextures[a.id]),this.currentBatchSize>.5*this.size)a.bufferSubData(a.ARRAY_BUFFER,0,this.vertices);else{var b=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);a.bufferSubData(a.ARRAY_BUFFER,0,b)}a.drawElements(a.TRIANGLES,6*this.currentBatchSize,a.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}},e.WebGLFastSpriteBatch.prototype.stop=function(){this.flush()},e.WebGLFastSpriteBatch.prototype.start=function(){var a=this.gl;a.activeTexture(a.TEXTURE0),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var b=this.renderSession.projection;a.uniform2f(this.shader.projectionVector,b.x,b.y),a.uniformMatrix3fv(this.shader.uMatrix,!1,this.tempMatrix);var c=4*this.vertSize;a.vertexAttribPointer(this.shader.aVertexPosition,2,a.FLOAT,!1,c,0),a.vertexAttribPointer(this.shader.aPositionCoord,2,a.FLOAT,!1,c,8),a.vertexAttribPointer(this.shader.aScale,2,a.FLOAT,!1,c,16),a.vertexAttribPointer(this.shader.aRotation,1,a.FLOAT,!1,c,24),a.vertexAttribPointer(this.shader.aTextureCoord,2,a.FLOAT,!1,c,28),a.vertexAttribPointer(this.shader.colorAttribute,1,a.FLOAT,!1,c,36),this.currentBlendMode!==e.blendModes.NORMAL&&this.setBlendMode(e.blendModes.NORMAL)},e.WebGLFastSpriteBatch.prototype.setBlendMode=function(a){this.flush(),this.currentBlendMode=a;var b=e.blendModesWebGL[this.currentBlendMode];this.gl.blendFunc(b[0],b[1])},e.WebGLFilterManager=function(a,b){this.transparent=b,this.filterStack=[],this.offsetX=0,this.offsetY=0,this.setContext(a)},e.WebGLFilterManager.prototype.setContext=function(a){this.gl=a,this.texturePool=[],this.initShaderBuffers()},e.WebGLFilterManager.prototype.begin=function(a,b){this.renderSession=a,this.defaultShader=a.shaderManager.defaultShader;var c=this.renderSession.projection;this.width=2*c.x,this.height=2*-c.y,this.buffer=b},e.WebGLFilterManager.prototype.pushFilter=function(a){var b=this.gl,c=this.renderSession.projection,d=this.renderSession.offset;this.filterStack.push(a);var f=a.filterPasses[0];this.offsetX+=a.target.filterArea.x,this.offsetY+=a.target.filterArea.y;var g=this.texturePool.pop();g?g.resize(this.width,this.height):g=new e.FilterTexture(this.gl,this.width,this.height),b.bindTexture(b.TEXTURE_2D,g.texture),a.target.filterArea=a.target.getBounds();var h=a.target.filterArea,i=f.padding;h.x-=i,h.y-=i,h.width+=2*i,h.height+=2*i,h.x<0&&(h.x=0),h.width>this.width&&(h.width=this.width),h.y<0&&(h.y=0),h.height>this.height&&(h.height=this.height),b.bindFramebuffer(b.FRAMEBUFFER,g.frameBuffer),b.viewport(0,0,h.width,h.height),c.x=h.width/2,c.y=-h.height/2,d.x=-h.x,d.y=-h.y,b.uniform2f(this.defaultShader.projectionVector,h.width/2,-h.height/2),b.uniform2f(this.defaultShader.offsetVector,-h.x,-h.y),b.colorMask(!0,!0,!0,!0),b.clearColor(0,0,0,0),b.clear(b.COLOR_BUFFER_BIT),a._glFilterTexture=g},e.WebGLFilterManager.prototype.popFilter=function(){var a=this.gl,b=this.filterStack.pop(),c=b.target.filterArea,d=b._glFilterTexture,f=this.renderSession.projection,g=this.renderSession.offset;if(b.filterPasses.length>1){a.viewport(0,0,c.width,c.height),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),this.vertexArray[0]=0,this.vertexArray[1]=c.height,this.vertexArray[2]=c.width,this.vertexArray[3]=c.height,this.vertexArray[4]=0,this.vertexArray[5]=0,this.vertexArray[6]=c.width,this.vertexArray[7]=0,a.bufferSubData(a.ARRAY_BUFFER,0,this.vertexArray),a.bindBuffer(a.ARRAY_BUFFER,this.uvBuffer),this.uvArray[2]=c.width/this.width,this.uvArray[5]=c.height/this.height,this.uvArray[6]=c.width/this.width,this.uvArray[7]=c.height/this.height,a.bufferSubData(a.ARRAY_BUFFER,0,this.uvArray);var h=d,i=this.texturePool.pop();i||(i=new e.FilterTexture(this.gl,this.width,this.height)),a.bindFramebuffer(a.FRAMEBUFFER,i.frameBuffer),a.clear(a.COLOR_BUFFER_BIT),a.disable(a.BLEND);for(var j=0;j0&&(e.Texture.frameUpdates.length=0)},e.CanvasRenderer.prototype.resize=function(a,b){this.width=a,this.height=b,this.view.width=a,this.view.height=b},e.CanvasRenderer.prototype.renderDisplayObject=function(a,b){this.renderSession.context=b||this.context,a._renderCanvas(this.renderSession)},e.CanvasRenderer.prototype.renderStripFlat=function(a){var b=this.context,c=a.verticies,d=c.length/2;this.count++,b.beginPath();for(var e=1;d-2>e;e++){var f=2*e,g=c[f],h=c[f+2],i=c[f+4],j=c[f+1],k=c[f+3],l=c[f+5];b.moveTo(g,j),b.lineTo(h,k),b.lineTo(i,l)}b.fillStyle="#FF0000",b.fill(),b.closePath()},e.CanvasRenderer.prototype.renderStrip=function(a){var b=this.context,c=a.verticies,d=a.uvs,e=c.length/2;this.count++;for(var f=1;e-2>f;f++){var g=2*f,h=c[g],i=c[g+2],j=c[g+4],k=c[g+1],l=c[g+3],m=c[g+5],n=d[g]*a.texture.width,o=d[g+2]*a.texture.width,p=d[g+4]*a.texture.width,q=d[g+1]*a.texture.height,r=d[g+3]*a.texture.height,s=d[g+5]*a.texture.height;b.save(),b.beginPath(),b.moveTo(h,k),b.lineTo(i,l),b.lineTo(j,m),b.closePath(),b.clip();var t=n*r+q*p+o*s-r*p-q*o-n*s,u=h*r+q*j+i*s-r*j-q*i-h*s,v=n*i+h*p+o*j-i*p-h*o-n*j,w=n*r*j+q*i*p+h*o*s-h*r*p-q*o*j-n*i*s,x=k*r+q*m+l*s-r*m-q*l-k*s,y=n*l+k*p+o*m-l*p-k*o-n*m,z=n*r*m+q*l*p+k*o*s-k*r*p-q*o*m-n*l*s;b.transform(u/t,x/t,v/t,y/t,w/t,z/t),b.drawImage(a.texture.baseTexture.source,0,0),b.restore()}},e.CanvasBuffer=function(a,b){this.width=a,this.height=b,this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=a,this.canvas.height=b},e.CanvasBuffer.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},e.CanvasBuffer.prototype.resize=function(a,b){this.width=this.canvas.width=a,this.height=this.canvas.height=b},e.CanvasGraphics=function(){},e.CanvasGraphics.renderGraphics=function(a,b){for(var c=a.worldAlpha,d="",f=0;f1&&(c=1,window.console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object"));for(var d=0;1>d;d++){var f=a.graphicsData[d],g=f.points;if(f.type===e.Graphics.POLY){b.beginPath(),b.moveTo(g[0],g[1]);for(var h=1;hc;c++)this.children[c]._renderWebGL(a);a.spriteBatch.stop()}this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),a.drawCount++,a.spriteBatch.start()}},e.Graphics.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha&&this.isMask!==!0){var b=a.context,c=this.worldTransform;this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,b.globalCompositeOperation=e.blendModesCanvas[a.currentBlendMode]),b.setTransform(c[0],c[3],c[1],c[4],c[2],c[5]),e.CanvasGraphics.renderGraphics(this,b);for(var d=0,f=this.children.length;f>d;d++)this.children[d]._renderCanvas(a)}},e.Graphics.prototype.getBounds=function(){this.bounds||this.updateBounds();var a=this.bounds.x,b=this.bounds.width+this.bounds.x,c=this.bounds.y,d=this.bounds.height+this.bounds.y,e=this.worldTransform,f=e[0],g=e[3],h=e[1],i=e[4],j=e[2],k=e[5],l=f*b+h*d+j,m=i*d+g*b+k,n=f*a+h*d+j,o=i*d+g*a+k,p=f*a+h*c+j,q=i*c+g*a+k,r=f*b+h*c+j,s=i*c+g*b+k,t=-1/0,u=-1/0,v=1/0,w=1/0;v=v>l?l:v,v=v>n?n:v,v=v>p?p:v,v=v>r?r:v,w=w>m?m:w,w=w>o?o:w,w=w>q?q:w,w=w>s?s:w,t=l>t?l:t,t=n>t?n:t,t=p>t?p:t,t=r>t?r:t,u=m>u?m:u,u=o>u?o:u,u=q>u?q:u,u=s>u?s:u;var x=this._bounds;return x.x=v,x.width=t-v,x.y=w,x.height=u-w,x},e.Graphics.prototype.updateBounds=function(){for(var a,b,c,d=1/0,f=-1/0,g=1/0,h=-1/0,i=0;ib?b:d,f=b+m>f?b+m:f,g=g>c?b:g,h=c+n>h?c+n:h}else if(k===e.Graphics.CIRC||k===e.Graphics.ELIP){b=a.x,c=a.y;var o=a.radius+l/2;d=d>b-o?b-o:d,f=b+o>f?b+o:f,g=g>c-o?c-o:g,h=c+o>h?c+o:h}else for(var p=0;pb-l?b-l:d,f=b+l>f?b+l:f,g=g>c-l?c-l:g,h=c+l>h?c+l:h}var q=this.boundsPadding;this.bounds=new e.Rectangle(d-q,g-q,f-d+2*q,h-g+2*q)},e.Graphics.prototype._generateCachedSprite=function(){var a=this.getBounds();if(this._cachedSprite)this._cachedSprite.buffer.resize(a.width,a.height);else{var b=new e.CanvasBuffer(a.width,a.height),c=e.Texture.fromCanvas(b.canvas);this._cachedSprite=new e.Sprite(c),this._cachedSprite.buffer=b,this._cachedSprite.worldTransform=this.worldTransform}this._cachedSprite.anchor.x=-(a.x/a.width),this._cachedSprite.anchor.y=-(a.y/a.height),this._cachedSprite.buffer.context.translate(-a.x,-a.y),e.CanvasGraphics.renderGraphics(this,this._cachedSprite.buffer.context)},e.Graphics.prototype.destroyCachedSprite=function(){this._cachedSprite.texture.destroy(!0),this._cachedSprite=null},e.Graphics.POLY=0,e.Graphics.RECT=1,e.Graphics.CIRC=2,e.Graphics.ELIP=3,e.tempMatrix=e.mat3.create(),e.Strip=function(a,b,c){e.DisplayObjectContainer.call(this),this.texture=a,this.blendMode=e.blendModes.NORMAL;try{this.uvs=new Float32Array([0,1,1,1,1,0,0,1]),this.verticies=new Float32Array([0,0,0,0,0,0,0,0,0]),this.colors=new Float32Array([1,1,1,1]),this.indices=new Uint16Array([0,1,2,3])}catch(d){this.uvs=[0,1,1,1,1,0,0,1],this.verticies=[0,0,0,0,0,0,0,0,0],this.colors=[1,1,1,1],this.indices=[0,1,2,3]}this.width=b,this.height=c,a.baseTexture.hasLoaded?(this.width=this.texture.frame.width,this.height=this.texture.frame.height,this.updateFrame=!0):(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},e.Strip.prototype=Object.create(e.DisplayObjectContainer.prototype),e.Strip.prototype.constructor=e.Strip,e.Strip.prototype.setTexture=function(a){this.texture=a,this.width=a.frame.width,this.height=a.frame.height,this.updateFrame=!0},e.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0},e.Rope=function(a,b){e.Strip.call(this,a),this.points=b;try{this.verticies=new Float32Array(4*b.length),this.uvs=new Float32Array(4*b.length),this.colors=new Float32Array(2*b.length),this.indices=new Uint16Array(2*b.length)}catch(c){this.verticies=new Array(4*b.length),this.uvs=new Array(4*b.length),this.colors=new Array(2*b.length),this.indices=new Array(2*b.length)}this.refresh()},e.Rope.prototype=Object.create(e.Strip.prototype),e.Rope.prototype.constructor=e.Rope,e.Rope.prototype.refresh=function(){var a=this.points;if(!(a.length<1)){var b=this.uvs,c=a[0],d=this.indices,e=this.colors;this.count-=.2,b[0]=0,b[1]=1,b[2]=0,b[3]=1,e[0]=1,e[1]=1,d[0]=0,d[1]=1;for(var f,g,h,i=a.length,j=1;i>j;j++)f=a[j],g=4*j,h=j/(i-1),j%2?(b[g]=h,b[g+1]=0,b[g+2]=h,b[g+3]=1):(b[g]=h,b[g+1]=0,b[g+2]=h,b[g+3]=1),g=2*j,e[g]=1,e[g+1]=1,g=2*j,d[g]=g,d[g+1]=g+1,c=f}},e.Rope.prototype.updateTransform=function(){var a=this.points;if(!(a.length<1)){var b,c=a[0],d={x:0,y:0};this.count-=.2;var f=this.verticies;f[0]=c.x+d.x,f[1]=c.y+d.y,f[2]=c.x-d.x,f[3]=c.y-d.y;for(var g,h,i,j,k,l=a.length,m=1;l>m;m++)g=a[m],h=4*m,b=m1&&(i=1),j=Math.sqrt(d.x*d.x+d.y*d.y),k=this.texture.height/2,d.x/=j,d.y/=j,d.x*=k,d.y*=k,f[h]=g.x+d.x,f[h+1]=g.y+d.y,f[h+2]=g.x-d.x,f[h+3]=g.y-d.y,c=g;e.DisplayObjectContainer.prototype.updateTransform.call(this)}},e.Rope.prototype.setTexture=function(a){this.texture=a,this.updateFrame=!0},e.TilingSprite=function(a,b,c){e.Sprite.call(this,a),this.width=b||100,this.height=c||100,this.tileScale=new e.Point(1,1),this.tileScaleOffset=new e.Point(1,1),this.tilePosition=new e.Point(0,0),this.renderable=!0,this.tint=16777215,this.blendMode=e.blendModes.NORMAL},e.TilingSprite.prototype=Object.create(e.Sprite.prototype),e.TilingSprite.prototype.constructor=e.TilingSprite,Object.defineProperty(e.TilingSprite.prototype,"width",{get:function(){return this._width},set:function(a){this._width=a}}),Object.defineProperty(e.TilingSprite.prototype,"height",{get:function(){return this._height
-},set:function(a){this._height=a}}),e.TilingSprite.prototype.onTextureUpdate=function(){this.updateFrame=!0},e.TilingSprite.prototype._renderWebGL=function(a){if(this.visible!==!1&&0!==this.alpha){var b,c;if(this.mask||this.filters){for(this.mask&&(a.spriteBatch.stop(),a.maskManager.pushMask(this.mask,a),a.spriteBatch.start()),this.filters&&(a.spriteBatch.flush(),a.filterManager.pushFilter(this._filterBlock)),this.tilingTexture?a.spriteBatch.renderTilingSprite(this):this.generateTilingTexture(!0),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);a.spriteBatch.stop(),this.filters&&a.filterManager.popFilter(),this.mask&&a.maskManager.popMask(a),a.spriteBatch.start()}else for(this.tilingTexture?a.spriteBatch.renderTilingSprite(this):this.generateTilingTexture(!0),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},e.TilingSprite.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){var b=a.context;this._mask&&a.maskManager.pushMask(this._mask,b),b.globalAlpha=this.worldAlpha;var c=this.worldTransform;b.setTransform(c[0],c[3],c[1],c[4],c[2],c[5]),this.__tilePattern||(this.generateTilingTexture(!1),this.tilingTexture&&(this.__tilePattern=b.createPattern(this.tilingTexture.baseTexture.source,"repeat"))),this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,b.globalCompositeOperation=e.blendModesCanvas[a.currentBlendMode]),b.beginPath();var d=this.tilePosition,f=this.tileScale;b.scale(f.x,f.y),b.translate(d.x,d.y),b.fillStyle=this.__tilePattern,b.fillRect(-d.x,-d.y,this.width/f.x,this.height/f.y),b.scale(1/f.x,1/f.y),b.translate(-d.x,-d.y),b.closePath(),this._mask&&a.maskManager.popMask(a.context)}},e.TilingSprite.prototype.getBounds=function(){var a=this._width,b=this._height,c=a*(1-this.anchor.x),d=a*-this.anchor.x,e=b*(1-this.anchor.y),f=b*-this.anchor.y,g=this.worldTransform,h=g[0],i=g[3],j=g[1],k=g[4],l=g[2],m=g[5],n=h*d+j*f+l,o=k*f+i*d+m,p=h*c+j*f+l,q=k*f+i*c+m,r=h*c+j*e+l,s=k*e+i*c+m,t=h*d+j*e+l,u=k*e+i*d+m,v=-1/0,w=-1/0,x=1/0,y=1/0;x=x>n?n:x,x=x>p?p:x,x=x>r?r:x,x=x>t?t:x,y=y>o?o:y,y=y>q?q:y,y=y>s?s:y,y=y>u?u:y,v=n>v?n:v,v=p>v?p:v,v=r>v?r:v,v=t>v?t:v,w=o>w?o:w,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w;var z=this._bounds;return z.x=x,z.width=v-x,z.y=y,z.height=w-y,this._currentBounds=z,z},e.TilingSprite.prototype.generateTilingTexture=function(a){var b=this.texture;if(b.baseTexture.hasLoaded){var c,d,f=b.baseTexture,g=b.frame,h=g.width!==f.width||g.height!==f.height;this.tilingTexture=b;var i=!1;if(a?(c=e.getNextPowerOfTwo(b.frame.width),d=e.getNextPowerOfTwo(b.frame.height),g.width!==c&&g.height!==d&&(i=!0)):h&&(c=g.width,d=g.height,i=!0),i){var j=new e.CanvasBuffer(c,d);j.context.drawImage(b.baseTexture.source,g.x,g.y,g.width,g.height,0,0,c,d),this.tilingTexture=e.Texture.fromCanvas(j.canvas),this.tileScaleOffset.x=g.width/c,this.tileScaleOffset.y=g.height/d}this.tilingTexture.baseTexture._powerOf2=!0}};var j={};j.BoneData=function(a,b){this.name=a,this.parent=b},j.BoneData.prototype={length:0,x:0,y:0,rotation:0,scaleX:1,scaleY:1},j.SlotData=function(a,b){this.name=a,this.boneData=b},j.SlotData.prototype={r:1,g:1,b:1,a:1,attachmentName:null},j.Bone=function(a,b){this.data=a,this.parent=b,this.setToSetupPose()},j.Bone.yDown=!1,j.Bone.prototype={x:0,y:0,rotation:0,scaleX:1,scaleY:1,m00:0,m01:0,worldX:0,m10:0,m11:0,worldY:0,worldRotation:0,worldScaleX:1,worldScaleY:1,updateWorldTransform:function(a,b){var c=this.parent;null!=c?(this.worldX=this.x*c.m00+this.y*c.m01+c.worldX,this.worldY=this.x*c.m10+this.y*c.m11+c.worldY,this.worldScaleX=c.worldScaleX*this.scaleX,this.worldScaleY=c.worldScaleY*this.scaleY,this.worldRotation=c.worldRotation+this.rotation):(this.worldX=this.x,this.worldY=this.y,this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY,this.worldRotation=this.rotation);var d=this.worldRotation*Math.PI/180,e=Math.cos(d),f=Math.sin(d);this.m00=e*this.worldScaleX,this.m10=f*this.worldScaleX,this.m01=-f*this.worldScaleY,this.m11=e*this.worldScaleY,a&&(this.m00=-this.m00,this.m01=-this.m01),b&&(this.m10=-this.m10,this.m11=-this.m11),j.Bone.yDown&&(this.m10=-this.m10,this.m11=-this.m11)},setToSetupPose:function(){var a=this.data;this.x=a.x,this.y=a.y,this.rotation=a.rotation,this.scaleX=a.scaleX,this.scaleY=a.scaleY}},j.Slot=function(a,b,c){this.data=a,this.skeleton=b,this.bone=c,this.setToSetupPose()},j.Slot.prototype={r:1,g:1,b:1,a:1,_attachmentTime:0,attachment:null,setAttachment:function(a){this.attachment=a,this._attachmentTime=this.skeleton.time},setAttachmentTime:function(a){this._attachmentTime=this.skeleton.time-a},getAttachmentTime:function(){return this.skeleton.time-this._attachmentTime},setToSetupPose:function(){var a=this.data;this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a;for(var b=this.skeleton.data.slots,c=0,d=b.length;d>c;c++)if(b[c]==a){this.setAttachment(a.attachmentName?this.skeleton.getAttachmentBySlotIndex(c,a.attachmentName):null);break}}},j.Skin=function(a){this.name=a,this.attachments={}},j.Skin.prototype={addAttachment:function(a,b,c){this.attachments[a+":"+b]=c},getAttachment:function(a,b){return this.attachments[a+":"+b]},_attachAll:function(a,b){for(var c in b.attachments){var d=c.indexOf(":"),e=parseInt(c.substring(0,d),10),f=c.substring(d+1),g=a.slots[e];if(g.attachment&&g.attachment.name==f){var h=this.getAttachment(e,f);h&&g.setAttachment(h)}}}},j.Animation=function(a,b,c){this.name=a,this.timelines=b,this.duration=c},j.Animation.prototype={apply:function(a,b,c){c&&this.duration&&(b%=this.duration);for(var d=this.timelines,e=0,f=d.length;f>e;e++)d[e].apply(a,b,1)},mix:function(a,b,c,d){c&&this.duration&&(b%=this.duration);for(var e=this.timelines,f=0,g=e.length;g>f;f++)e[f].apply(a,b,d)}},j.binarySearch=function(a,b,c){var d=0,e=Math.floor(a.length/c)-2;if(!e)return c;for(var f=e>>>1;;){if(a[(f+1)*c]<=b?d=f+1:e=f,d==e)return(d+1)*c;f=d+e>>>1}},j.linearSearch=function(a,b,c){for(var d=0,e=a.length-c;e>=d;d+=c)if(a[d]>b)return d;return-1},j.Curves=function(a){this.curves=[],this.curves.length=6*(a-1)},j.Curves.prototype={setLinear:function(a){this.curves[6*a]=0},setStepped:function(a){this.curves[6*a]=-1},setCurve:function(a,b,c,d,e){var f=.1,g=f*f,h=g*f,i=3*f,j=3*g,k=6*g,l=6*h,m=2*-b+d,n=2*-c+e,o=3*(b-d)+1,p=3*(c-e)+1,q=6*a,r=this.curves;r[q]=b*i+m*j+o*h,r[q+1]=c*i+n*j+p*h,r[q+2]=m*k+o*l,r[q+3]=n*k+p*l,r[q+4]=o*l,r[q+5]=p*l},getCurvePercent:function(a,b){b=0>b?0:b>1?1:b;var c=6*a,d=this.curves,e=d[c];if(!e)return b;if(-1==e)return 0;for(var f=d[c+1],g=d[c+2],h=d[c+3],i=d[c+4],j=d[c+5],k=e,l=f,m=8;;){if(k>=b){var n=k-e,o=l-f;return o+(l-o)*(b-n)/(k-n)}if(!m)break;m--,e+=g,f+=h,g+=i,h+=j,k+=e,l+=f}return l+(1-l)*(b-k)/(1-k)}},j.RotateTimeline=function(a){this.curves=new j.Curves(a),this.frames=[],this.frames.length=2*a},j.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(a,b,c){a*=2,this.frames[a]=b,this.frames[a+1]=c},apply:function(a,b,c){var d,e=this.frames;if(!(b=e[e.length-2]){for(d=f.data.rotation+e[e.length-1]-f.rotation;d>180;)d-=360;for(;-180>d;)d+=360;return f.rotation+=d*c,void 0}var g=j.binarySearch(e,b,2),h=e[g-1],i=e[g],k=1-(b-i)/(e[g-2]-i);for(k=this.curves.getCurvePercent(g/2-1,k),d=e[g+1]-h;d>180;)d-=360;for(;-180>d;)d+=360;for(d=f.data.rotation+(h+d*k)-f.rotation;d>180;)d-=360;for(;-180>d;)d+=360;f.rotation+=d*c}}},j.TranslateTimeline=function(a){this.curves=new j.Curves(a),this.frames=[],this.frames.length=3*a},j.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d},apply:function(a,b,c){var d=this.frames;if(!(b=d[d.length-3])return e.x+=(e.data.x+d[d.length-2]-e.x)*c,e.y+=(e.data.y+d[d.length-1]-e.y)*c,void 0;var f=j.binarySearch(d,b,3),g=d[f-2],h=d[f-1],i=d[f],k=1-(b-i)/(d[f+-3]-i);k=this.curves.getCurvePercent(f/3-1,k),e.x+=(e.data.x+g+(d[f+1]-g)*k-e.x)*c,e.y+=(e.data.y+h+(d[f+2]-h)*k-e.y)*c}}},j.ScaleTimeline=function(a){this.curves=new j.Curves(a),this.frames=[],this.frames.length=3*a},j.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d},apply:function(a,b,c){var d=this.frames;if(!(b=d[d.length-3])return e.scaleX+=(e.data.scaleX-1+d[d.length-2]-e.scaleX)*c,e.scaleY+=(e.data.scaleY-1+d[d.length-1]-e.scaleY)*c,void 0;var f=j.binarySearch(d,b,3),g=d[f-2],h=d[f-1],i=d[f],k=1-(b-i)/(d[f+-3]-i);k=this.curves.getCurvePercent(f/3-1,k),e.scaleX+=(e.data.scaleX-1+g+(d[f+1]-g)*k-e.scaleX)*c,e.scaleY+=(e.data.scaleY-1+h+(d[f+2]-h)*k-e.scaleY)*c}}},j.ColorTimeline=function(a){this.curves=new j.Curves(a),this.frames=[],this.frames.length=5*a},j.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(c,d){c*=5,this.frames[c]=d,this.frames[c+1]=r,this.frames[c+2]=g,this.frames[c+3]=b,this.frames[c+4]=a},apply:function(a,b,c){var d=this.frames;if(!(b=d[d.length-5]){var f=d.length-1;return e.r=d[f-3],e.g=d[f-2],e.b=d[f-1],e.a=d[f],void 0}var g=j.binarySearch(d,b,5),h=d[g-4],i=d[g-3],k=d[g-2],l=d[g-1],m=d[g],n=1-(b-m)/(d[g-5]-m);n=this.curves.getCurvePercent(g/5-1,n);var o=h+(d[g+1]-h)*n,p=i+(d[g+2]-i)*n,q=k+(d[g+3]-k)*n,r=l+(d[g+4]-l)*n;1>c?(e.r+=(o-e.r)*c,e.g+=(p-e.g)*c,e.b+=(q-e.b)*c,e.a+=(r-e.a)*c):(e.r=o,e.g=p,e.b=q,e.a=r)}}},j.AttachmentTimeline=function(a){this.curves=new j.Curves(a),this.frames=[],this.frames.length=a,this.attachmentNames=[],this.attachmentNames.length=a},j.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length},setFrame:function(a,b,c){this.frames[a]=b,this.attachmentNames[a]=c},apply:function(a,b){var c=this.frames;if(!(b=c[c.length-1]?c.length-1:j.binarySearch(c,b,1)-1;var e=this.attachmentNames[d];a.slots[this.slotIndex].setAttachment(e?a.getAttachmentBySlotIndex(this.slotIndex,e):null)}}},j.SkeletonData=function(){this.bones=[],this.slots=[],this.skins=[],this.animations=[]},j.SkeletonData.prototype={defaultSkin:null,findBone:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},findBoneIndex:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].name==a)return c;return-1},findSlot:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].name==a)return slot[c];return null},findSlotIndex:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].name==a)return c;return-1},findSkin:function(a){for(var b=this.skins,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},findAnimation:function(a){for(var b=this.animations,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null}},j.Skeleton=function(a){this.data=a,this.bones=[];for(var b=0,c=a.bones.length;c>b;b++){var d=a.bones[b],e=d.parent?this.bones[a.bones.indexOf(d.parent)]:null;this.bones.push(new j.Bone(d,e))}for(this.slots=[],this.drawOrder=[],b=0,c=a.slots.length;c>b;b++){var f=a.slots[b],g=this.bones[a.bones.indexOf(f.boneData)],h=new j.Slot(f,this,g);this.slots.push(h),this.drawOrder.push(h)}},j.Skeleton.prototype={x:0,y:0,skin:null,r:1,g:1,b:1,a:1,time:0,flipX:!1,flipY:!1,updateWorldTransform:function(){for(var a=this.flipX,b=this.flipY,c=this.bones,d=0,e=c.length;e>d;d++)c[d].updateWorldTransform(a,b)},setToSetupPose:function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},setBonesToSetupPose:function(){for(var a=this.bones,b=0,c=a.length;c>b;b++)a[b].setToSetupPose()},setSlotsToSetupPose:function(){for(var a=this.slots,b=0,c=a.length;c>b;b++)a[b].setToSetupPose(b)},getRootBone:function(){return this.bones.length?this.bones[0]:null},findBone:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return b[c];return null},findBoneIndex:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return c;return-1},findSlot:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return b[c];return null},findSlotIndex:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return c;return-1},setSkinByName:function(a){var b=this.data.findSkin(a);if(!b)throw"Skin not found: "+a;this.setSkin(b)},setSkin:function(a){this.skin&&a&&a._attachAll(this,this.skin),this.skin=a},getAttachmentBySlotName:function(a,b){return this.getAttachmentBySlotIndex(this.data.findSlotIndex(a),b)},getAttachmentBySlotIndex:function(a,b){if(this.skin){var c=this.skin.getAttachment(a,b);if(c)return c}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(a,b):null},setAttachment:function(a,b){for(var c=this.slots,d=0,e=c.size;e>d;d++){var f=c[d];if(f.data.name==a){var g=null;if(b&&(g=this.getAttachment(d,b),null==g))throw"Attachment not found: "+b+", for slot: "+a;return f.setAttachment(g),void 0}}throw"Slot not found: "+a},update:function(a){time+=a}},j.AttachmentType={region:0},j.RegionAttachment=function(){this.offset=[],this.offset.length=8,this.uvs=[],this.uvs.length=8},j.RegionAttachment.prototype={x:0,y:0,rotation:0,scaleX:1,scaleY:1,width:0,height:0,rendererObject:null,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,setUVs:function(a,b,c,d,e){var f=this.uvs;e?(f[2]=a,f[3]=d,f[4]=a,f[5]=b,f[6]=c,f[7]=b,f[0]=c,f[1]=d):(f[0]=a,f[1]=d,f[2]=a,f[3]=b,f[4]=c,f[5]=b,f[6]=c,f[7]=d)},updateOffset:function(){var a=this.width/this.regionOriginalWidth*this.scaleX,b=this.height/this.regionOriginalHeight*this.scaleY,c=-this.width/2*this.scaleX+this.regionOffsetX*a,d=-this.height/2*this.scaleY+this.regionOffsetY*b,e=c+this.regionWidth*a,f=d+this.regionHeight*b,g=this.rotation*Math.PI/180,h=Math.cos(g),i=Math.sin(g),j=c*h+this.x,k=c*i,l=d*h+this.y,m=d*i,n=e*h+this.x,o=e*i,p=f*h+this.y,q=f*i,r=this.offset;r[0]=j-m,r[1]=l+k,r[2]=j-q,r[3]=p+k,r[4]=n-q,r[5]=p+o,r[6]=n-m,r[7]=l+o},computeVertices:function(a,b,c,d){a+=c.worldX,b+=c.worldY;var e=c.m00,f=c.m01,g=c.m10,h=c.m11,i=this.offset;d[0]=i[0]*e+i[1]*f+a,d[1]=i[0]*g+i[1]*h+b,d[2]=i[2]*e+i[3]*f+a,d[3]=i[2]*g+i[3]*h+b,d[4]=i[4]*e+i[5]*f+a,d[5]=i[4]*g+i[5]*h+b,d[6]=i[6]*e+i[7]*f+a,d[7]=i[6]*g+i[7]*h+b}},j.AnimationStateData=function(a){this.skeletonData=a,this.animationToMixTime={}},j.AnimationStateData.prototype={defaultMix:0,setMixByName:function(a,b,c){var d=this.skeletonData.findAnimation(a);if(!d)throw"Animation not found: "+a;var e=this.skeletonData.findAnimation(b);if(!e)throw"Animation not found: "+b;this.setMix(d,e,c)},setMix:function(a,b,c){this.animationToMixTime[a.name+":"+b.name]=c},getMix:function(a,b){var c=this.animationToMixTime[a.name+":"+b.name];return c?c:this.defaultMix}},j.AnimationState=function(a){this.data=a,this.queue=[]},j.AnimationState.prototype={current:null,previous:null,currentTime:0,previousTime:0,currentLoop:!1,previousLoop:!1,mixTime:0,mixDuration:0,update:function(a){if(this.currentTime+=a,this.previousTime+=a,this.mixTime+=a,this.queue.length>0){var b=this.queue[0];this.currentTime>=b.delay&&(this._setAnimation(b.animation,b.loop),this.queue.shift())}},apply:function(a){if(this.current)if(this.previous){this.previous.apply(a,this.previousTime,this.previousLoop);var b=this.mixTime/this.mixDuration;b>=1&&(b=1,this.previous=null),this.current.mix(a,this.currentTime,this.currentLoop,b)}else this.current.apply(a,this.currentTime,this.currentLoop)},clearAnimation:function(){this.previous=null,this.current=null,this.queue.length=0},_setAnimation:function(a,b){this.previous=null,a&&this.current&&(this.mixDuration=this.data.getMix(this.current,a),this.mixDuration>0&&(this.mixTime=0,this.previous=this.current,this.previousTime=this.currentTime,this.previousLoop=this.currentLoop)),this.current=a,this.currentLoop=b,this.currentTime=0},setAnimationByName:function(a,b){var c=this.data.skeletonData.findAnimation(a);if(!c)throw"Animation not found: "+a;this.setAnimation(c,b)},setAnimation:function(a,b){this.queue.length=0,this._setAnimation(a,b)},addAnimationByName:function(a,b,c){var d=this.data.skeletonData.findAnimation(a);if(!d)throw"Animation not found: "+a;this.addAnimation(d,b,c)},addAnimation:function(a,b,c){var d={};if(d.animation=a,d.loop=b,!c||0>=c){var e=this.queue.length?this.queue[this.queue.length-1].animation:this.current;c=null!=e?e.duration-this.data.getMix(e,a)+(c||0):0}d.delay=c,this.queue.push(d)},isComplete:function(){return!this.current||this.currentTime>=this.current.duration}},j.SkeletonJson=function(a){this.attachmentLoader=a},j.SkeletonJson.prototype={scale:1,readSkeletonData:function(a){for(var b,c=new j.SkeletonData,d=a.bones,e=0,f=d.length;f>e;e++){var g=d[e],h=null;if(g.parent&&(h=c.findBone(g.parent),!h))throw"Parent bone not found: "+g.parent;b=new j.BoneData(g.name,h),b.length=(g.length||0)*this.scale,b.x=(g.x||0)*this.scale,b.y=(g.y||0)*this.scale,b.rotation=g.rotation||0,b.scaleX=g.scaleX||1,b.scaleY=g.scaleY||1,c.bones.push(b)}var i=a.slots;for(e=0,f=i.length;f>e;e++){var k=i[e];if(b=c.findBone(k.bone),!b)throw"Slot bone not found: "+k.bone;var l=new j.SlotData(k.name,b),m=k.color;m&&(l.r=j.SkeletonJson.toColor(m,0),l.g=j.SkeletonJson.toColor(m,1),l.b=j.SkeletonJson.toColor(m,2),l.a=j.SkeletonJson.toColor(m,3)),l.attachmentName=k.attachment,c.slots.push(l)}var n=a.skins;for(var o in n)if(n.hasOwnProperty(o)){var p=n[o],q=new j.Skin(o);for(var r in p)if(p.hasOwnProperty(r)){var s=c.findSlotIndex(r),t=p[r];for(var u in t)if(t.hasOwnProperty(u)){var v=this.readAttachment(q,u,t[u]);null!=v&&q.addAttachment(s,u,v)}}c.skins.push(q),"default"==q.name&&(c.defaultSkin=q)}var w=a.animations;for(var x in w)w.hasOwnProperty(x)&&this.readAnimation(x,w[x],c);return c},readAttachment:function(a,b,c){b=c.name||b;var d=j.AttachmentType[c.type||"region"];if(d==j.AttachmentType.region){var e=new j.RegionAttachment;return e.x=(c.x||0)*this.scale,e.y=(c.y||0)*this.scale,e.scaleX=c.scaleX||1,e.scaleY=c.scaleY||1,e.rotation=c.rotation||0,e.width=(c.width||32)*this.scale,e.height=(c.height||32)*this.scale,e.updateOffset(),e.rendererObject={},e.rendererObject.name=b,e.rendererObject.scale={},e.rendererObject.scale.x=e.scaleX,e.rendererObject.scale.y=e.scaleY,e.rendererObject.rotation=-e.rotation*Math.PI/180,e}throw"Unknown attachment type: "+d},readAnimation:function(a,b,c){var d,e,f,g,h,i,k,l=[],m=0,n=b.bones;for(var o in n)if(n.hasOwnProperty(o)){var p=c.findBoneIndex(o);if(-1==p)throw"Bone not found: "+o;var q=n[o];for(f in q)if(q.hasOwnProperty(f))if(h=q[f],"rotate"==f){for(e=new j.RotateTimeline(h.length),e.boneIndex=p,d=0,i=0,k=h.length;k>i;i++)g=h[i],e.setFrame(d,g.time,g.angle),j.SkeletonJson.readCurve(e,d,g),d++;l.push(e),m=Math.max(m,e.frames[2*e.getFrameCount()-2])}else{if("translate"!=f&&"scale"!=f)throw"Invalid timeline type for a bone: "+f+" ("+o+")";var r=1;for("scale"==f?e=new j.ScaleTimeline(h.length):(e=new j.TranslateTimeline(h.length),r=this.scale),e.boneIndex=p,d=0,i=0,k=h.length;k>i;i++){g=h[i];var s=(g.x||0)*r,t=(g.y||0)*r;e.setFrame(d,g.time,s,t),j.SkeletonJson.readCurve(e,d,g),d++}l.push(e),m=Math.max(m,e.frames[3*e.getFrameCount()-3])}}var u=b.slots;for(var v in u)if(u.hasOwnProperty(v)){var w=u[v],x=c.findSlotIndex(v);for(f in w)if(w.hasOwnProperty(f))if(h=w[f],"color"==f){for(e=new j.ColorTimeline(h.length),e.slotIndex=x,d=0,i=0,k=h.length;k>i;i++){g=h[i];var y=g.color,z=j.SkeletonJson.toColor(y,0),A=j.SkeletonJson.toColor(y,1),B=j.SkeletonJson.toColor(y,2),C=j.SkeletonJson.toColor(y,3);e.setFrame(d,g.time,z,A,B,C),j.SkeletonJson.readCurve(e,d,g),d++}l.push(e),m=Math.max(m,e.frames[5*e.getFrameCount()-5])}else{if("attachment"!=f)throw"Invalid timeline type for a slot: "+f+" ("+v+")";for(e=new j.AttachmentTimeline(h.length),e.slotIndex=x,d=0,i=0,k=h.length;k>i;i++)g=h[i],e.setFrame(d++,g.time,g.name);l.push(e),m=Math.max(m,e.frames[e.getFrameCount()-1])}}c.animations.push(new j.Animation(a,l,m))}},j.SkeletonJson.readCurve=function(a,b,c){var d=c.curve;d&&("stepped"==d?a.curves.setStepped(b):d instanceof Array&&a.curves.setCurve(b,d[0],d[1],d[2],d[3]))},j.SkeletonJson.toColor=function(a,b){if(8!=a.length)throw"Color hexidecimal length must be 8, recieved: "+a;return parseInt(a.substring(2*b,2),16)/255},j.Atlas=function(a,b){this.textureLoader=b,this.pages=[],this.regions=[];var c=new j.AtlasReader(a),d=[];d.length=4;for(var e=null;;){var f=c.readLine();if(null==f)break;if(f=c.trim(f),f.length)if(e){var g=new j.AtlasRegion;g.name=f,g.page=e,g.rotate="true"==c.readValue(),c.readTuple(d);var h=parseInt(d[0],10),i=parseInt(d[1],10);c.readTuple(d);var k=parseInt(d[0],10),l=parseInt(d[1],10);g.u=h/e.width,g.v=i/e.height,g.rotate?(g.u2=(h+l)/e.width,g.v2=(i+k)/e.height):(g.u2=(h+k)/e.width,g.v2=(i+l)/e.height),g.x=h,g.y=i,g.width=Math.abs(k),g.height=Math.abs(l),4==c.readTuple(d)&&(g.splits=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10)],4==c.readTuple(d)&&(g.pads=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10)],c.readTuple(d))),g.originalWidth=parseInt(d[0],10),g.originalHeight=parseInt(d[1],10),c.readTuple(d),g.offsetX=parseInt(d[0],10),g.offsetY=parseInt(d[1],10),g.index=parseInt(c.readValue(),10),this.regions.push(g)}else{e=new j.AtlasPage,e.name=f,e.format=j.Atlas.Format[c.readValue()],c.readTuple(d),e.minFilter=j.Atlas.TextureFilter[d[0]],e.magFilter=j.Atlas.TextureFilter[d[1]];var m=c.readValue();e.uWrap=j.Atlas.TextureWrap.clampToEdge,e.vWrap=j.Atlas.TextureWrap.clampToEdge,"x"==m?e.uWrap=j.Atlas.TextureWrap.repeat:"y"==m?e.vWrap=j.Atlas.TextureWrap.repeat:"xy"==m&&(e.uWrap=e.vWrap=j.Atlas.TextureWrap.repeat),b.load(e,f),this.pages.push(e)}else e=null}},j.Atlas.prototype={findRegion:function(a){for(var b=this.regions,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},dispose:function(){for(var a=this.pages,b=0,c=a.length;c>b;b++)this.textureLoader.unload(a[b].rendererObject)},updateUVs:function(a){for(var b=this.regions,c=0,d=b.length;d>c;c++){var e=b[c];e.page==a&&(e.u=e.x/a.width,e.v=e.y/a.height,e.rotate?(e.u2=(e.x+e.height)/a.width,e.v2=(e.y+e.width)/a.height):(e.u2=(e.x+e.width)/a.width,e.v2=(e.y+e.height)/a.height))}}},j.Atlas.Format={alpha:0,intensity:1,luminanceAlpha:2,rgb565:3,rgba4444:4,rgb888:5,rgba8888:6},j.Atlas.TextureFilter={nearest:0,linear:1,mipMap:2,mipMapNearestNearest:3,mipMapLinearNearest:4,mipMapNearestLinear:5,mipMapLinearLinear:6},j.Atlas.TextureWrap={mirroredRepeat:0,clampToEdge:1,repeat:2},j.AtlasPage=function(){},j.AtlasPage.prototype={name:null,format:null,minFilter:null,magFilter:null,uWrap:null,vWrap:null,rendererObject:null,width:0,height:0},j.AtlasRegion=function(){},j.AtlasRegion.prototype={page:null,name:null,x:0,y:0,width:0,height:0,u:0,v:0,u2:0,v2:0,offsetX:0,offsetY:0,originalWidth:0,originalHeight:0,index:0,rotate:!1,splits:null,pads:null},j.AtlasReader=function(a){this.lines=a.split(/\r\n|\r|\n/)},j.AtlasReader.prototype={index:0,trim:function(a){return a.replace(/^\s+|\s+$/g,"")},readLine:function(){return this.index>=this.lines.length?null:this.lines[this.index++]},readValue:function(){var a=this.readLine(),b=a.indexOf(":");if(-1==b)throw"Invalid line: "+a;return this.trim(a.substring(b+1))},readTuple:function(a){var b=this.readLine(),c=b.indexOf(":");if(-1==c)throw"Invalid line: "+b;for(var d=0,e=c+1;3>d;d++){var f=b.indexOf(",",e);if(-1==f){if(!d)throw"Invalid line: "+b;break}a[d]=this.trim(b.substr(e,f-e)),e=f+1}return a[d]=this.trim(b.substring(e)),d+1}},j.AtlasAttachmentLoader=function(a){this.atlas=a},j.AtlasAttachmentLoader.prototype={newAttachment:function(a,b,c){switch(b){case j.AttachmentType.region:var d=this.atlas.findRegion(c);if(!d)throw"Region not found in atlas: "+c+" ("+b+")";var e=new j.RegionAttachment(c);return e.rendererObject=d,e.setUVs(d.u,d.v,d.u2,d.v2,d.rotate),e.regionOffsetX=d.offsetX,e.regionOffsetY=d.offsetY,e.regionWidth=d.width,e.regionHeight=d.height,e.regionOriginalWidth=d.originalWidth,e.regionOriginalHeight=d.originalHeight,e}throw"Unknown attachment type: "+b}},j.Bone.yDown=!0,e.AnimCache={},e.Spine=function(a){if(e.DisplayObjectContainer.call(this),this.spineData=e.AnimCache[a],!this.spineData)throw new Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: "+a);this.skeleton=new j.Skeleton(this.spineData),this.skeleton.updateWorldTransform(),this.stateData=new j.AnimationStateData(this.spineData),this.state=new j.AnimationState(this.stateData),this.slotContainers=[];for(var b=0,c=this.skeleton.drawOrder.length;c>b;b++){var d=this.skeleton.drawOrder[b],f=d.attachment,g=new e.DisplayObjectContainer;if(this.slotContainers.push(g),this.addChild(g),f instanceof j.RegionAttachment){var h=f.rendererObject.name,i=this.createSprite(d,f.rendererObject);d.currentSprite=i,d.currentSpriteName=h,g.addChild(i)}}},e.Spine.prototype=Object.create(e.DisplayObjectContainer.prototype),e.Spine.prototype.constructor=e.Spine,e.Spine.prototype.updateTransform=function(){this.lastTime=this.lastTime||Date.now();var a=.001*(Date.now()-this.lastTime);this.lastTime=Date.now(),this.state.update(a),this.state.apply(this.skeleton),this.skeleton.updateWorldTransform();for(var b=this.skeleton.drawOrder,c=0,d=b.length;d>c;c++){var f=b[c],g=f.attachment,h=this.slotContainers[c];if(g instanceof j.RegionAttachment){if(g.rendererObject&&(!f.currentSpriteName||f.currentSpriteName!=g.name)){var i=g.rendererObject.name;if(void 0!==f.currentSprite&&(f.currentSprite.visible=!1),f.sprites=f.sprites||{},void 0!==f.sprites[i])f.sprites[i].visible=!0;else{var k=this.createSprite(f,g.rendererObject);h.addChild(k)}f.currentSprite=f.sprites[i],f.currentSpriteName=i}h.visible=!0;var l=f.bone;h.position.x=l.worldX+g.x*l.m00+g.y*l.m01,h.position.y=l.worldY+g.x*l.m10+g.y*l.m11,h.scale.x=l.worldScaleX,h.scale.y=l.worldScaleY,h.rotation=-(f.bone.worldRotation*Math.PI/180)}else h.visible=!1}e.DisplayObjectContainer.prototype.updateTransform.call(this)},e.Spine.prototype.createSprite=function(a,b){var c=e.TextureCache[b.name]?b.name:b.name+".png",d=new e.Sprite(e.Texture.fromFrame(c));return d.scale=b.scale,d.rotation=b.rotation,d.anchor.x=d.anchor.y=.5,a.sprites=a.sprites||{},a.sprites[b.name]=d,d},e.BaseTextureCache={},e.texturesToUpdate=[],e.texturesToDestroy=[],e.BaseTextureCacheIdGenerator=0,e.BaseTexture=function(a,b){if(e.EventTarget.call(this),this.width=100,this.height=100,this.scaleMode=b||e.scaleModes.DEFAULT,this.hasLoaded=!1,this.source=a,a){if(this.source instanceof Image||this.source instanceof HTMLImageElement)if(this.source.complete)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,e.texturesToUpdate.push(this);else{var c=this;this.source.onload=function(){c.hasLoaded=!0,c.width=c.source.width,c.height=c.source.height,e.texturesToUpdate.push(c),c.dispatchEvent({type:"loaded",content:c})}}else this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,e.texturesToUpdate.push(this);this.imageUrl=null,this._powerOf2=!1,this.id=e.BaseTextureCacheIdGenerator++,this._glTextures=[]}},e.BaseTexture.prototype.constructor=e.BaseTexture,e.BaseTexture.prototype.destroy=function(){this.source instanceof Image&&(this.imageUrl in e.BaseTextureCache&&delete e.BaseTextureCache[this.imageUrl],this.imageUrl=null,this.source.src=null),this.source=null,e.texturesToDestroy.push(this)},e.BaseTexture.prototype.updateSourceImage=function(a){this.hasLoaded=!1,this.source.src=null,this.source.src=a},e.BaseTexture.fromImage=function(a,b,c){var d=e.BaseTextureCache[a];if(!d){var f=new Image;b&&(f.crossOrigin=""),f.src=a,d=new e.BaseTexture(f,c),d.imageUrl=a,e.BaseTextureCache[a]=d}return d},e.BaseTexture.fromCanvas=function(a,b){a._pixiId||(a._pixiId="canvas_"+e.TextureCacheIdGenerator++);var c=e.BaseTextureCache[a._pixiId];return c||(c=new e.BaseTexture(a,b),e.BaseTextureCache[a._pixiId]=c),c},e.TextureCache={},e.FrameCache={},e.TextureCacheIdGenerator=0,e.Texture=function(a,b){if(e.EventTarget.call(this),b||(this.noFrame=!0,b=new e.Rectangle(0,0,1,1)),a instanceof e.Texture&&(a=a.baseTexture),this.baseTexture=a,this.frame=b,this.trim=new e.Point,this.scope=this,a.hasLoaded)this.noFrame&&(b=new e.Rectangle(0,0,a.width,a.height)),this.setFrame(b);else{var c=this;a.addEventListener("loaded",function(){c.onBaseTextureLoaded()})}},e.Texture.prototype.constructor=e.Texture,e.Texture.prototype.onBaseTextureLoaded=function(){var a=this.baseTexture;a.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new e.Rectangle(0,0,a.width,a.height)),this.setFrame(this.frame),this.scope.dispatchEvent({type:"update",content:this})},e.Texture.prototype.destroy=function(a){a&&this.baseTexture.destroy()},e.Texture.prototype.setFrame=function(a){if(this.frame=a,this.width=a.width,this.height=a.height,a.x+a.width>this.baseTexture.width||a.y+a.height>this.baseTexture.height)throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.updateFrame=!0,e.Texture.frameUpdates.push(this)},e.Texture.prototype._updateWebGLuvs=function(){this._uvs||(this._uvs=new Float32Array(8));var a=this.frame,b=this.baseTexture.width,c=this.baseTexture.height;this._uvs[0]=a.x/b,this._uvs[1]=a.y/c,this._uvs[2]=(a.x+a.width)/b,this._uvs[3]=a.y/c,this._uvs[4]=(a.x+a.width)/b,this._uvs[5]=(a.y+a.height)/c,this._uvs[6]=a.x/b,this._uvs[7]=(a.y+a.height)/c},e.Texture.fromImage=function(a,b,c){var d=e.TextureCache[a];return d||(d=new e.Texture(e.BaseTexture.fromImage(a,b,c)),e.TextureCache[a]=d),d},e.Texture.fromFrame=function(a){var b=e.TextureCache[a];if(!b)throw new Error('The frameId "'+a+'" does not exist in the texture cache ');return b},e.Texture.fromCanvas=function(a,b){var c=e.BaseTexture.fromCanvas(a,b);return new e.Texture(c)},e.Texture.addTextureToCache=function(a,b){e.TextureCache[b]=a},e.Texture.removeTextureFromCache=function(a){var b=e.TextureCache[a];return e.TextureCache[a]=null,b},e.Texture.frameUpdates=[],e.RenderTexture=function(a,b,c){if(e.EventTarget.call(this),this.width=a||100,this.height=b||100,this.identityMatrix=e.mat3.create(),this.frame=new e.Rectangle(0,0,this.width,this.height),this.baseTexture=new e.BaseTexture,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.baseTexture._glTextures=[],this.baseTexture.hasLoaded=!0,this.renderer=c||e.defaultRenderer,this.renderer.type===e.WEBGL_RENDERER){var d=this.renderer.gl;this.textureBuffer=new e.FilterTexture(d,this.width,this.height),this.baseTexture._glTextures[d.id]=this.textureBuffer.texture,this.render=this.renderWebGL,this.projection=new e.Point(this.width/2,-this.height/2)}else this.render=this.renderCanvas,this.textureBuffer=new e.CanvasBuffer(this.width,this.height),this.baseTexture.source=this.textureBuffer.canvas;e.Texture.frameUpdates.push(this)},e.RenderTexture.prototype=Object.create(e.Texture.prototype),e.RenderTexture.prototype.constructor=e.RenderTexture,e.RenderTexture.prototype.resize=function(a,b){if(this.width=a,this.height=b,this.frame.width=this.width,this.frame.height=this.height,this.renderer.type===e.WEBGL_RENDERER){this.projection.x=this.width/2,this.projection.y=-this.height/2;var c=this.gl;c.bindTexture(c.TEXTURE_2D,this.baseTexture._glTextures[c.id]),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,this.width,this.height,0,c.RGBA,c.UNSIGNED_BYTE,null)}else this.textureBuffer.resize(this.width,this.height);e.Texture.frameUpdates.push(this)},e.RenderTexture.prototype.renderWebGL=function(a,b,c){var d=this.renderer.gl;d.colorMask(!0,!0,!0,!0),d.viewport(0,0,this.width,this.height),d.bindFramebuffer(d.FRAMEBUFFER,this.textureBuffer.frameBuffer),c&&this.textureBuffer.clear();var f=a.children,g=a.worldTransform;a.worldTransform=e.mat3.create(),a.worldTransform[4]=-1,a.worldTransform[5]=-2*this.projection.y,b&&(a.worldTransform[2]=b.x,a.worldTransform[5]-=b.y);for(var h=0,i=f.length;i>h;h++)f[h].updateTransform();e.WebGLRenderer.updateTextures(),this.renderer.renderDisplayObject(a,this.projection,this.textureBuffer.frameBuffer),a.worldTransform=g},e.RenderTexture.prototype.renderCanvas=function(a,b,c){var d=a.children;
-a.worldTransform=e.mat3.create(),b&&(a.worldTransform[2]=b.x,a.worldTransform[5]=b.y);for(var f=0,g=d.length;g>f;f++)d[f].updateTransform();c&&this.textureBuffer.clear();var h=this.textureBuffer.context;this.renderer.renderDisplayObject(a,h),h.setTransform(1,0,0,1,0,0)},e.AssetLoader=function(a,b){e.EventTarget.call(this),this.assetURLs=a,this.crossorigin=b,this.loadersByType={jpg:e.ImageLoader,jpeg:e.ImageLoader,png:e.ImageLoader,gif:e.ImageLoader,json:e.JsonLoader,atlas:e.AtlasLoader,anim:e.SpineLoader,xml:e.BitmapFontLoader,fnt:e.BitmapFontLoader}},e.AssetLoader.prototype.constructor=e.AssetLoader,e.AssetLoader.prototype._getDataType=function(a){var b="data:",c=a.slice(0,b.length).toLowerCase();if(c===b){var d=a.slice(b.length),e=d.indexOf(",");if(-1===e)return null;var f=d.slice(0,e).split(";")[0];return f&&"text/plain"!==f.toLowerCase()?f.split("/").pop().toLowerCase():"txt"}return null},e.AssetLoader.prototype.load=function(){function a(){b.onAssetLoaded()}var b=this;this.loadCount=this.assetURLs.length;for(var c=0;c0){if(f===g)this.atlas.meta.image.push(a[g]),c=this.atlas.meta.image.length-1,this.atlas.frames.push({}),b=-3;else if(b>0)if(b%7===1)null!=d&&(this.atlas.frames[c][d.name]=d),d={name:a[g],frame:{}};else{var j=a[g].split(" ");if(b%7===3)d.frame.x=Number(j[1].replace(",","")),d.frame.y=Number(j[2]);else if(b%7===4)d.frame.w=Number(j[1].replace(",","")),d.frame.h=Number(j[2]);else if(b%7===5){var k={x:0,y:0,w:Number(j[1].replace(",","")),h:Number(j[2])};k.w>d.frame.w||k.h>d.frame.h?(d.trimmed=!0,d.realSize=k):d.trimmed=!1}}b++}if(null!=d&&(this.atlas.frames[c][d.name]=d),this.atlas.meta.image.length>0){for(this.images=[],h=0;hthis.currentImageId?(this.currentImageId++,this.images[this.currentImageId].load()):(this.loaded=!0,this.dispatchEvent({type:"loaded",content:this}))},e.AtlasLoader.prototype.onError=function(){this.dispatchEvent({type:"error",content:this})},e.SpriteSheetLoader=function(a,b){e.EventTarget.call(this),this.url=a,this.crossorigin=b,this.baseUrl=a.replace(/[^\/]*$/,""),this.texture=null,this.frames={}},e.SpriteSheetLoader.prototype.constructor=e.SpriteSheetLoader,e.SpriteSheetLoader.prototype.load=function(){var a=this,b=new e.JsonLoader(this.url,this.crossorigin);b.addEventListener("loaded",function(b){a.json=b.content.json,a.onLoaded()}),b.load()},e.SpriteSheetLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},e.ImageLoader=function(a,b){e.EventTarget.call(this),this.texture=e.Texture.fromImage(a,b),this.frames=[]},e.ImageLoader.prototype.constructor=e.ImageLoader,e.ImageLoader.prototype.load=function(){if(this.texture.baseTexture.hasLoaded)this.onLoaded();else{var a=this;this.texture.baseTexture.addEventListener("loaded",function(){a.onLoaded()})}},e.ImageLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},e.ImageLoader.prototype.loadFramedSpriteSheet=function(a,b,c){this.frames=[];for(var d=Math.floor(this.texture.width/a),f=Math.floor(this.texture.height/b),g=0,h=0;f>h;h++)for(var i=0;d>i;i++,g++){var j=new e.Texture(this.texture,{x:i*a,y:h*b,width:a,height:b});this.frames.push(j),c&&(e.TextureCache[c+"-"+g]=j)}if(this.texture.baseTexture.hasLoaded)this.onLoaded();else{var k=this;this.texture.baseTexture.addEventListener("loaded",function(){k.onLoaded()})}},e.BitmapFontLoader=function(a,b){e.EventTarget.call(this),this.url=a,this.crossorigin=b,this.baseUrl=a.replace(/[^\/]*$/,""),this.texture=null},e.BitmapFontLoader.prototype.constructor=e.BitmapFontLoader,e.BitmapFontLoader.prototype.load=function(){this.ajaxRequest=new XMLHttpRequest;var a=this;this.ajaxRequest.onreadystatechange=function(){a.onXMLLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/xml"),this.ajaxRequest.send(null)},e.BitmapFontLoader.prototype.onXMLLoaded=function(){if(4===this.ajaxRequest.readyState&&(200===this.ajaxRequest.status||-1===window.location.protocol.indexOf("http"))){var a=this.ajaxRequest.responseXML;if(!a||/MSIE 9/i.test(navigator.userAgent)||navigator.isCocoonJS)if("function"==typeof window.DOMParser){var b=new DOMParser;a=b.parseFromString(this.ajaxRequest.responseText,"text/xml")}else{var c=document.createElement("div");c.innerHTML=this.ajaxRequest.responseText,a=c}var d=this.baseUrl+a.getElementsByTagName("page")[0].getAttribute("file"),f=new e.ImageLoader(d,this.crossorigin);this.texture=f.texture.baseTexture;var g={},h=a.getElementsByTagName("info")[0],i=a.getElementsByTagName("common")[0];g.font=h.getAttribute("face"),g.size=parseInt(h.getAttribute("size"),10),g.lineHeight=parseInt(i.getAttribute("lineHeight"),10),g.chars={};for(var j=a.getElementsByTagName("char"),k=0;k=c&&a<=c+this.width){var d=this.y;if(b>=d&&b<=d+this.height)return!0}return!1},d.Rectangle.prototype.constructor=d.Rectangle,d.EmptyRectangle=new d.Rectangle(0,0,0,0),d.Polygon=function(a){if(a instanceof Array||(a=Array.prototype.slice.call(arguments)),"number"==typeof a[0]){for(var b=[],c=0,e=a.length;e>c;c+=2)b.push(new d.Point(a[c],a[c+1]));a=b}this.points=a},d.Polygon.prototype.clone=function(){for(var a=[],b=0;bb!=i>b&&(h-f)*(b-g)/(i-g)+f>a;j&&(c=!c)}return c},d.Polygon.prototype.constructor=d.Polygon,d.Circle=function(a,b,c){this.x=a||0,this.y=b||0,this.radius=c||0},d.Circle.prototype.clone=function(){return new d.Circle(this.x,this.y,this.radius)},d.Circle.prototype.contains=function(a,b){if(this.radius<=0)return!1;var c=this.x-a,d=this.y-b,e=this.radius*this.radius;return c*=c,d*=d,e>=c+d},d.Circle.prototype.constructor=d.Circle,d.Ellipse=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},d.Ellipse.prototype.clone=function(){return new d.Ellipse(this.x,this.y,this.width,this.height)},d.Ellipse.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=(a-this.x)/this.width-.5,d=(b-this.y)/this.height-.5;return c*=c,d*=d,.25>c+d},d.Ellipse.prototype.getBounds=function(){return new d.Rectangle(this.x,this.y,this.width,this.height)},d.Ellipse.prototype.constructor=d.Ellipse,d.determineMatrixArrayType=function(){return"undefined"!=typeof Float32Array?Float32Array:Array},d.Matrix=d.determineMatrixArrayType(),d.mat3={},d.mat3.create=function(){var a=new d.Matrix(9);return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},d.mat3.identity=function(a){return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=1,a[5]=0,a[6]=0,a[7]=0,a[8]=1,a},d.mat3.multiply=function(a,b,c){c||(c=a);var d=a[0],e=a[1],f=a[2],g=a[3],h=a[4],i=a[5],j=a[6],k=a[7],l=a[8],m=b[0],n=b[1],o=b[2],p=b[3],q=b[4],r=b[5],s=b[6],t=b[7],u=b[8];return c[0]=m*d+n*g+o*j,c[1]=m*e+n*h+o*k,c[2]=m*f+n*i+o*l,c[3]=p*d+q*g+r*j,c[4]=p*e+q*h+r*k,c[5]=p*f+q*i+r*l,c[6]=s*d+t*g+u*j,c[7]=s*e+t*h+u*k,c[8]=s*f+t*i+u*l,c},d.mat3.clone=function(a){var b=new d.Matrix(9);return b[0]=a[0],b[1]=a[1],b[2]=a[2],b[3]=a[3],b[4]=a[4],b[5]=a[5],b[6]=a[6],b[7]=a[7],b[8]=a[8],b},d.mat3.transpose=function(a,b){if(!b||a===b){var c=a[1],d=a[2],e=a[5];return a[1]=a[3],a[2]=a[6],a[3]=c,a[5]=a[7],a[6]=d,a[7]=e,a}return b[0]=a[0],b[1]=a[3],b[2]=a[6],b[3]=a[1],b[4]=a[4],b[5]=a[7],b[6]=a[2],b[7]=a[5],b[8]=a[8],b},d.mat4={},d.mat3.toMat4=function(a,b){return b||(b=d.mat4.create()),b[15]=1,b[14]=0,b[13]=0,b[12]=0,b[11]=0,b[10]=a[8],b[9]=a[7],b[8]=a[6],b[7]=0,b[6]=a[5],b[5]=a[4],b[4]=a[3],b[3]=0,b[2]=a[2],b[1]=a[1],b[0]=a[0],b},d.mat4.create=function(){var a=new d.Matrix(16);return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a},d.mat4.transpose=function(a,b){if(!b||a===b){var c=a[1],d=a[2],e=a[3],f=a[6],g=a[7],h=a[11];return a[1]=a[4],a[2]=a[8],a[3]=a[12],a[4]=c,a[6]=a[9],a[7]=a[13],a[8]=d,a[9]=f,a[11]=a[14],a[12]=e,a[13]=g,a[14]=h,a}return b[0]=a[0],b[1]=a[4],b[2]=a[8],b[3]=a[12],b[4]=a[1],b[5]=a[5],b[6]=a[9],b[7]=a[13],b[8]=a[2],b[9]=a[6],b[10]=a[10],b[11]=a[14],b[12]=a[3],b[13]=a[7],b[14]=a[11],b[15]=a[15],b},d.mat4.multiply=function(a,b,c){c||(c=a);var d=a[0],e=a[1],f=a[2],g=a[3],h=a[4],i=a[5],j=a[6],k=a[7],l=a[8],m=a[9],n=a[10],o=a[11],p=a[12],q=a[13],r=a[14],s=a[15],t=b[0],u=b[1],v=b[2],w=b[3];return c[0]=t*d+u*h+v*l+w*p,c[1]=t*e+u*i+v*m+w*q,c[2]=t*f+u*j+v*n+w*r,c[3]=t*g+u*k+v*o+w*s,t=b[4],u=b[5],v=b[6],w=b[7],c[4]=t*d+u*h+v*l+w*p,c[5]=t*e+u*i+v*m+w*q,c[6]=t*f+u*j+v*n+w*r,c[7]=t*g+u*k+v*o+w*s,t=b[8],u=b[9],v=b[10],w=b[11],c[8]=t*d+u*h+v*l+w*p,c[9]=t*e+u*i+v*m+w*q,c[10]=t*f+u*j+v*n+w*r,c[11]=t*g+u*k+v*o+w*s,t=b[12],u=b[13],v=b[14],w=b[15],c[12]=t*d+u*h+v*l+w*p,c[13]=t*e+u*i+v*m+w*q,c[14]=t*f+u*j+v*n+w*r,c[15]=t*g+u*k+v*o+w*s,c},d.identityMatrix=d.mat3.create(),d.tempMatrix=d.mat3.create(),d.DisplayObject=function(){this.last=this,this.first=this,this.position=new d.Point,this.scale=new d.Point(1,1),this.pivot=new d.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.hitArea=null,this.buttonMode=!1,this.renderable=!1,this.parent=null,this.stage=null,this.worldAlpha=1,this._interactive=!1,this.defaultCursor="pointer",this.worldTransform=d.mat3.create(),this.localTransform=d.mat3.create(),this.color=[],this.dynamic=!0,this._sr=0,this._cr=1,this.filterArea=new d.Rectangle(0,0,1,1),this._bounds=new d.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null},d.DisplayObject.prototype.constructor=d.DisplayObject,d.DisplayObject.prototype.setInteractive=function(a){this.interactive=a},Object.defineProperty(d.DisplayObject.prototype,"interactive",{get:function(){return this._interactive},set:function(a){this._interactive=a,this.stage&&(this.stage.dirty=!0)}}),Object.defineProperty(d.DisplayObject.prototype,"worldVisible",{get:function(){var a=this;do{if(!a.visible)return!1;a=a.parent}while(a);return!0}}),Object.defineProperty(d.DisplayObject.prototype,"mask",{get:function(){return this._mask},set:function(a){this._mask&&(this._mask.isMask=!1),this._mask=a,this._mask&&(this._mask.isMask=!0)}}),Object.defineProperty(d.DisplayObject.prototype,"filters",{get:function(){return this._filters},set:function(a){if(a){for(var b=[],c=0;c=0&&b<=this.children.length))throw new Error(a+" The index "+b+" supplied is out of bounds "+this.children.length);a.parent&&a.parent.removeChild(a),a.parent=this,this.children.splice(b,0,a),this.stage&&a.setStageReference(this.stage)},d.DisplayObjectContainer.prototype.swapChildren=function(a,b){if(a!==b){var c=this.children.indexOf(a),d=this.children.indexOf(b);if(0>c||0>d)throw new Error("swapChildren: Both the supplied DisplayObjects must be a child of the caller.");this.children[c]=b,this.children[d]=a}},d.DisplayObjectContainer.prototype.getChildAt=function(a){if(a>=0&&aa;a++)this.children[a].updateTransform()}},d.DisplayObjectContainer.prototype.getBounds=function(){if(0===this.children.length)return d.EmptyRectangle;for(var a,b,c,e=1/0,f=1/0,g=-1/0,h=-1/0,i=0,j=this.children.length;j>i;i++){var k=this.children[i];k.visible&&(a=this.children[i].getBounds(),e=eb?g:b,h=h>c?h:c)}var l=this._bounds;return l.x=e,l.y=f,l.width=g-e,l.height=h-f,l},d.DisplayObjectContainer.prototype.setStageReference=function(a){this.stage=a,this._interactive&&(this.stage.dirty=!0);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d.setStageReference(a)}},d.DisplayObjectContainer.prototype.removeStageReference=function(){for(var a=0,b=this.children.length;b>a;a++){var c=this.children[a];c.removeStageReference()}this._interactive&&(this.stage.dirty=!0),this.stage=null},d.DisplayObjectContainer.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){var b,c;if(this._mask||this._filters){for(this._mask&&(a.spriteBatch.stop(),a.maskManager.pushMask(this.mask,a),a.spriteBatch.start()),this._filters&&(a.spriteBatch.flush(),a.filterManager.pushFilter(this._filterBlock)),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);a.spriteBatch.stop(),this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),a.spriteBatch.start()}else for(b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},d.DisplayObjectContainer.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){this._mask&&a.maskManager.pushMask(this._mask,a.context);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d._renderCanvas(a)}this._mask&&a.maskManager.popMask(a.context)}},d.Sprite=function(a){d.DisplayObjectContainer.call(this),this.anchor=new d.Point,this.texture=a,this._width=0,this._height=0,this.tint=16777215,this.blendMode=d.blendModes.NORMAL,a.baseTexture.hasLoaded?this.onTextureUpdate():(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},d.Sprite.prototype=Object.create(d.DisplayObjectContainer.prototype),d.Sprite.prototype.constructor=d.Sprite,Object.defineProperty(d.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(a){this.scale.x=a/this.texture.frame.width,this._width=a}}),Object.defineProperty(d.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(a){this.scale.y=a/this.texture.frame.height,this._height=a}}),d.Sprite.prototype.setTexture=function(a){this.texture.baseTexture!==a.baseTexture?(this.textureChange=!0,this.texture=a):this.texture=a,this.cachedTint=16777215,this.updateFrame=!0},d.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height),this.updateFrame=!0},d.Sprite.prototype.getBounds=function(){var a=this.texture.frame.width,b=this.texture.frame.height,c=a*(1-this.anchor.x),d=a*-this.anchor.x,e=b*(1-this.anchor.y),f=b*-this.anchor.y,g=this.worldTransform,h=g[0],i=g[3],j=g[1],k=g[4],l=g[2],m=g[5],n=h*d+j*f+l,o=k*f+i*d+m,p=h*c+j*f+l,q=k*f+i*c+m,r=h*c+j*e+l,s=k*e+i*c+m,t=h*d+j*e+l,u=k*e+i*d+m,v=-1/0,w=-1/0,x=1/0,y=1/0;x=x>n?n:x,x=x>p?p:x,x=x>r?r:x,x=x>t?t:x,y=y>o?o:y,y=y>q?q:y,y=y>s?s:y,y=y>u?u:y,v=n>v?n:v,v=p>v?p:v,v=r>v?r:v,v=t>v?t:v,w=o>w?o:w,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w;var z=this._bounds;return z.x=x,z.width=v-x,z.y=y,z.height=w-y,this._currentBounds=z,z},d.Sprite.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){var b,c;if(this._mask||this._filters){var d=a.spriteBatch;for(this._mask&&(d.stop(),a.maskManager.pushMask(this.mask,a),d.start()),this._filters&&(d.flush(),a.filterManager.pushFilter(this._filterBlock)),d.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);d.stop(),this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),d.start()}else for(a.spriteBatch.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},d.Sprite.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){var b=this.texture.frame,c=a.context,e=this.texture;if(this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=d.blendModesCanvas[a.currentBlendMode]),this._mask&&a.maskManager.pushMask(this._mask,a.context),b&&b.width&&b.height&&e.baseTexture.source){c.globalAlpha=this.worldAlpha;var f=this.worldTransform;if(c.setTransform(f[0],f[3],f[1],f[4],f[2],f[5]),a.smoothProperty&&a.scaleMode!==this.texture.baseTexture.scaleMode&&(a.scaleMode=this.texture.baseTexture.scaleMode,c[a.smoothProperty]=a.scaleMode===d.scaleModes.LINEAR),16777215!==this.tint){if(this.cachedTint!==this.tint){if(!e.baseTexture.hasLoaded)return;this.cachedTint=this.tint,this.tintedTexture=d.CanvasTinter.getTintedTexture(this,this.tint)}c.drawImage(this.tintedTexture,0,0,b.width,b.height,this.anchor.x*-b.width,this.anchor.y*-b.height,b.width,b.height)}else if(e.trimmed){var g=e.trim;c.drawImage(this.texture.baseTexture.source,b.x,b.y,b.width,b.height,g.x-this.anchor.x*g.realWidth,g.y-this.anchor.y*g.realHeight,b.width,b.height)}else c.drawImage(this.texture.baseTexture.source,b.x,b.y,b.width,b.height,this.anchor.x*-b.width,this.anchor.y*-b.height,b.width,b.height)}for(var h=0,i=this.children.length;i>h;h++){var j=this.children[h];j._renderCanvas(a)}this._mask&&a.maskManager.popMask(a.context)}},d.Sprite.fromFrame=function(a){var b=d.TextureCache[a];if(!b)throw new Error('The frameId "'+a+'" does not exist in the texture cache'+this);return new d.Sprite(b)},d.Sprite.fromImage=function(a){var b=d.Texture.fromImage(a);return new d.Sprite(b)},d.SpriteBatch=function(a){d.DisplayObjectContainer.call(this),this.textureThing=a,this.ready=!1},d.SpriteBatch.prototype=Object.create(d.DisplayObjectContainer.prototype),d.SpriteBatch.constructor=d.SpriteBatch,d.SpriteBatch.prototype.initWebGL=function(a){this.fastSpriteBatch=new d.WebGLFastSpriteBatch(a),this.ready=!0},d.SpriteBatch.prototype.updateTransform=function(){d.DisplayObject.prototype.updateTransform.call(this)},d.SpriteBatch.prototype._renderWebGL=function(a){!this.visible||this.alpha<=0||!this.children.length||(this.ready||this.initWebGL(a.gl),a.spriteBatch.stop(),a.shaderManager.activateShader(a.shaderManager.fastShader),this.fastSpriteBatch.begin(this,a),this.fastSpriteBatch.render(this),a.shaderManager.activateShader(a.shaderManager.defaultShader),a.spriteBatch.start())},d.SpriteBatch.prototype._renderCanvas=function(a){var b=a.context;b.globalAlpha=this.worldAlpha;var c=this.worldTransform;b.setTransform(c[0],c[3],c[1],c[4],c[2],c[5]),b.save();for(var e=0;e=this.textures.length&&(this.gotoAndStop(this.textures.length-1),this.onComplete&&this.onComplete())}},d.FilterBlock=function(){this.visible=!0,this.renderable=!0},d.Text=function(a,b){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),d.Sprite.call(this,d.Texture.fromCanvas(this.canvas)),this.setText(a),this.setStyle(b),this.updateText(),this.dirty=!1},d.Text.prototype=Object.create(d.Sprite.prototype),d.Text.prototype.constructor=d.Text,d.Text.prototype.setStyle=function(a){a=a||{},a.font=a.font||"bold 20pt Arial",a.fill=a.fill||"black",a.align=a.align||"left",a.stroke=a.stroke||"black",a.strokeThickness=a.strokeThickness||0,a.wordWrap=a.wordWrap||!1,a.wordWrapWidth=a.wordWrapWidth||100,this.style=a,this.dirty=!0},d.Text.prototype.setText=function(a){this.text=a.toString()||" ",this.dirty=!0},d.Text.prototype.updateText=function(){this.context.font=this.style.font;var a=this.text;this.style.wordWrap&&(a=this.wordWrap(this.text));for(var b=a.split(/(?:\r\n|\r|\n)/),c=[],e=0,f=0;fe?(g>0&&(b+="\n"),b+=f[g]+" ",e=this.style.wordWrapWidth-h):(e-=i,b+=f[g]+" ")}b+="\n"}return b},d.Text.prototype.destroy=function(a){a&&this.texture.destroy()},d.Text.heightCache={},d.BitmapText=function(a,b){d.DisplayObjectContainer.call(this),this.setText(a),this.setStyle(b),this.updateText(),this.dirty=!1},d.BitmapText.prototype=Object.create(d.DisplayObjectContainer.prototype),d.BitmapText.prototype.constructor=d.BitmapText,d.BitmapText.prototype.setText=function(a){this.text=a||" ",this.dirty=!0},d.BitmapText.prototype.setStyle=function(a){a=a||{},a.align=a.align||"left",this.style=a;var b=a.font.split(" ");this.fontName=b[b.length-1],this.fontSize=b.length>=2?parseInt(b[b.length-2],10):d.BitmapText.fonts[this.fontName].size,this.dirty=!0},d.BitmapText.prototype.updateText=function(){for(var a=d.BitmapText.fonts[this.fontName],b=new d.Point,c=null,e=[],f=0,g=[],h=0,i=this.fontSize/a.size,j=0;j=j;j++){var n=0;"right"===this.style.align?n=f-g[j]:"center"===this.style.align&&(n=(f-g[j])/2),m.push(n)}for(j=0;j0;)this.removeChild(this.getChildAt(0));this.updateText(),this.dirty=!1}d.DisplayObjectContainer.prototype.updateTransform.call(this)},d.BitmapText.fonts={},d.InteractionData=function(){this.global=new d.Point,this.local=new d.Point,this.target=null,this.originalEvent=null},d.InteractionData.prototype.getLocalPosition=function(a){var b=a.worldTransform,c=this.global,e=b[0],f=b[1],g=b[2],h=b[3],i=b[4],j=b[5],k=1/(e*i+f*-h);return new d.Point(i*k*c.x+-f*k*c.y+(j*f-g*i)*k,e*k*c.y+-h*k*c.x+(-j*e+g*h)*k)},d.InteractionData.prototype.constructor=d.InteractionData,d.InteractionManager=function(a){this.stage=a,this.mouse=new d.InteractionData,this.touchs={},this.tempPoint=new d.Point,this.mouseoverEnabled=!0,this.pool=[],this.interactiveItems=[],this.interactionDOMElement=null,this.onMouseMove=this.onMouseMove.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.last=0},d.InteractionManager.prototype.constructor=d.InteractionManager,d.InteractionManager.prototype.collectInteractiveSprite=function(a,b){for(var c=a.children,d=c.length,e=d-1;e>=0;e--){var f=c[e];f.interactive?(b.interactiveChildren=!0,this.interactiveItems.push(f),f.children.length>0&&this.collectInteractiveSprite(f,f)):(f.__iParent=null,f.children.length>0&&this.collectInteractiveSprite(f,b))}},d.InteractionManager.prototype.setTarget=function(a){this.target=a,null===this.interactionDOMElement&&this.setTargetDomElement(a.view),document.body.addEventListener("mouseup",this.onMouseUp,!0)},d.InteractionManager.prototype.setTargetDomElement=function(a){null!==this.interactionDOMElement&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]="",this.interactionDOMElement.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0)),window.navigator.msPointerEnabled&&(a.style["-ms-content-zooming"]="none",a.style["-ms-touch-action"]="none"),this.interactionDOMElement=a,a.addEventListener("mousemove",this.onMouseMove,!0),a.addEventListener("mousedown",this.onMouseDown,!0),a.addEventListener("mouseout",this.onMouseOut,!0),a.addEventListener("touchstart",this.onTouchStart,!0),a.addEventListener("touchend",this.onTouchEnd,!0),a.addEventListener("touchmove",this.onTouchMove,!0)},d.InteractionManager.prototype.update=function(){if(this.target){var a=Date.now(),b=a-this.last;if(b=b*d.INTERACTION_FREQUENCY/1e3,!(1>b)){this.last=a;var c=0;if(this.dirty){this.dirty=!1;var e=this.interactiveItems.length;for(c=0;e>c;c++)this.interactiveItems[c].interactiveChildren=!1;this.interactiveItems=[],this.stage.interactive&&this.interactiveItems.push(this.stage),this.collectInteractiveSprite(this.stage,this.stage)}var f=this.interactiveItems.length;this.interactionDOMElement.style.cursor="inherit";var g=!1;for(c=0;f>c;c++){var h=this.interactiveItems[c];h.__hit=this.hitTest(h,this.mouse),this.mouse.target=h,h.__hit&&!g?(h.buttonMode&&(this.interactionDOMElement.style.cursor=h.defaultCursor),h.interactiveChildren||(g=!0),h.__isOver||(h.mouseover&&h.mouseover(this.mouse),h.__isOver=!0)):h.__isOver&&(h.mouseout&&h.mouseout(this.mouse),h.__isOver=!1)}}}},d.InteractionManager.prototype.onMouseMove=function(a){this.mouse.originalEvent=a||window.event;var b=this.interactionDOMElement.getBoundingClientRect();this.mouse.global.x=(a.clientX-b.left)*(this.target.width/b.width),this.mouse.global.y=(a.clientY-b.top)*(this.target.height/b.height);for(var c=this.interactiveItems.length,d=0;c>d;d++){var e=this.interactiveItems[d];e.mousemove&&e.mousemove(this.mouse)}},d.InteractionManager.prototype.onMouseDown=function(a){this.mouse.originalEvent=a||window.event,d.AUTO_PREVENT_DEFAULT&&this.mouse.originalEvent.preventDefault();for(var b=this.interactiveItems.length,c=0;b>c;c++){var e=this.interactiveItems[c];if((e.mousedown||e.click)&&(e.__mouseIsDown=!0,e.__hit=this.hitTest(e,this.mouse),e.__hit&&(e.mousedown&&e.mousedown(this.mouse),e.__isDown=!0,!e.interactiveChildren)))break}},d.InteractionManager.prototype.onMouseOut=function(){var a=this.interactiveItems.length;this.interactionDOMElement.style.cursor="inherit";for(var b=0;a>b;b++){var c=this.interactiveItems[b];c.__isOver&&(this.mouse.target=c,c.mouseout&&c.mouseout(this.mouse),c.__isOver=!1)}},d.InteractionManager.prototype.onMouseUp=function(a){this.mouse.originalEvent=a||window.event;for(var b=this.interactiveItems.length,c=!1,d=0;b>d;d++){var e=this.interactiveItems[d];e.__hit=this.hitTest(e,this.mouse),e.__hit&&!c?(e.mouseup&&e.mouseup(this.mouse),e.__isDown&&e.click&&e.click(this.mouse),e.interactiveChildren||(c=!0)):e.__isDown&&e.mouseupoutside&&e.mouseupoutside(this.mouse),e.__isDown=!1}},d.InteractionManager.prototype.hitTest=function(a,b){var c=b.global;if(!a.worldVisible)return!1;var e=a instanceof d.Sprite,f=a.worldTransform,g=f[0],h=f[1],i=f[2],j=f[3],k=f[4],l=f[5],m=1/(g*k+h*-j),n=k*m*c.x+-h*m*c.y+(l*h-i*k)*m,o=g*m*c.y+-j*m*c.x+(-l*g+i*j)*m;if(b.target=a,a.hitArea&&a.hitArea.contains)return a.hitArea.contains(n,o)?(b.target=a,!0):!1;if(e){var p,q=a.texture.frame.width,r=a.texture.frame.height,s=-q*a.anchor.x;if(n>s&&s+q>n&&(p=-r*a.anchor.y,o>p&&p+r>o))return b.target=a,!0}for(var t=a.children.length,u=0;t>u;u++){var v=a.children[u],w=this.hitTest(v,b);if(w)return b.target=a,!0}return!1},d.InteractionManager.prototype.onTouchMove=function(a){var b,c=this.interactionDOMElement.getBoundingClientRect(),d=a.changedTouches,e=0;for(e=0;ee;e++){var h=this.interactiveItems[e];h.touchmove&&h.touchmove(b)}},d.InteractionManager.prototype.onTouchStart=function(a){var b=this.interactionDOMElement.getBoundingClientRect();d.AUTO_PREVENT_DEFAULT&&a.preventDefault();for(var c=a.changedTouches,e=0;ei;i++){var j=this.interactiveItems[i];if((j.touchstart||j.tap)&&(j.__hit=this.hitTest(j,g),j.__hit&&(j.touchstart&&j.touchstart(g),j.__isDown=!0,j.__touchData=g,!j.interactiveChildren)))break}}},d.InteractionManager.prototype.onTouchEnd=function(a){for(var b=this.interactionDOMElement.getBoundingClientRect(),c=a.changedTouches,d=0;di;i++){var j=this.interactiveItems[i],k=j.__touchData;j.__hit=this.hitTest(j,f),k===f&&(f.originalEvent=a||window.event,(j.touchend||j.tap)&&(j.__hit&&!g?(j.touchend&&j.touchend(f),j.__isDown&&j.tap&&j.tap(f),j.interactiveChildren||(g=!0)):j.__isDown&&j.touchendoutside&&j.touchendoutside(f),j.__isDown=!1),j.__touchData=null)}this.pool.push(f),this.touchs[e.identifier]=null}},d.Stage=function(a){d.DisplayObjectContainer.call(this),this.worldTransform=d.mat3.create(),this.interactive=!0,this.interactionManager=new d.InteractionManager(this),this.dirty=!0,this.stage=this,this.stage.hitArea=new d.Rectangle(0,0,1e5,1e5),this.setBackgroundColor(a)},d.Stage.prototype=Object.create(d.DisplayObjectContainer.prototype),d.Stage.prototype.constructor=d.Stage,d.Stage.prototype.setInteractionDelegate=function(a){this.interactionManager.setTargetDomElement(a)},d.Stage.prototype.updateTransform=function(){this.worldAlpha=1;for(var a=0,b=this.children.length;b>a;a++)this.children[a].updateTransform();this.dirty&&(this.dirty=!1,this.interactionManager.dirty=!0),this.interactive&&this.interactionManager.update()},d.Stage.prototype.setBackgroundColor=function(a){this.backgroundColor=a||0,this.backgroundColorSplit=d.hex2rgb(this.backgroundColor);var b=this.backgroundColor.toString(16);b="000000".substr(0,6-b.length)+b,this.backgroundColorString="#"+b},d.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global};for(var e=0,f=["ms","moz","webkit","o"],h=0;h>16&255)/255,(a>>8&255)/255,(255&a)/255]},d.rgb2hex=function(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]},"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var a=Array.prototype.slice;return function(b){function c(){var f=e.concat(a.call(arguments));d.apply(this instanceof c?this:b,f)}var d=this,e=a.call(arguments,1);if("function"!=typeof d)throw new TypeError;return c.prototype=function f(a){return a&&(f.prototype=a),this instanceof f?void 0:new f}(d.prototype),c}}()),d.AjaxRequest=function(){var a=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new window.XMLHttpRequest:!1;for(var b=0;b0&&0===(a&a-1))return a;for(var b=1;a>b;)b<<=1;return b},d.EventTarget=function(){var a={};this.addEventListener=this.on=function(b,c){void 0===a[b]&&(a[b]=[]),-1===a[b].indexOf(c)&&a[b].push(c)},this.dispatchEvent=this.emit=function(b){if(a[b.type]&&a[b.type].length)for(var c=0,d=a[b.type].length;d>c;c++)a[b.type][c](b)},this.removeEventListener=this.off=function(b,c){var d=a[b].indexOf(c);-1!==d&&a[b].splice(d,1)},this.removeAllEventListeners=function(b){var c=a[b];c&&(c.length=0)}},d.autoDetectRenderer=function(a,b,c,e,f){a||(a=800),b||(b=600);var g=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}();return g?new d.WebGLRenderer(a,b,c,e,f):new d.CanvasRenderer(a,b,c,e)},d.PolyK={},d.PolyK.Triangulate=function(a){var b=!0,c=a.length>>1;if(3>c)return[];for(var e=[],f=[],g=0;c>g;g++)f.push(g);g=0;for(var h=c;h>3;){var i=f[(g+0)%h],j=f[(g+1)%h],k=f[(g+2)%h],l=a[2*i],m=a[2*i+1],n=a[2*j],o=a[2*j+1],p=a[2*k],q=a[2*k+1],r=!1;if(d.PolyK._convex(l,m,n,o,p,q,b)){r=!0;for(var s=0;h>s;s++){var t=f[s];if(t!==i&&t!==j&&t!==k&&d.PolyK._PointInTriangle(a[2*t],a[2*t+1],l,m,n,o,p,q)){r=!1;break}}}if(r)e.push(i,j,k),f.splice((g+1)%h,1),h--,g=0;else if(g++>3*h){if(!b)return window.console.log("PIXI Warning: shape too complex to fill"),[];for(e=[],f=[],g=0;c>g;g++)f.push(g);g=0,h=c,b=!1}}return e.push(f[0],f[1],f[2]),e},d.PolyK._PointInTriangle=function(a,b,c,d,e,f,g,h){var i=g-c,j=h-d,k=e-c,l=f-d,m=a-c,n=b-d,o=i*i+j*j,p=i*k+j*l,q=i*m+j*n,r=k*k+l*l,s=k*m+l*n,t=1/(o*r-p*p),u=(r*q-p*s)*t,v=(o*s-p*q)*t;return u>=0&&v>=0&&1>u+v},d.PolyK._convex=function(a,b,c,d,e,f,g){return(b-d)*(e-c)+(c-a)*(f-d)>=0===g},d.initDefaultShaders=function(){},d.CompileVertexShader=function(a,b){return d._CompileShader(a,b,a.VERTEX_SHADER)},d.CompileFragmentShader=function(a,b){return d._CompileShader(a,b,a.FRAGMENT_SHADER)},d._CompileShader=function(a,b,c){var d=b.join("\n"),e=a.createShader(c);return a.shaderSource(e,d),a.compileShader(e),a.getShaderParameter(e,a.COMPILE_STATUS)?e:(window.console.log(a.getShaderInfoLog(e)),null)},d.compileProgram=function(a,b,c){var e=d.CompileFragmentShader(a,c),f=d.CompileVertexShader(a,b),g=a.createProgram();return a.attachShader(g,f),a.attachShader(g,e),a.linkProgram(g),a.getProgramParameter(g,a.LINK_STATUS)||window.console.log("Could not initialise shaders"),g},d.PixiShader=function(a){this.gl=a,this.program=null,this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"],this.textureCount=0,this.attributes=[],this.init()},d.PixiShader.prototype.init=function(){var a=this.gl,b=d.compileProgram(a,this.vertexSrc||d.PixiShader.defaultVertexSrc,this.fragmentSrc);a.useProgram(b),this.uSampler=a.getUniformLocation(b,"uSampler"),this.projectionVector=a.getUniformLocation(b,"projectionVector"),this.offsetVector=a.getUniformLocation(b,"offsetVector"),this.dimensions=a.getUniformLocation(b,"dimensions"),this.aVertexPosition=a.getAttribLocation(b,"aVertexPosition"),this.aTextureCoord=a.getAttribLocation(b,"aTextureCoord"),this.colorAttribute=a.getAttribLocation(b,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aTextureCoord,this.colorAttribute];for(var c in this.uniforms)this.uniforms[c].uniformLocation=a.getUniformLocation(b,c);this.initUniforms(),this.program=b},d.PixiShader.prototype.initUniforms=function(){this.textureCount=1;var a,b=this.gl;for(var c in this.uniforms){a=this.uniforms[c];var d=a.type;"sampler2D"===d?(a._init=!1,null!==a.value&&this.initSampler2D(a)):"mat2"===d||"mat3"===d||"mat4"===d?(a.glMatrix=!0,a.glValueLength=1,"mat2"===d?a.glFunc=b.uniformMatrix2fv:"mat3"===d?a.glFunc=b.uniformMatrix3fv:"mat4"===d&&(a.glFunc=b.uniformMatrix4fv)):(a.glFunc=b["uniform"+d],a.glValueLength="2f"===d||"2i"===d?2:"3f"===d||"3i"===d?3:"4f"===d||"4i"===d?4:1)}},d.PixiShader.prototype.initSampler2D=function(a){if(a.value&&a.value.baseTexture&&a.value.baseTexture.hasLoaded){var b=this.gl;if(b.activeTexture(b["TEXTURE"+this.textureCount]),b.bindTexture(b.TEXTURE_2D,a.value.baseTexture._glTexture),a.textureData){var c=a.textureData,d=c.magFilter?c.magFilter:b.LINEAR,e=c.minFilter?c.minFilter:b.LINEAR,f=c.wrapS?c.wrapS:b.CLAMP_TO_EDGE,g=c.wrapT?c.wrapT:b.CLAMP_TO_EDGE,h=c.luminance?b.LUMINANCE:b.RGBA;if(c.repeat&&(f=b.REPEAT,g=b.REPEAT),b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,!1),c.width){var i=c.width?c.width:512,j=c.height?c.height:2,k=c.border?c.border:0;b.texImage2D(b.TEXTURE_2D,0,h,i,j,k,h,b.UNSIGNED_BYTE,null)}else b.texImage2D(b.TEXTURE_2D,0,h,b.RGBA,b.UNSIGNED_BYTE,a.value.baseTexture.source);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,d),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,e),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,f),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,g)}b.uniform1i(a.uniformLocation,this.textureCount),a._init=!0,this.textureCount++}},d.PixiShader.prototype.syncUniforms=function(){this.textureCount=1;var a,b=this.gl;for(var c in this.uniforms)a=this.uniforms[c],1===a.glValueLength?a.glMatrix===!0?a.glFunc.call(b,a.uniformLocation,a.transpose,a.value):a.glFunc.call(b,a.uniformLocation,a.value):2===a.glValueLength?a.glFunc.call(b,a.uniformLocation,a.value.x,a.value.y):3===a.glValueLength?a.glFunc.call(b,a.uniformLocation,a.value.x,a.value.y,a.value.z):4===a.glValueLength?a.glFunc.call(b,a.uniformLocation,a.value.x,a.value.y,a.value.z,a.value.w):"sampler2D"===a.type&&(a._init?(b.activeTexture(b["TEXTURE"+this.textureCount]),b.bindTexture(b.TEXTURE_2D,a.value.baseTexture._glTextures[b.id]||d.createWebGLTexture(a.value.baseTexture,b)),b.uniform1i(a.uniformLocation,this.textureCount),this.textureCount++):this.initSampler2D(a))},d.PixiShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},d.PixiShader.defaultVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec2 aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","varying vec2 vTextureCoord;","varying vec4 vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;"," vColor = vec4(color * aColor.x, aColor.x);","}"],d.PixiFastShader=function(a){this.gl=a,this.program=null,this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform mat3 uMatrix;","varying vec2 vTextureCoord;","varying float vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," vec2 v;"," vec2 sv = aVertexPosition * aScale;"," v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);"," v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);"," v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;"," gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"],this.textureCount=0,this.init()},d.PixiFastShader.prototype.init=function(){var a=this.gl,b=d.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(b),this.uSampler=a.getUniformLocation(b,"uSampler"),this.projectionVector=a.getUniformLocation(b,"projectionVector"),this.offsetVector=a.getUniformLocation(b,"offsetVector"),this.dimensions=a.getUniformLocation(b,"dimensions"),this.uMatrix=a.getUniformLocation(b,"uMatrix"),this.aVertexPosition=a.getAttribLocation(b,"aVertexPosition"),this.aPositionCoord=a.getAttribLocation(b,"aPositionCoord"),this.aScale=a.getAttribLocation(b,"aScale"),this.aRotation=a.getAttribLocation(b,"aRotation"),this.aTextureCoord=a.getAttribLocation(b,"aTextureCoord"),this.colorAttribute=a.getAttribLocation(b,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aPositionCoord,this.aScale,this.aRotation,this.aTextureCoord,this.colorAttribute],this.program=b},d.PixiFastShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},d.StripShader=function(){this.program=null,this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform float alpha;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));"," gl_FragColor = gl_FragColor * alpha;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","varying vec2 vTextureCoord;","uniform vec2 offsetVector;","varying float vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / projectionVector.y + 1.0 , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"]},d.StripShader.prototype.init=function(){var a=d.gl,b=d.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(b),this.uSampler=a.getUniformLocation(b,"uSampler"),this.projectionVector=a.getUniformLocation(b,"projectionVector"),this.offsetVector=a.getUniformLocation(b,"offsetVector"),this.colorAttribute=a.getAttribLocation(b,"aColor"),this.aVertexPosition=a.getAttribLocation(b,"aVertexPosition"),this.aTextureCoord=a.getAttribLocation(b,"aTextureCoord"),this.translationMatrix=a.getUniformLocation(b,"translationMatrix"),this.alpha=a.getUniformLocation(b,"alpha"),this.program=b},d.PrimitiveShader=function(a){this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {"," gl_FragColor = vColor;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform float alpha;","uniform vec3 tint;","varying vec4 vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"],this.init()},d.PrimitiveShader.prototype.init=function(){var a=this.gl,b=d.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(b),this.projectionVector=a.getUniformLocation(b,"projectionVector"),this.offsetVector=a.getUniformLocation(b,"offsetVector"),this.tintColor=a.getUniformLocation(b,"tint"),this.aVertexPosition=a.getAttribLocation(b,"aVertexPosition"),this.colorAttribute=a.getAttribLocation(b,"aColor"),this.attributes=[this.aVertexPosition,this.colorAttribute],this.translationMatrix=a.getUniformLocation(b,"translationMatrix"),this.alpha=a.getUniformLocation(b,"alpha"),this.program=b},d.PrimitiveShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attribute=null},d.WebGLGraphics=function(){},d.WebGLGraphics.renderGraphics=function(a,b){var c=b.gl,e=b.projection,f=b.offset,g=b.shaderManager.primitiveShader;a._webGL[c.id]||(a._webGL[c.id]={points:[],indices:[],lastIndex:0,buffer:c.createBuffer(),indexBuffer:c.createBuffer()});var h=a._webGL[c.id];a.dirty&&(a.dirty=!1,a.clearDirty&&(a.clearDirty=!1,h.lastIndex=0,h.points=[],h.indices=[]),d.WebGLGraphics.updateGraphics(a,c)),b.shaderManager.activatePrimitiveShader(),d.mat3.transpose(a.worldTransform,d.tempMatrix),c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA),c.uniformMatrix3fv(g.translationMatrix,!1,d.tempMatrix),c.uniform2f(g.projectionVector,e.x,-e.y),c.uniform2f(g.offsetVector,-f.x,-f.y),c.uniform3fv(g.tintColor,d.hex2rgb(a.tint)),c.uniform1f(g.alpha,a.worldAlpha),c.bindBuffer(c.ARRAY_BUFFER,h.buffer),c.vertexAttribPointer(g.aVertexPosition,2,c.FLOAT,!1,24,0),c.vertexAttribPointer(g.colorAttribute,4,c.FLOAT,!1,24,8),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,h.indexBuffer),c.drawElements(c.TRIANGLE_STRIP,h.indices.length,c.UNSIGNED_SHORT,0),b.shaderManager.deactivatePrimitiveShader()},d.WebGLGraphics.updateGraphics=function(a,b){for(var c=a._webGL[b.id],e=c.lastIndex;e3&&d.WebGLGraphics.buildPoly(f,c),f.lineWidth>0&&d.WebGLGraphics.buildLine(f,c)):f.type===d.Graphics.RECT?d.WebGLGraphics.buildRectangle(f,c):(f.type===d.Graphics.CIRC||f.type===d.Graphics.ELIP)&&d.WebGLGraphics.buildCircle(f,c)}c.lastIndex=a.graphicsData.length,c.glPoints=new Float32Array(c.points),b.bindBuffer(b.ARRAY_BUFFER,c.buffer),b.bufferData(b.ARRAY_BUFFER,c.glPoints,b.STATIC_DRAW),c.glIndicies=new Uint16Array(c.indices),b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,c.indexBuffer),b.bufferData(b.ELEMENT_ARRAY_BUFFER,c.glIndicies,b.STATIC_DRAW)},d.WebGLGraphics.buildRectangle=function(a,b){var c=a.points,e=c[0],f=c[1],g=c[2],h=c[3];if(a.fill){var i=d.hex2rgb(a.fillColor),j=a.fillAlpha,k=i[0]*j,l=i[1]*j,m=i[2]*j,n=b.points,o=b.indices,p=n.length/6;n.push(e,f),n.push(k,l,m,j),n.push(e+g,f),n.push(k,l,m,j),n.push(e,f+h),n.push(k,l,m,j),n.push(e+g,f+h),n.push(k,l,m,j),o.push(p,p,p+1,p+2,p+3,p+3)}if(a.lineWidth){var q=a.points;a.points=[e,f,e+g,f,e+g,f+h,e,f+h,e,f],d.WebGLGraphics.buildLine(a,b),a.points=q}},d.WebGLGraphics.buildCircle=function(a,b){var c=a.points,e=c[0],f=c[1],g=c[2],h=c[3],i=40,j=2*Math.PI/i,k=0;if(a.fill){var l=d.hex2rgb(a.fillColor),m=a.fillAlpha,n=l[0]*m,o=l[1]*m,p=l[2]*m,q=b.points,r=b.indices,s=q.length/6;for(r.push(s),k=0;i+1>k;k++)q.push(e,f,n,o,p,m),q.push(e+Math.sin(j*k)*g,f+Math.cos(j*k)*h,n,o,p,m),r.push(s++,s++);r.push(s-1)}if(a.lineWidth){var t=a.points;for(a.points=[],k=0;i+1>k;k++)a.points.push(e+Math.sin(j*k)*g,f+Math.cos(j*k)*h);d.WebGLGraphics.buildLine(a,b),a.points=t}},d.WebGLGraphics.buildLine=function(a,b){var c=0,e=a.points;if(0!==e.length){if(a.lineWidth%2)for(c=0;cc;c++)l=e[2*(c-1)],m=e[2*(c-1)+1],n=e[2*c],o=e[2*c+1],p=e[2*(c+1)],q=e[2*(c+1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,t=-(o-q),u=n-p,F=Math.sqrt(t*t+u*u),t/=F,u/=F,t*=L,u*=L,x=-s+m-(-s+o),y=-r+n-(-r+l),z=(-r+l)*(-s+o)-(-r+n)*(-s+m),A=-u+q-(-u+o),B=-t+n-(-t+p),C=(-t+p)*(-u+o)-(-t+n)*(-u+q),D=x*B-A*y,Math.abs(D)<.1?(D+=10.1,G.push(n-r,o-s,O,P,Q,N),G.push(n+r,o+s,O,P,Q,N)):(j=(y*C-B*z)/D,k=(A*z-x*C)/D,E=(j-n)*(j-n)+(k-o)+(k-o),E>19600?(v=r-t,w=s-u,F=Math.sqrt(v*v+w*w),v/=F,w/=F,v*=L,w*=L,G.push(n-v,o-w),G.push(O,P,Q,N),G.push(n+v,o+w),G.push(O,P,Q,N),G.push(n-v,o-w),G.push(O,P,Q,N),J++):(G.push(j,k),G.push(O,P,Q,N),G.push(n-(j-n),o-(k-o)),G.push(O,P,Q,N)));for(l=e[2*(I-2)],m=e[2*(I-2)+1],n=e[2*(I-1)],o=e[2*(I-1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,G.push(n-r,o-s),G.push(O,P,Q,N),G.push(n+r,o+s),G.push(O,P,Q,N),H.push(K),c=0;J>c;c++)H.push(K++);H.push(K-1)}},d.WebGLGraphics.buildPoly=function(a,b){var c=a.points;if(!(c.length<6)){var e=b.points,f=b.indices,g=c.length/2,h=d.hex2rgb(a.fillColor),i=a.fillAlpha,j=h[0]*i,k=h[1]*i,l=h[2]*i,m=d.PolyK.Triangulate(c),n=e.length/6,o=0;for(o=0;oo;o++)e.push(c[2*o],c[2*o+1],j,k,l,i)}},d.glContexts=[],d.WebGLRenderer=function(a,b,c,e,f){d.defaultRenderer||(d.defaultRenderer=this),this.type=d.WEBGL_RENDERER,this.transparent=!!e,this.width=a||800,this.height=b||600,this.view=c||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height,this.contextLost=this.handleContextLost.bind(this),this.contextRestoredLost=this.handleContextRestored.bind(this),this.view.addEventListener("webglcontextlost",this.contextLost,!1),this.view.addEventListener("webglcontextrestored",this.contextRestoredLost,!1),this.options={alpha:this.transparent,antialias:!!f,premultipliedAlpha:!!e,stencil:!0};try{this.gl=this.view.getContext("experimental-webgl",this.options)}catch(g){try{this.gl=this.view.getContext("webgl",this.options)}catch(h){throw new Error(" This browser does not support webGL. Try using the canvas renderer"+this)}}var i=this.gl;this.glContextId=i.id=d.WebGLRenderer.glContextId++,d.glContexts[this.glContextId]=i,d.blendModesWebGL||(d.blendModesWebGL=[],d.blendModesWebGL[d.blendModes.NORMAL]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],d.blendModesWebGL[d.blendModes.ADD]=[i.SRC_ALPHA,i.DST_ALPHA],d.blendModesWebGL[d.blendModes.MULTIPLY]=[i.DST_COLOR,i.ONE_MINUS_SRC_ALPHA],d.blendModesWebGL[d.blendModes.SCREEN]=[i.SRC_ALPHA,i.ONE],d.blendModesWebGL[d.blendModes.OVERLAY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],d.blendModesWebGL[d.blendModes.DARKEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],d.blendModesWebGL[d.blendModes.LIGHTEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],d.blendModesWebGL[d.blendModes.COLOR_DODGE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],d.blendModesWebGL[d.blendModes.COLOR_BURN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],d.blendModesWebGL[d.blendModes.HARD_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],d.blendModesWebGL[d.blendModes.SOFT_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],d.blendModesWebGL[d.blendModes.DIFFERENCE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],d.blendModesWebGL[d.blendModes.EXCLUSION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],d.blendModesWebGL[d.blendModes.HUE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],d.blendModesWebGL[d.blendModes.SATURATION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],d.blendModesWebGL[d.blendModes.COLOR]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],d.blendModesWebGL[d.blendModes.LUMINOSITY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA]),this.projection=new d.Point,this.projection.x=this.width/2,this.projection.y=-this.height/2,this.offset=new d.Point(0,0),this.resize(this.width,this.height),this.contextLost=!1,this.shaderManager=new d.WebGLShaderManager(i),this.spriteBatch=new d.WebGLSpriteBatch(i),this.maskManager=new d.WebGLMaskManager(i),this.filterManager=new d.WebGLFilterManager(i,this.transparent),this.renderSession={},this.renderSession.gl=this.gl,this.renderSession.drawCount=0,this.renderSession.shaderManager=this.shaderManager,this.renderSession.maskManager=this.maskManager,this.renderSession.filterManager=this.filterManager,this.renderSession.spriteBatch=this.spriteBatch,i.useProgram(this.shaderManager.defaultShader.program),i.disable(i.DEPTH_TEST),i.disable(i.CULL_FACE),i.enable(i.BLEND),i.colorMask(!0,!0,!0,this.transparent)},d.WebGLRenderer.prototype.constructor=d.WebGLRenderer,d.WebGLRenderer.prototype.render=function(a){if(!this.contextLost){this.__stage!==a&&(this.__stage=a),d.WebGLRenderer.updateTextures(),a.updateTransform();var b=this.gl;b.viewport(0,0,this.width,this.height),b.bindFramebuffer(b.FRAMEBUFFER,null),this.transparent?b.clearColor(0,0,0,0):b.clearColor(a.backgroundColorSplit[0],a.backgroundColorSplit[1],a.backgroundColorSplit[2],1),b.clear(b.COLOR_BUFFER_BIT),this.renderDisplayObject(a,this.projection),a.interactive&&(a._interactiveEventsAdded||(a._interactiveEventsAdded=!0,a.interactionManager.setTarget(this)))}},d.WebGLRenderer.prototype.renderDisplayObject=function(a,b,c){this.renderSession.drawCount=0,this.renderSession.currentBlendMode=9999,this.renderSession.projection=b,this.renderSession.offset=this.offset,this.spriteBatch.begin(this.renderSession),this.filterManager.begin(this.renderSession,c),a._renderWebGL(this.renderSession),this.spriteBatch.end()},d.WebGLRenderer.updateTextures=function(){var a=0;for(a=0;a=0;b--){var c=a._glTextures[b],e=d.glContexts[b];e&&c&&e.deleteTexture(c)}a._glTextures.length=0},d.WebGLRenderer.updateTextureFrame=function(a){a.updateFrame=!1,a._updateWebGLuvs()},d.WebGLRenderer.prototype.resize=function(a,b){this.width=a,this.height=b,this.view.width=a,this.view.height=b,this.gl.viewport(0,0,this.width,this.height),this.projection.x=this.width/2,this.projection.y=-this.height/2},d.createWebGLTexture=function(a,b){return a.hasLoaded&&(a._glTextures[b.id]=b.createTexture(),b.bindTexture(b.TEXTURE_2D,a._glTextures[b.id]),b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,a.source),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,a.scaleMode===d.scaleModes.LINEAR?b.LINEAR:b.NEAREST),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,a.scaleMode===d.scaleModes.LINEAR?b.LINEAR:b.NEAREST),a._powerOf2?(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.REPEAT),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.REPEAT)):(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE)),b.bindTexture(b.TEXTURE_2D,null)),a._glTextures[b.id]},d.updateWebGLTexture=function(a,b){a._glTextures[b.id]&&(b.bindTexture(b.TEXTURE_2D,a._glTextures[b.id]),b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,a.source),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,a.scaleMode===d.scaleModes.LINEAR?b.LINEAR:b.NEAREST),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,a.scaleMode===d.scaleModes.LINEAR?b.LINEAR:b.NEAREST),a._powerOf2?(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.REPEAT),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.REPEAT)):(b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE)),b.bindTexture(b.TEXTURE_2D,null))},d.WebGLRenderer.prototype.handleContextLost=function(a){a.preventDefault(),this.contextLost=!0},d.WebGLRenderer.prototype.handleContextRestored=function(){try{this.gl=this.view.getContext("experimental-webgl",this.options)}catch(a){try{this.gl=this.view.getContext("webgl",this.options)}catch(b){throw new Error(" This browser does not support webGL. Try using the canvas renderer"+this)}}var c=this.gl;c.id=d.WebGLRenderer.glContextId++,this.shaderManager.setContext(c),this.spriteBatch.setContext(c),this.maskManager.setContext(c),this.filterManager.setContext(c),this.renderSession.gl=this.gl,c.disable(c.DEPTH_TEST),c.disable(c.CULL_FACE),c.enable(c.BLEND),c.colorMask(!0,!0,!0,this.transparent),this.gl.viewport(0,0,this.width,this.height);for(var e in d.TextureCache){var f=d.TextureCache[e].baseTexture;f._glTextures=[]}this.contextLost=!1},d.WebGLRenderer.prototype.destroy=function(){this.view.removeEventListener("webglcontextlost",this.contextLost),this.view.removeEventListener("webglcontextrestored",this.contextRestoredLost),d.glContexts[this.glContextId]=null,this.projection=null,this.offset=null,this.shaderManager.destroy(),this.spriteBatch.destroy(),this.maskManager.destroy(),this.filterManager.destroy(),this.shaderManager=null,this.spriteBatch=null,this.maskManager=null,this.filterManager=null,this.gl=null,this.renderSession=null},d.WebGLRenderer.glContextId=0,d.WebGLMaskManager=function(a){this.maskStack=[],this.maskPosition=0,this.setContext(a)},d.WebGLMaskManager.prototype.setContext=function(a){this.gl=a},d.WebGLMaskManager.prototype.pushMask=function(a,b){var c=this.gl;0===this.maskStack.length&&(c.enable(c.STENCIL_TEST),c.stencilFunc(c.ALWAYS,1,1)),this.maskStack.push(a),c.colorMask(!1,!1,!1,!0),c.stencilOp(c.KEEP,c.KEEP,c.INCR),d.WebGLGraphics.renderGraphics(a,b),c.colorMask(!0,!0,!0,!0),c.stencilFunc(c.NOTEQUAL,0,this.maskStack.length),c.stencilOp(c.KEEP,c.KEEP,c.KEEP)},d.WebGLMaskManager.prototype.popMask=function(a){var b=this.gl,c=this.maskStack.pop();c&&(b.colorMask(!1,!1,!1,!1),b.stencilOp(b.KEEP,b.KEEP,b.DECR),d.WebGLGraphics.renderGraphics(c,a),b.colorMask(!0,!0,!0,!0),b.stencilFunc(b.NOTEQUAL,0,this.maskStack.length),b.stencilOp(b.KEEP,b.KEEP,b.KEEP)),0===this.maskStack.length&&b.disable(b.STENCIL_TEST)},d.WebGLMaskManager.prototype.destroy=function(){this.maskStack=null,this.gl=null},d.WebGLShaderManager=function(a){this.maxAttibs=10,this.attribState=[],this.tempAttribState=[];for(var b=0;bd;d+=6,e+=4)this.indices[d+0]=e+0,this.indices[d+1]=e+1,this.indices[d+2]=e+2,this.indices[d+3]=e+0,this.indices[d+4]=e+2,this.indices[d+5]=e+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.setContext(a)},d.WebGLSpriteBatch.prototype.setContext=function(a){this.gl=a,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW),this.currentBlendMode=99999},d.WebGLSpriteBatch.prototype.begin=function(a){this.renderSession=a,this.shader=this.renderSession.shaderManager.defaultShader,this.start()},d.WebGLSpriteBatch.prototype.end=function(){this.flush()},d.WebGLSpriteBatch.prototype.render=function(a){(a.texture.baseTexture!==this.currentBaseTexture||this.currentBatchSize>=this.size)&&(this.flush(),this.currentBaseTexture=a.texture.baseTexture),a.blendMode!==this.currentBlendMode&&this.setBlendMode(a.blendMode);var b=a._uvs||a.texture._uvs;if(b){var c,d,e,f,g=a.worldAlpha,h=a.tint,i=this.vertices,j=a.texture.frame.width,k=a.texture.frame.height,l=a.anchor.x,m=a.anchor.y;if(a.texture.trimmed){var n=a.texture.trim;d=n.x-l*n.realWidth,c=d+j,f=n.y-m*n.realHeight,e=f+k}else c=j*(1-l),d=j*-l,e=k*(1-m),f=k*-m;var o=4*this.currentBatchSize*this.vertSize,p=a.worldTransform,q=p[0],r=p[3],s=p[1],t=p[4],u=p[2],v=p[5];i[o++]=q*d+s*f+u,i[o++]=t*f+r*d+v,i[o++]=b[0],i[o++]=b[1],i[o++]=g,i[o++]=h,i[o++]=q*c+s*f+u,i[o++]=t*f+r*c+v,i[o++]=b[2],i[o++]=b[3],i[o++]=g,i[o++]=h,i[o++]=q*c+s*e+u,i[o++]=t*e+r*c+v,i[o++]=b[4],i[o++]=b[5],i[o++]=g,i[o++]=h,i[o++]=q*d+s*e+u,i[o++]=t*e+r*d+v,i[o++]=b[6],i[o++]=b[7],i[o++]=g,i[o++]=h,this.currentBatchSize++}},d.WebGLSpriteBatch.prototype.renderTilingSprite=function(a){var b=a.tilingTexture;(b.baseTexture!==this.currentBaseTexture||this.currentBatchSize>=this.size)&&(this.flush(),this.currentBaseTexture=b.baseTexture),a.blendMode!==this.currentBlendMode&&this.setBlendMode(a.blendMode),a._uvs||(a._uvs=new Float32Array(8));var c=a._uvs,d=a.tilePosition.x/b.baseTexture.width,e=a.tilePosition.y/b.baseTexture.height,f=a.width/b.baseTexture.width/(a.tileScale.x*a.tileScaleOffset.x),g=a.height/b.baseTexture.height/(a.tileScale.y*a.tileScaleOffset.y);c[0]=0-d,c[1]=0-e,c[2]=1*f-d,c[3]=0-e,c[4]=1*f-d,c[5]=1*g-e,c[6]=0-d,c[7]=1*g-e;var h=a.worldAlpha,i=a.tint,j=this.vertices,k=a.width,l=a.height,m=a.anchor.x,n=a.anchor.y,o=k*(1-m),p=k*-m,q=l*(1-n),r=l*-n,s=4*this.currentBatchSize*this.vertSize,t=a.worldTransform,u=t[0],v=t[3],w=t[1],x=t[4],y=t[2],z=t[5];j[s++]=u*p+w*r+y,j[s++]=x*r+v*p+z,j[s++]=c[0],j[s++]=c[1],j[s++]=h,j[s++]=i,j[s++]=u*o+w*r+y,j[s++]=x*r+v*o+z,j[s++]=c[2],j[s++]=c[3],j[s++]=h,j[s++]=i,j[s++]=u*o+w*q+y,j[s++]=x*q+v*o+z,j[s++]=c[4],j[s++]=c[5],j[s++]=h,j[s++]=i,j[s++]=u*p+w*q+y,j[s++]=x*q+v*p+z,j[s++]=c[6],j[s++]=c[7],j[s++]=h,j[s++]=i,this.currentBatchSize++},d.WebGLSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a=this.gl;if(a.bindTexture(a.TEXTURE_2D,this.currentBaseTexture._glTextures[a.id]||d.createWebGLTexture(this.currentBaseTexture,a)),this.currentBatchSize>.5*this.size)a.bufferSubData(a.ARRAY_BUFFER,0,this.vertices);else{var b=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);a.bufferSubData(a.ARRAY_BUFFER,0,b)}a.drawElements(a.TRIANGLES,6*this.currentBatchSize,a.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}},d.WebGLSpriteBatch.prototype.stop=function(){this.flush()},d.WebGLSpriteBatch.prototype.start=function(){var a=this.gl;a.activeTexture(a.TEXTURE0),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var b=this.renderSession.projection;a.uniform2f(this.shader.projectionVector,b.x,b.y);var c=4*this.vertSize;a.vertexAttribPointer(this.shader.aVertexPosition,2,a.FLOAT,!1,c,0),a.vertexAttribPointer(this.shader.aTextureCoord,2,a.FLOAT,!1,c,8),a.vertexAttribPointer(this.shader.colorAttribute,2,a.FLOAT,!1,c,16),this.currentBlendMode!==d.blendModes.NORMAL&&this.setBlendMode(d.blendModes.NORMAL)
+},d.WebGLSpriteBatch.prototype.setBlendMode=function(a){this.flush(),this.currentBlendMode=a;var b=d.blendModesWebGL[this.currentBlendMode];this.gl.blendFunc(b[0],b[1])},d.WebGLSpriteBatch.prototype.destroy=function(){this.vertices=null,this.indices=null,this.gl.deleteBuffer(this.vertexBuffer),this.gl.deleteBuffer(this.indexBuffer),this.currentBaseTexture=null,this.gl=null},d.WebGLFastSpriteBatch=function(a){this.vertSize=10,this.maxSize=6e3,this.size=this.maxSize;var b=4*this.size*this.vertSize,c=6*this.maxSize;this.vertices=new Float32Array(b),this.indices=new Uint16Array(c),this.vertexBuffer=null,this.indexBuffer=null,this.lastIndexCount=0;for(var e=0,f=0;c>e;e+=6,f+=4)this.indices[e+0]=f+0,this.indices[e+1]=f+1,this.indices[e+2]=f+2,this.indices[e+3]=f+0,this.indices[e+4]=f+2,this.indices[e+5]=f+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.currentBlendMode=0,this.renderSession=null,this.shader=null,this.tempMatrix=d.mat3.create(),this.setContext(a)},d.WebGLFastSpriteBatch.prototype.setContext=function(a){this.gl=a,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW),this.currentBlendMode=99999},d.WebGLFastSpriteBatch.prototype.begin=function(a,b){this.renderSession=b,this.shader=this.renderSession.shaderManager.fastShader,d.mat3.transpose(a.worldTransform,this.tempMatrix),this.start()},d.WebGLFastSpriteBatch.prototype.end=function(){this.flush()},d.WebGLFastSpriteBatch.prototype.render=function(a){var b=a.children,c=b[0];if(c.texture._uvs){this.currentBaseTexture=c.texture.baseTexture,c.blendMode!==this.currentBlendMode&&this.setBlendMode(c.blendMode);for(var d=0,e=b.length;e>d;d++)this.renderSprite(b[d]);this.flush()}},d.WebGLFastSpriteBatch.prototype.renderSprite=function(a){if(a.texture.baseTexture===this.currentBaseTexture||(this.currentBaseTexture=a.texture.baseTexture,this.flush(),a.texture._uvs)){var b,c,d,e,f,g,h,i,j=this.vertices;if(b=a.texture._uvs,c=a.texture.frame.width,d=a.texture.frame.height,a.texture.trimmed){var k=a.texture.trim;f=k.x-a.anchor.x*k.realWidth,e=f+a.texture.frame.width,h=k.y-a.anchor.y*k.realHeight,g=h+a.texture.frame.height}else e=a.texture.frame.width*(1-a.anchor.x),f=a.texture.frame.width*-a.anchor.x,g=a.texture.frame.height*(1-a.anchor.y),h=a.texture.frame.height*-a.anchor.y;i=4*this.currentBatchSize*this.vertSize,j[i++]=f,j[i++]=h,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b[0],j[i++]=b[1],j[i++]=a.alpha,j[i++]=e,j[i++]=h,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b[2],j[i++]=b[3],j[i++]=a.alpha,j[i++]=e,j[i++]=g,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b[4],j[i++]=b[5],j[i++]=a.alpha,j[i++]=f,j[i++]=g,j[i++]=a.position.x,j[i++]=a.position.y,j[i++]=a.scale.x,j[i++]=a.scale.y,j[i++]=a.rotation,j[i++]=b[6],j[i++]=b[7],j[i++]=a.alpha,this.currentBatchSize++,this.currentBatchSize>=this.size&&this.flush()}},d.WebGLFastSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a=this.gl;if(this.currentBaseTexture._glTextures[a.id]||d.createWebGLTexture(this.currentBaseTexture,a),a.bindTexture(a.TEXTURE_2D,this.currentBaseTexture._glTextures[a.id]),this.currentBatchSize>.5*this.size)a.bufferSubData(a.ARRAY_BUFFER,0,this.vertices);else{var b=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);a.bufferSubData(a.ARRAY_BUFFER,0,b)}a.drawElements(a.TRIANGLES,6*this.currentBatchSize,a.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}},d.WebGLFastSpriteBatch.prototype.stop=function(){this.flush()},d.WebGLFastSpriteBatch.prototype.start=function(){var a=this.gl;a.activeTexture(a.TEXTURE0),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var b=this.renderSession.projection;a.uniform2f(this.shader.projectionVector,b.x,b.y),a.uniformMatrix3fv(this.shader.uMatrix,!1,this.tempMatrix);var c=4*this.vertSize;a.vertexAttribPointer(this.shader.aVertexPosition,2,a.FLOAT,!1,c,0),a.vertexAttribPointer(this.shader.aPositionCoord,2,a.FLOAT,!1,c,8),a.vertexAttribPointer(this.shader.aScale,2,a.FLOAT,!1,c,16),a.vertexAttribPointer(this.shader.aRotation,1,a.FLOAT,!1,c,24),a.vertexAttribPointer(this.shader.aTextureCoord,2,a.FLOAT,!1,c,28),a.vertexAttribPointer(this.shader.colorAttribute,1,a.FLOAT,!1,c,36),this.currentBlendMode!==d.blendModes.NORMAL&&this.setBlendMode(d.blendModes.NORMAL)},d.WebGLFastSpriteBatch.prototype.setBlendMode=function(a){this.flush(),this.currentBlendMode=a;var b=d.blendModesWebGL[this.currentBlendMode];this.gl.blendFunc(b[0],b[1])},d.WebGLFilterManager=function(a,b){this.transparent=b,this.filterStack=[],this.offsetX=0,this.offsetY=0,this.setContext(a)},d.WebGLFilterManager.prototype.setContext=function(a){this.gl=a,this.texturePool=[],this.initShaderBuffers()},d.WebGLFilterManager.prototype.begin=function(a,b){this.renderSession=a,this.defaultShader=a.shaderManager.defaultShader;var c=this.renderSession.projection;this.width=2*c.x,this.height=2*-c.y,this.buffer=b},d.WebGLFilterManager.prototype.pushFilter=function(a){var b=this.gl,c=this.renderSession.projection,e=this.renderSession.offset;this.filterStack.push(a);var f=a.filterPasses[0];this.offsetX+=a.target.filterArea.x,this.offsetY+=a.target.filterArea.y;var g=this.texturePool.pop();g?g.resize(this.width,this.height):g=new d.FilterTexture(this.gl,this.width,this.height),b.bindTexture(b.TEXTURE_2D,g.texture),a.target.filterArea=a.target.getBounds();var h=a.target.filterArea,i=f.padding;h.x-=i,h.y-=i,h.width+=2*i,h.height+=2*i,h.x<0&&(h.x=0),h.width>this.width&&(h.width=this.width),h.y<0&&(h.y=0),h.height>this.height&&(h.height=this.height),b.bindFramebuffer(b.FRAMEBUFFER,g.frameBuffer),b.viewport(0,0,h.width,h.height),c.x=h.width/2,c.y=-h.height/2,e.x=-h.x,e.y=-h.y,b.uniform2f(this.defaultShader.projectionVector,h.width/2,-h.height/2),b.uniform2f(this.defaultShader.offsetVector,-h.x,-h.y),b.colorMask(!0,!0,!0,!0),b.clearColor(0,0,0,0),b.clear(b.COLOR_BUFFER_BIT),a._glFilterTexture=g},d.WebGLFilterManager.prototype.popFilter=function(){var a=this.gl,b=this.filterStack.pop(),c=b.target.filterArea,e=b._glFilterTexture,f=this.renderSession.projection,g=this.renderSession.offset;if(b.filterPasses.length>1){a.viewport(0,0,c.width,c.height),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),this.vertexArray[0]=0,this.vertexArray[1]=c.height,this.vertexArray[2]=c.width,this.vertexArray[3]=c.height,this.vertexArray[4]=0,this.vertexArray[5]=0,this.vertexArray[6]=c.width,this.vertexArray[7]=0,a.bufferSubData(a.ARRAY_BUFFER,0,this.vertexArray),a.bindBuffer(a.ARRAY_BUFFER,this.uvBuffer),this.uvArray[2]=c.width/this.width,this.uvArray[5]=c.height/this.height,this.uvArray[6]=c.width/this.width,this.uvArray[7]=c.height/this.height,a.bufferSubData(a.ARRAY_BUFFER,0,this.uvArray);var h=e,i=this.texturePool.pop();i||(i=new d.FilterTexture(this.gl,this.width,this.height)),a.bindFramebuffer(a.FRAMEBUFFER,i.frameBuffer),a.clear(a.COLOR_BUFFER_BIT),a.disable(a.BLEND);for(var j=0;j0&&(d.Texture.frameUpdates.length=0)},d.CanvasRenderer.prototype.resize=function(a,b){this.width=a,this.height=b,this.view.width=a,this.view.height=b},d.CanvasRenderer.prototype.renderDisplayObject=function(a,b){this.renderSession.context=b||this.context,a._renderCanvas(this.renderSession)},d.CanvasRenderer.prototype.renderStripFlat=function(a){var b=this.context,c=a.verticies,d=c.length/2;this.count++,b.beginPath();for(var e=1;d-2>e;e++){var f=2*e,g=c[f],h=c[f+2],i=c[f+4],j=c[f+1],k=c[f+3],l=c[f+5];b.moveTo(g,j),b.lineTo(h,k),b.lineTo(i,l)}b.fillStyle="#FF0000",b.fill(),b.closePath()},d.CanvasRenderer.prototype.renderStrip=function(a){var b=this.context,c=a.verticies,d=a.uvs,e=c.length/2;this.count++;for(var f=1;e-2>f;f++){var g=2*f,h=c[g],i=c[g+2],j=c[g+4],k=c[g+1],l=c[g+3],m=c[g+5],n=d[g]*a.texture.width,o=d[g+2]*a.texture.width,p=d[g+4]*a.texture.width,q=d[g+1]*a.texture.height,r=d[g+3]*a.texture.height,s=d[g+5]*a.texture.height;b.save(),b.beginPath(),b.moveTo(h,k),b.lineTo(i,l),b.lineTo(j,m),b.closePath(),b.clip();var t=n*r+q*p+o*s-r*p-q*o-n*s,u=h*r+q*j+i*s-r*j-q*i-h*s,v=n*i+h*p+o*j-i*p-h*o-n*j,w=n*r*j+q*i*p+h*o*s-h*r*p-q*o*j-n*i*s,x=k*r+q*m+l*s-r*m-q*l-k*s,y=n*l+k*p+o*m-l*p-k*o-n*m,z=n*r*m+q*l*p+k*o*s-k*r*p-q*o*m-n*l*s;b.transform(u/t,x/t,v/t,y/t,w/t,z/t),b.drawImage(a.texture.baseTexture.source,0,0),b.restore()}},d.CanvasBuffer=function(a,b){this.width=a,this.height=b,this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=a,this.canvas.height=b},d.CanvasBuffer.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},d.CanvasBuffer.prototype.resize=function(a,b){this.width=this.canvas.width=a,this.height=this.canvas.height=b},d.CanvasGraphics=function(){},d.CanvasGraphics.renderGraphics=function(a,b){for(var c=a.worldAlpha,e="",f=0;f1&&(c=1,window.console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object"));for(var e=0;1>e;e++){var f=a.graphicsData[e],g=f.points;if(f.type===d.Graphics.POLY){b.beginPath(),b.moveTo(g[0],g[1]);for(var h=1;hc;c++)this.children[c]._renderWebGL(a);a.spriteBatch.stop()}this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),a.drawCount++,a.spriteBatch.start()}},d.Graphics.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha&&this.isMask!==!0){var b=a.context,c=this.worldTransform;this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,b.globalCompositeOperation=d.blendModesCanvas[a.currentBlendMode]),b.setTransform(c[0],c[3],c[1],c[4],c[2],c[5]),d.CanvasGraphics.renderGraphics(this,b);for(var e=0,f=this.children.length;f>e;e++)this.children[e]._renderCanvas(a)}},d.Graphics.prototype.getBounds=function(){this.bounds||this.updateBounds();var a=this.bounds.x,b=this.bounds.width+this.bounds.x,c=this.bounds.y,d=this.bounds.height+this.bounds.y,e=this.worldTransform,f=e[0],g=e[3],h=e[1],i=e[4],j=e[2],k=e[5],l=f*b+h*d+j,m=i*d+g*b+k,n=f*a+h*d+j,o=i*d+g*a+k,p=f*a+h*c+j,q=i*c+g*a+k,r=f*b+h*c+j,s=i*c+g*b+k,t=-1/0,u=-1/0,v=1/0,w=1/0;v=v>l?l:v,v=v>n?n:v,v=v>p?p:v,v=v>r?r:v,w=w>m?m:w,w=w>o?o:w,w=w>q?q:w,w=w>s?s:w,t=l>t?l:t,t=n>t?n:t,t=p>t?p:t,t=r>t?r:t,u=m>u?m:u,u=o>u?o:u,u=q>u?q:u,u=s>u?s:u;var x=this._bounds;return x.x=v,x.width=t-v,x.y=w,x.height=u-w,x},d.Graphics.prototype.updateBounds=function(){for(var a,b,c,e=1/0,f=-1/0,g=1/0,h=-1/0,i=0;ib?b:e,f=b+m>f?b+m:f,g=g>c?b:g,h=c+n>h?c+n:h}else if(k===d.Graphics.CIRC||k===d.Graphics.ELIP){b=a.x,c=a.y;var o=a.radius+l/2;e=e>b-o?b-o:e,f=b+o>f?b+o:f,g=g>c-o?c-o:g,h=c+o>h?c+o:h}else for(var p=0;pb-l?b-l:e,f=b+l>f?b+l:f,g=g>c-l?c-l:g,h=c+l>h?c+l:h}var q=this.boundsPadding;this.bounds=new d.Rectangle(e-q,g-q,f-e+2*q,h-g+2*q)},d.Graphics.prototype._generateCachedSprite=function(){var a=this.getBounds();if(this._cachedSprite)this._cachedSprite.buffer.resize(a.width,a.height);else{var b=new d.CanvasBuffer(a.width,a.height),c=d.Texture.fromCanvas(b.canvas);this._cachedSprite=new d.Sprite(c),this._cachedSprite.buffer=b,this._cachedSprite.worldTransform=this.worldTransform}this._cachedSprite.anchor.x=-(a.x/a.width),this._cachedSprite.anchor.y=-(a.y/a.height),this._cachedSprite.buffer.context.translate(-a.x,-a.y),d.CanvasGraphics.renderGraphics(this,this._cachedSprite.buffer.context)},d.Graphics.prototype.destroyCachedSprite=function(){this._cachedSprite.texture.destroy(!0),this._cachedSprite=null},d.Graphics.POLY=0,d.Graphics.RECT=1,d.Graphics.CIRC=2,d.Graphics.ELIP=3,d.Strip=function(a,b,c){d.DisplayObjectContainer.call(this),this.texture=a,this.blendMode=d.blendModes.NORMAL;try{this.uvs=new Float32Array([0,1,1,1,1,0,0,1]),this.verticies=new Float32Array([0,0,0,0,0,0,0,0,0]),this.colors=new Float32Array([1,1,1,1]),this.indices=new Uint16Array([0,1,2,3])}catch(e){this.uvs=[0,1,1,1,1,0,0,1],this.verticies=[0,0,0,0,0,0,0,0,0],this.colors=[1,1,1,1],this.indices=[0,1,2,3]}this.width=b,this.height=c,a.baseTexture.hasLoaded?(this.width=this.texture.frame.width,this.height=this.texture.frame.height,this.updateFrame=!0):(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},d.Strip.prototype=Object.create(d.DisplayObjectContainer.prototype),d.Strip.prototype.constructor=d.Strip,d.Strip.prototype.setTexture=function(a){this.texture=a,this.width=a.frame.width,this.height=a.frame.height,this.updateFrame=!0},d.Strip.prototype.onTextureUpdate=function(){this.updateFrame=!0},d.Rope=function(a,b){d.Strip.call(this,a),this.points=b;try{this.verticies=new Float32Array(4*b.length),this.uvs=new Float32Array(4*b.length),this.colors=new Float32Array(2*b.length),this.indices=new Uint16Array(2*b.length)}catch(c){this.verticies=new Array(4*b.length),this.uvs=new Array(4*b.length),this.colors=new Array(2*b.length),this.indices=new Array(2*b.length)}this.refresh()},d.Rope.prototype=Object.create(d.Strip.prototype),d.Rope.prototype.constructor=d.Rope,d.Rope.prototype.refresh=function(){var a=this.points;if(!(a.length<1)){var b=this.uvs,c=a[0],d=this.indices,e=this.colors;this.count-=.2,b[0]=0,b[1]=1,b[2]=0,b[3]=1,e[0]=1,e[1]=1,d[0]=0,d[1]=1;for(var f,g,h,i=a.length,j=1;i>j;j++)f=a[j],g=4*j,h=j/(i-1),j%2?(b[g]=h,b[g+1]=0,b[g+2]=h,b[g+3]=1):(b[g]=h,b[g+1]=0,b[g+2]=h,b[g+3]=1),g=2*j,e[g]=1,e[g+1]=1,g=2*j,d[g]=g,d[g+1]=g+1,c=f}},d.Rope.prototype.updateTransform=function(){var a=this.points;if(!(a.length<1)){var b,c=a[0],e={x:0,y:0};this.count-=.2;var f=this.verticies;f[0]=c.x+e.x,f[1]=c.y+e.y,f[2]=c.x-e.x,f[3]=c.y-e.y;for(var g,h,i,j,k,l=a.length,m=1;l>m;m++)g=a[m],h=4*m,b=m1&&(i=1),j=Math.sqrt(e.x*e.x+e.y*e.y),k=this.texture.height/2,e.x/=j,e.y/=j,e.x*=k,e.y*=k,f[h]=g.x+e.x,f[h+1]=g.y+e.y,f[h+2]=g.x-e.x,f[h+3]=g.y-e.y,c=g;d.DisplayObjectContainer.prototype.updateTransform.call(this)}},d.Rope.prototype.setTexture=function(a){this.texture=a,this.updateFrame=!0},d.TilingSprite=function(a,b,c){d.Sprite.call(this,a),this.width=b||100,this.height=c||100,this.tileScale=new d.Point(1,1),this.tileScaleOffset=new d.Point(1,1),this.tilePosition=new d.Point(0,0),this.renderable=!0,this.tint=16777215,this.blendMode=d.blendModes.NORMAL},d.TilingSprite.prototype=Object.create(d.Sprite.prototype),d.TilingSprite.prototype.constructor=d.TilingSprite,Object.defineProperty(d.TilingSprite.prototype,"width",{get:function(){return this._width},set:function(a){this._width=a}}),Object.defineProperty(d.TilingSprite.prototype,"height",{get:function(){return this._height
+},set:function(a){this._height=a}}),d.TilingSprite.prototype.onTextureUpdate=function(){this.updateFrame=!0},d.TilingSprite.prototype._renderWebGL=function(a){if(this.visible!==!1&&0!==this.alpha){var b,c;if(this.mask||this.filters){for(this.mask&&(a.spriteBatch.stop(),a.maskManager.pushMask(this.mask,a),a.spriteBatch.start()),this.filters&&(a.spriteBatch.flush(),a.filterManager.pushFilter(this._filterBlock)),this.tilingTexture?a.spriteBatch.renderTilingSprite(this):this.generateTilingTexture(!0),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);a.spriteBatch.stop(),this.filters&&a.filterManager.popFilter(),this.mask&&a.maskManager.popMask(a),a.spriteBatch.start()}else for(this.tilingTexture?a.spriteBatch.renderTilingSprite(this):this.generateTilingTexture(!0),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},d.TilingSprite.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){var b=a.context;this._mask&&a.maskManager.pushMask(this._mask,b),b.globalAlpha=this.worldAlpha;var c=this.worldTransform;b.setTransform(c[0],c[3],c[1],c[4],c[2],c[5]),this.__tilePattern||(this.generateTilingTexture(!1),this.tilingTexture&&(this.__tilePattern=b.createPattern(this.tilingTexture.baseTexture.source,"repeat"))),this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,b.globalCompositeOperation=d.blendModesCanvas[a.currentBlendMode]),b.beginPath();var e=this.tilePosition,f=this.tileScale;b.scale(f.x,f.y),b.translate(e.x,e.y),b.fillStyle=this.__tilePattern,b.fillRect(-e.x,-e.y,this.width/f.x,this.height/f.y),b.scale(1/f.x,1/f.y),b.translate(-e.x,-e.y),b.closePath(),this._mask&&a.maskManager.popMask(a.context)}},d.TilingSprite.prototype.getBounds=function(){var a=this._width,b=this._height,c=a*(1-this.anchor.x),d=a*-this.anchor.x,e=b*(1-this.anchor.y),f=b*-this.anchor.y,g=this.worldTransform,h=g[0],i=g[3],j=g[1],k=g[4],l=g[2],m=g[5],n=h*d+j*f+l,o=k*f+i*d+m,p=h*c+j*f+l,q=k*f+i*c+m,r=h*c+j*e+l,s=k*e+i*c+m,t=h*d+j*e+l,u=k*e+i*d+m,v=-1/0,w=-1/0,x=1/0,y=1/0;x=x>n?n:x,x=x>p?p:x,x=x>r?r:x,x=x>t?t:x,y=y>o?o:y,y=y>q?q:y,y=y>s?s:y,y=y>u?u:y,v=n>v?n:v,v=p>v?p:v,v=r>v?r:v,v=t>v?t:v,w=o>w?o:w,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w;var z=this._bounds;return z.x=x,z.width=v-x,z.y=y,z.height=w-y,this._currentBounds=z,z},d.TilingSprite.prototype.generateTilingTexture=function(a){var b=this.texture;if(b.baseTexture.hasLoaded){var c,e,f=b.baseTexture,g=b.frame,h=g.width!==f.width||g.height!==f.height;this.tilingTexture=b;var i=!1;if(a?(c=d.getNextPowerOfTwo(b.frame.width),e=d.getNextPowerOfTwo(b.frame.height),g.width!==c&&g.height!==e&&(i=!0)):h&&(c=g.width,e=g.height,i=!0),i){var j=new d.CanvasBuffer(c,e);j.context.drawImage(b.baseTexture.source,g.x,g.y,g.width,g.height,0,0,c,e),this.tilingTexture=d.Texture.fromCanvas(j.canvas),this.tileScaleOffset.x=g.width/c,this.tileScaleOffset.y=g.height/e}this.tilingTexture.baseTexture._powerOf2=!0}};var i={};i.BoneData=function(a,b){this.name=a,this.parent=b},i.BoneData.prototype={length:0,x:0,y:0,rotation:0,scaleX:1,scaleY:1},i.SlotData=function(a,b){this.name=a,this.boneData=b},i.SlotData.prototype={r:1,g:1,b:1,a:1,attachmentName:null},i.Bone=function(a,b){this.data=a,this.parent=b,this.setToSetupPose()},i.Bone.yDown=!1,i.Bone.prototype={x:0,y:0,rotation:0,scaleX:1,scaleY:1,m00:0,m01:0,worldX:0,m10:0,m11:0,worldY:0,worldRotation:0,worldScaleX:1,worldScaleY:1,updateWorldTransform:function(a,b){var c=this.parent;null!=c?(this.worldX=this.x*c.m00+this.y*c.m01+c.worldX,this.worldY=this.x*c.m10+this.y*c.m11+c.worldY,this.worldScaleX=c.worldScaleX*this.scaleX,this.worldScaleY=c.worldScaleY*this.scaleY,this.worldRotation=c.worldRotation+this.rotation):(this.worldX=this.x,this.worldY=this.y,this.worldScaleX=this.scaleX,this.worldScaleY=this.scaleY,this.worldRotation=this.rotation);var d=this.worldRotation*Math.PI/180,e=Math.cos(d),f=Math.sin(d);this.m00=e*this.worldScaleX,this.m10=f*this.worldScaleX,this.m01=-f*this.worldScaleY,this.m11=e*this.worldScaleY,a&&(this.m00=-this.m00,this.m01=-this.m01),b&&(this.m10=-this.m10,this.m11=-this.m11),i.Bone.yDown&&(this.m10=-this.m10,this.m11=-this.m11)},setToSetupPose:function(){var a=this.data;this.x=a.x,this.y=a.y,this.rotation=a.rotation,this.scaleX=a.scaleX,this.scaleY=a.scaleY}},i.Slot=function(a,b,c){this.data=a,this.skeleton=b,this.bone=c,this.setToSetupPose()},i.Slot.prototype={r:1,g:1,b:1,a:1,_attachmentTime:0,attachment:null,setAttachment:function(a){this.attachment=a,this._attachmentTime=this.skeleton.time},setAttachmentTime:function(a){this._attachmentTime=this.skeleton.time-a},getAttachmentTime:function(){return this.skeleton.time-this._attachmentTime},setToSetupPose:function(){var a=this.data;this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a;for(var b=this.skeleton.data.slots,c=0,d=b.length;d>c;c++)if(b[c]==a){this.setAttachment(a.attachmentName?this.skeleton.getAttachmentBySlotIndex(c,a.attachmentName):null);break}}},i.Skin=function(a){this.name=a,this.attachments={}},i.Skin.prototype={addAttachment:function(a,b,c){this.attachments[a+":"+b]=c},getAttachment:function(a,b){return this.attachments[a+":"+b]},_attachAll:function(a,b){for(var c in b.attachments){var d=c.indexOf(":"),e=parseInt(c.substring(0,d),10),f=c.substring(d+1),g=a.slots[e];if(g.attachment&&g.attachment.name==f){var h=this.getAttachment(e,f);h&&g.setAttachment(h)}}}},i.Animation=function(a,b,c){this.name=a,this.timelines=b,this.duration=c},i.Animation.prototype={apply:function(a,b,c){c&&this.duration&&(b%=this.duration);for(var d=this.timelines,e=0,f=d.length;f>e;e++)d[e].apply(a,b,1)},mix:function(a,b,c,d){c&&this.duration&&(b%=this.duration);for(var e=this.timelines,f=0,g=e.length;g>f;f++)e[f].apply(a,b,d)}},i.binarySearch=function(a,b,c){var d=0,e=Math.floor(a.length/c)-2;if(!e)return c;for(var f=e>>>1;;){if(a[(f+1)*c]<=b?d=f+1:e=f,d==e)return(d+1)*c;f=d+e>>>1}},i.linearSearch=function(a,b,c){for(var d=0,e=a.length-c;e>=d;d+=c)if(a[d]>b)return d;return-1},i.Curves=function(a){this.curves=[],this.curves.length=6*(a-1)},i.Curves.prototype={setLinear:function(a){this.curves[6*a]=0},setStepped:function(a){this.curves[6*a]=-1},setCurve:function(a,b,c,d,e){var f=.1,g=f*f,h=g*f,i=3*f,j=3*g,k=6*g,l=6*h,m=2*-b+d,n=2*-c+e,o=3*(b-d)+1,p=3*(c-e)+1,q=6*a,r=this.curves;r[q]=b*i+m*j+o*h,r[q+1]=c*i+n*j+p*h,r[q+2]=m*k+o*l,r[q+3]=n*k+p*l,r[q+4]=o*l,r[q+5]=p*l},getCurvePercent:function(a,b){b=0>b?0:b>1?1:b;var c=6*a,d=this.curves,e=d[c];if(!e)return b;if(-1==e)return 0;for(var f=d[c+1],g=d[c+2],h=d[c+3],i=d[c+4],j=d[c+5],k=e,l=f,m=8;;){if(k>=b){var n=k-e,o=l-f;return o+(l-o)*(b-n)/(k-n)}if(!m)break;m--,e+=g,f+=h,g+=i,h+=j,k+=e,l+=f}return l+(1-l)*(b-k)/(1-k)}},i.RotateTimeline=function(a){this.curves=new i.Curves(a),this.frames=[],this.frames.length=2*a},i.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(a,b,c){a*=2,this.frames[a]=b,this.frames[a+1]=c},apply:function(a,b,c){var d,e=this.frames;if(!(b=e[e.length-2]){for(d=f.data.rotation+e[e.length-1]-f.rotation;d>180;)d-=360;for(;-180>d;)d+=360;return f.rotation+=d*c,void 0}var g=i.binarySearch(e,b,2),h=e[g-1],j=e[g],k=1-(b-j)/(e[g-2]-j);for(k=this.curves.getCurvePercent(g/2-1,k),d=e[g+1]-h;d>180;)d-=360;for(;-180>d;)d+=360;for(d=f.data.rotation+(h+d*k)-f.rotation;d>180;)d-=360;for(;-180>d;)d+=360;f.rotation+=d*c}}},i.TranslateTimeline=function(a){this.curves=new i.Curves(a),this.frames=[],this.frames.length=3*a},i.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d},apply:function(a,b,c){var d=this.frames;if(!(b=d[d.length-3])return e.x+=(e.data.x+d[d.length-2]-e.x)*c,e.y+=(e.data.y+d[d.length-1]-e.y)*c,void 0;var f=i.binarySearch(d,b,3),g=d[f-2],h=d[f-1],j=d[f],k=1-(b-j)/(d[f+-3]-j);k=this.curves.getCurvePercent(f/3-1,k),e.x+=(e.data.x+g+(d[f+1]-g)*k-e.x)*c,e.y+=(e.data.y+h+(d[f+2]-h)*k-e.y)*c}}},i.ScaleTimeline=function(a){this.curves=new i.Curves(a),this.frames=[],this.frames.length=3*a},i.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3,this.frames[a]=b,this.frames[a+1]=c,this.frames[a+2]=d},apply:function(a,b,c){var d=this.frames;if(!(b=d[d.length-3])return e.scaleX+=(e.data.scaleX-1+d[d.length-2]-e.scaleX)*c,e.scaleY+=(e.data.scaleY-1+d[d.length-1]-e.scaleY)*c,void 0;var f=i.binarySearch(d,b,3),g=d[f-2],h=d[f-1],j=d[f],k=1-(b-j)/(d[f+-3]-j);k=this.curves.getCurvePercent(f/3-1,k),e.scaleX+=(e.data.scaleX-1+g+(d[f+1]-g)*k-e.scaleX)*c,e.scaleY+=(e.data.scaleY-1+h+(d[f+2]-h)*k-e.scaleY)*c}}},i.ColorTimeline=function(a){this.curves=new i.Curves(a),this.frames=[],this.frames.length=5*a},i.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(c,d){c*=5,this.frames[c]=d,this.frames[c+1]=r,this.frames[c+2]=g,this.frames[c+3]=b,this.frames[c+4]=a},apply:function(a,b,c){var d=this.frames;if(!(b=d[d.length-5]){var f=d.length-1;return e.r=d[f-3],e.g=d[f-2],e.b=d[f-1],e.a=d[f],void 0}var g=i.binarySearch(d,b,5),h=d[g-4],j=d[g-3],k=d[g-2],l=d[g-1],m=d[g],n=1-(b-m)/(d[g-5]-m);n=this.curves.getCurvePercent(g/5-1,n);var o=h+(d[g+1]-h)*n,p=j+(d[g+2]-j)*n,q=k+(d[g+3]-k)*n,r=l+(d[g+4]-l)*n;1>c?(e.r+=(o-e.r)*c,e.g+=(p-e.g)*c,e.b+=(q-e.b)*c,e.a+=(r-e.a)*c):(e.r=o,e.g=p,e.b=q,e.a=r)}}},i.AttachmentTimeline=function(a){this.curves=new i.Curves(a),this.frames=[],this.frames.length=a,this.attachmentNames=[],this.attachmentNames.length=a},i.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length},setFrame:function(a,b,c){this.frames[a]=b,this.attachmentNames[a]=c},apply:function(a,b){var c=this.frames;if(!(b=c[c.length-1]?c.length-1:i.binarySearch(c,b,1)-1;var e=this.attachmentNames[d];a.slots[this.slotIndex].setAttachment(e?a.getAttachmentBySlotIndex(this.slotIndex,e):null)}}},i.SkeletonData=function(){this.bones=[],this.slots=[],this.skins=[],this.animations=[]},i.SkeletonData.prototype={defaultSkin:null,findBone:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},findBoneIndex:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].name==a)return c;return-1},findSlot:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].name==a)return slot[c];return null},findSlotIndex:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].name==a)return c;return-1},findSkin:function(a){for(var b=this.skins,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},findAnimation:function(a){for(var b=this.animations,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null}},i.Skeleton=function(a){this.data=a,this.bones=[];for(var b=0,c=a.bones.length;c>b;b++){var d=a.bones[b],e=d.parent?this.bones[a.bones.indexOf(d.parent)]:null;this.bones.push(new i.Bone(d,e))}for(this.slots=[],this.drawOrder=[],b=0,c=a.slots.length;c>b;b++){var f=a.slots[b],g=this.bones[a.bones.indexOf(f.boneData)],h=new i.Slot(f,this,g);this.slots.push(h),this.drawOrder.push(h)}},i.Skeleton.prototype={x:0,y:0,skin:null,r:1,g:1,b:1,a:1,time:0,flipX:!1,flipY:!1,updateWorldTransform:function(){for(var a=this.flipX,b=this.flipY,c=this.bones,d=0,e=c.length;e>d;d++)c[d].updateWorldTransform(a,b)},setToSetupPose:function(){this.setBonesToSetupPose(),this.setSlotsToSetupPose()},setBonesToSetupPose:function(){for(var a=this.bones,b=0,c=a.length;c>b;b++)a[b].setToSetupPose()},setSlotsToSetupPose:function(){for(var a=this.slots,b=0,c=a.length;c>b;b++)a[b].setToSetupPose(b)},getRootBone:function(){return this.bones.length?this.bones[0]:null},findBone:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return b[c];return null},findBoneIndex:function(a){for(var b=this.bones,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return c;return-1},findSlot:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return b[c];return null},findSlotIndex:function(a){for(var b=this.slots,c=0,d=b.length;d>c;c++)if(b[c].data.name==a)return c;return-1},setSkinByName:function(a){var b=this.data.findSkin(a);if(!b)throw"Skin not found: "+a;this.setSkin(b)},setSkin:function(a){this.skin&&a&&a._attachAll(this,this.skin),this.skin=a},getAttachmentBySlotName:function(a,b){return this.getAttachmentBySlotIndex(this.data.findSlotIndex(a),b)},getAttachmentBySlotIndex:function(a,b){if(this.skin){var c=this.skin.getAttachment(a,b);if(c)return c}return this.data.defaultSkin?this.data.defaultSkin.getAttachment(a,b):null},setAttachment:function(a,b){for(var c=this.slots,d=0,e=c.size;e>d;d++){var f=c[d];if(f.data.name==a){var g=null;if(b&&(g=this.getAttachment(d,b),null==g))throw"Attachment not found: "+b+", for slot: "+a;return f.setAttachment(g),void 0}}throw"Slot not found: "+a},update:function(a){time+=a}},i.AttachmentType={region:0},i.RegionAttachment=function(){this.offset=[],this.offset.length=8,this.uvs=[],this.uvs.length=8},i.RegionAttachment.prototype={x:0,y:0,rotation:0,scaleX:1,scaleY:1,width:0,height:0,rendererObject:null,regionOffsetX:0,regionOffsetY:0,regionWidth:0,regionHeight:0,regionOriginalWidth:0,regionOriginalHeight:0,setUVs:function(a,b,c,d,e){var f=this.uvs;e?(f[2]=a,f[3]=d,f[4]=a,f[5]=b,f[6]=c,f[7]=b,f[0]=c,f[1]=d):(f[0]=a,f[1]=d,f[2]=a,f[3]=b,f[4]=c,f[5]=b,f[6]=c,f[7]=d)},updateOffset:function(){var a=this.width/this.regionOriginalWidth*this.scaleX,b=this.height/this.regionOriginalHeight*this.scaleY,c=-this.width/2*this.scaleX+this.regionOffsetX*a,d=-this.height/2*this.scaleY+this.regionOffsetY*b,e=c+this.regionWidth*a,f=d+this.regionHeight*b,g=this.rotation*Math.PI/180,h=Math.cos(g),i=Math.sin(g),j=c*h+this.x,k=c*i,l=d*h+this.y,m=d*i,n=e*h+this.x,o=e*i,p=f*h+this.y,q=f*i,r=this.offset;r[0]=j-m,r[1]=l+k,r[2]=j-q,r[3]=p+k,r[4]=n-q,r[5]=p+o,r[6]=n-m,r[7]=l+o},computeVertices:function(a,b,c,d){a+=c.worldX,b+=c.worldY;var e=c.m00,f=c.m01,g=c.m10,h=c.m11,i=this.offset;d[0]=i[0]*e+i[1]*f+a,d[1]=i[0]*g+i[1]*h+b,d[2]=i[2]*e+i[3]*f+a,d[3]=i[2]*g+i[3]*h+b,d[4]=i[4]*e+i[5]*f+a,d[5]=i[4]*g+i[5]*h+b,d[6]=i[6]*e+i[7]*f+a,d[7]=i[6]*g+i[7]*h+b}},i.AnimationStateData=function(a){this.skeletonData=a,this.animationToMixTime={}},i.AnimationStateData.prototype={defaultMix:0,setMixByName:function(a,b,c){var d=this.skeletonData.findAnimation(a);if(!d)throw"Animation not found: "+a;var e=this.skeletonData.findAnimation(b);if(!e)throw"Animation not found: "+b;this.setMix(d,e,c)},setMix:function(a,b,c){this.animationToMixTime[a.name+":"+b.name]=c},getMix:function(a,b){var c=this.animationToMixTime[a.name+":"+b.name];return c?c:this.defaultMix}},i.AnimationState=function(a){this.data=a,this.queue=[]},i.AnimationState.prototype={current:null,previous:null,currentTime:0,previousTime:0,currentLoop:!1,previousLoop:!1,mixTime:0,mixDuration:0,update:function(a){if(this.currentTime+=a,this.previousTime+=a,this.mixTime+=a,this.queue.length>0){var b=this.queue[0];this.currentTime>=b.delay&&(this._setAnimation(b.animation,b.loop),this.queue.shift())}},apply:function(a){if(this.current)if(this.previous){this.previous.apply(a,this.previousTime,this.previousLoop);var b=this.mixTime/this.mixDuration;b>=1&&(b=1,this.previous=null),this.current.mix(a,this.currentTime,this.currentLoop,b)}else this.current.apply(a,this.currentTime,this.currentLoop)},clearAnimation:function(){this.previous=null,this.current=null,this.queue.length=0},_setAnimation:function(a,b){this.previous=null,a&&this.current&&(this.mixDuration=this.data.getMix(this.current,a),this.mixDuration>0&&(this.mixTime=0,this.previous=this.current,this.previousTime=this.currentTime,this.previousLoop=this.currentLoop)),this.current=a,this.currentLoop=b,this.currentTime=0},setAnimationByName:function(a,b){var c=this.data.skeletonData.findAnimation(a);if(!c)throw"Animation not found: "+a;this.setAnimation(c,b)},setAnimation:function(a,b){this.queue.length=0,this._setAnimation(a,b)},addAnimationByName:function(a,b,c){var d=this.data.skeletonData.findAnimation(a);if(!d)throw"Animation not found: "+a;this.addAnimation(d,b,c)},addAnimation:function(a,b,c){var d={};if(d.animation=a,d.loop=b,!c||0>=c){var e=this.queue.length?this.queue[this.queue.length-1].animation:this.current;c=null!=e?e.duration-this.data.getMix(e,a)+(c||0):0}d.delay=c,this.queue.push(d)},isComplete:function(){return!this.current||this.currentTime>=this.current.duration}},i.SkeletonJson=function(a){this.attachmentLoader=a},i.SkeletonJson.prototype={scale:1,readSkeletonData:function(a){for(var b,c=new i.SkeletonData,d=a.bones,e=0,f=d.length;f>e;e++){var g=d[e],h=null;if(g.parent&&(h=c.findBone(g.parent),!h))throw"Parent bone not found: "+g.parent;b=new i.BoneData(g.name,h),b.length=(g.length||0)*this.scale,b.x=(g.x||0)*this.scale,b.y=(g.y||0)*this.scale,b.rotation=g.rotation||0,b.scaleX=g.scaleX||1,b.scaleY=g.scaleY||1,c.bones.push(b)}var j=a.slots;for(e=0,f=j.length;f>e;e++){var k=j[e];if(b=c.findBone(k.bone),!b)throw"Slot bone not found: "+k.bone;var l=new i.SlotData(k.name,b),m=k.color;m&&(l.r=i.SkeletonJson.toColor(m,0),l.g=i.SkeletonJson.toColor(m,1),l.b=i.SkeletonJson.toColor(m,2),l.a=i.SkeletonJson.toColor(m,3)),l.attachmentName=k.attachment,c.slots.push(l)}var n=a.skins;for(var o in n)if(n.hasOwnProperty(o)){var p=n[o],q=new i.Skin(o);for(var r in p)if(p.hasOwnProperty(r)){var s=c.findSlotIndex(r),t=p[r];for(var u in t)if(t.hasOwnProperty(u)){var v=this.readAttachment(q,u,t[u]);null!=v&&q.addAttachment(s,u,v)}}c.skins.push(q),"default"==q.name&&(c.defaultSkin=q)}var w=a.animations;for(var x in w)w.hasOwnProperty(x)&&this.readAnimation(x,w[x],c);return c},readAttachment:function(a,b,c){b=c.name||b;var d=i.AttachmentType[c.type||"region"];if(d==i.AttachmentType.region){var e=new i.RegionAttachment;return e.x=(c.x||0)*this.scale,e.y=(c.y||0)*this.scale,e.scaleX=c.scaleX||1,e.scaleY=c.scaleY||1,e.rotation=c.rotation||0,e.width=(c.width||32)*this.scale,e.height=(c.height||32)*this.scale,e.updateOffset(),e.rendererObject={},e.rendererObject.name=b,e.rendererObject.scale={},e.rendererObject.scale.x=e.scaleX,e.rendererObject.scale.y=e.scaleY,e.rendererObject.rotation=-e.rotation*Math.PI/180,e}throw"Unknown attachment type: "+d},readAnimation:function(a,b,c){var d,e,f,g,h,j,k,l=[],m=0,n=b.bones;for(var o in n)if(n.hasOwnProperty(o)){var p=c.findBoneIndex(o);if(-1==p)throw"Bone not found: "+o;var q=n[o];for(f in q)if(q.hasOwnProperty(f))if(h=q[f],"rotate"==f){for(e=new i.RotateTimeline(h.length),e.boneIndex=p,d=0,j=0,k=h.length;k>j;j++)g=h[j],e.setFrame(d,g.time,g.angle),i.SkeletonJson.readCurve(e,d,g),d++;l.push(e),m=Math.max(m,e.frames[2*e.getFrameCount()-2])}else{if("translate"!=f&&"scale"!=f)throw"Invalid timeline type for a bone: "+f+" ("+o+")";var r=1;for("scale"==f?e=new i.ScaleTimeline(h.length):(e=new i.TranslateTimeline(h.length),r=this.scale),e.boneIndex=p,d=0,j=0,k=h.length;k>j;j++){g=h[j];var s=(g.x||0)*r,t=(g.y||0)*r;e.setFrame(d,g.time,s,t),i.SkeletonJson.readCurve(e,d,g),d++}l.push(e),m=Math.max(m,e.frames[3*e.getFrameCount()-3])}}var u=b.slots;for(var v in u)if(u.hasOwnProperty(v)){var w=u[v],x=c.findSlotIndex(v);for(f in w)if(w.hasOwnProperty(f))if(h=w[f],"color"==f){for(e=new i.ColorTimeline(h.length),e.slotIndex=x,d=0,j=0,k=h.length;k>j;j++){g=h[j];var y=g.color,z=i.SkeletonJson.toColor(y,0),A=i.SkeletonJson.toColor(y,1),B=i.SkeletonJson.toColor(y,2),C=i.SkeletonJson.toColor(y,3);e.setFrame(d,g.time,z,A,B,C),i.SkeletonJson.readCurve(e,d,g),d++}l.push(e),m=Math.max(m,e.frames[5*e.getFrameCount()-5])}else{if("attachment"!=f)throw"Invalid timeline type for a slot: "+f+" ("+v+")";for(e=new i.AttachmentTimeline(h.length),e.slotIndex=x,d=0,j=0,k=h.length;k>j;j++)g=h[j],e.setFrame(d++,g.time,g.name);l.push(e),m=Math.max(m,e.frames[e.getFrameCount()-1])}}c.animations.push(new i.Animation(a,l,m))}},i.SkeletonJson.readCurve=function(a,b,c){var d=c.curve;d&&("stepped"==d?a.curves.setStepped(b):d instanceof Array&&a.curves.setCurve(b,d[0],d[1],d[2],d[3]))},i.SkeletonJson.toColor=function(a,b){if(8!=a.length)throw"Color hexidecimal length must be 8, recieved: "+a;return parseInt(a.substring(2*b,2),16)/255},i.Atlas=function(a,b){this.textureLoader=b,this.pages=[],this.regions=[];var c=new i.AtlasReader(a),d=[];d.length=4;for(var e=null;;){var f=c.readLine();if(null==f)break;if(f=c.trim(f),f.length)if(e){var g=new i.AtlasRegion;g.name=f,g.page=e,g.rotate="true"==c.readValue(),c.readTuple(d);var h=parseInt(d[0],10),j=parseInt(d[1],10);c.readTuple(d);var k=parseInt(d[0],10),l=parseInt(d[1],10);g.u=h/e.width,g.v=j/e.height,g.rotate?(g.u2=(h+l)/e.width,g.v2=(j+k)/e.height):(g.u2=(h+k)/e.width,g.v2=(j+l)/e.height),g.x=h,g.y=j,g.width=Math.abs(k),g.height=Math.abs(l),4==c.readTuple(d)&&(g.splits=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10)],4==c.readTuple(d)&&(g.pads=[parseInt(d[0],10),parseInt(d[1],10),parseInt(d[2],10),parseInt(d[3],10)],c.readTuple(d))),g.originalWidth=parseInt(d[0],10),g.originalHeight=parseInt(d[1],10),c.readTuple(d),g.offsetX=parseInt(d[0],10),g.offsetY=parseInt(d[1],10),g.index=parseInt(c.readValue(),10),this.regions.push(g)}else{e=new i.AtlasPage,e.name=f,e.format=i.Atlas.Format[c.readValue()],c.readTuple(d),e.minFilter=i.Atlas.TextureFilter[d[0]],e.magFilter=i.Atlas.TextureFilter[d[1]];var m=c.readValue();e.uWrap=i.Atlas.TextureWrap.clampToEdge,e.vWrap=i.Atlas.TextureWrap.clampToEdge,"x"==m?e.uWrap=i.Atlas.TextureWrap.repeat:"y"==m?e.vWrap=i.Atlas.TextureWrap.repeat:"xy"==m&&(e.uWrap=e.vWrap=i.Atlas.TextureWrap.repeat),b.load(e,f),this.pages.push(e)}else e=null}},i.Atlas.prototype={findRegion:function(a){for(var b=this.regions,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},dispose:function(){for(var a=this.pages,b=0,c=a.length;c>b;b++)this.textureLoader.unload(a[b].rendererObject)},updateUVs:function(a){for(var b=this.regions,c=0,d=b.length;d>c;c++){var e=b[c];e.page==a&&(e.u=e.x/a.width,e.v=e.y/a.height,e.rotate?(e.u2=(e.x+e.height)/a.width,e.v2=(e.y+e.width)/a.height):(e.u2=(e.x+e.width)/a.width,e.v2=(e.y+e.height)/a.height))}}},i.Atlas.Format={alpha:0,intensity:1,luminanceAlpha:2,rgb565:3,rgba4444:4,rgb888:5,rgba8888:6},i.Atlas.TextureFilter={nearest:0,linear:1,mipMap:2,mipMapNearestNearest:3,mipMapLinearNearest:4,mipMapNearestLinear:5,mipMapLinearLinear:6},i.Atlas.TextureWrap={mirroredRepeat:0,clampToEdge:1,repeat:2},i.AtlasPage=function(){},i.AtlasPage.prototype={name:null,format:null,minFilter:null,magFilter:null,uWrap:null,vWrap:null,rendererObject:null,width:0,height:0},i.AtlasRegion=function(){},i.AtlasRegion.prototype={page:null,name:null,x:0,y:0,width:0,height:0,u:0,v:0,u2:0,v2:0,offsetX:0,offsetY:0,originalWidth:0,originalHeight:0,index:0,rotate:!1,splits:null,pads:null},i.AtlasReader=function(a){this.lines=a.split(/\r\n|\r|\n/)},i.AtlasReader.prototype={index:0,trim:function(a){return a.replace(/^\s+|\s+$/g,"")},readLine:function(){return this.index>=this.lines.length?null:this.lines[this.index++]},readValue:function(){var a=this.readLine(),b=a.indexOf(":");if(-1==b)throw"Invalid line: "+a;return this.trim(a.substring(b+1))},readTuple:function(a){var b=this.readLine(),c=b.indexOf(":");if(-1==c)throw"Invalid line: "+b;for(var d=0,e=c+1;3>d;d++){var f=b.indexOf(",",e);if(-1==f){if(!d)throw"Invalid line: "+b;break}a[d]=this.trim(b.substr(e,f-e)),e=f+1}return a[d]=this.trim(b.substring(e)),d+1}},i.AtlasAttachmentLoader=function(a){this.atlas=a},i.AtlasAttachmentLoader.prototype={newAttachment:function(a,b,c){switch(b){case i.AttachmentType.region:var d=this.atlas.findRegion(c);if(!d)throw"Region not found in atlas: "+c+" ("+b+")";var e=new i.RegionAttachment(c);return e.rendererObject=d,e.setUVs(d.u,d.v,d.u2,d.v2,d.rotate),e.regionOffsetX=d.offsetX,e.regionOffsetY=d.offsetY,e.regionWidth=d.width,e.regionHeight=d.height,e.regionOriginalWidth=d.originalWidth,e.regionOriginalHeight=d.originalHeight,e}throw"Unknown attachment type: "+b}},i.Bone.yDown=!0,d.AnimCache={},d.Spine=function(a){if(d.DisplayObjectContainer.call(this),this.spineData=d.AnimCache[a],!this.spineData)throw new Error("Spine data must be preloaded using PIXI.SpineLoader or PIXI.AssetLoader: "+a);this.skeleton=new i.Skeleton(this.spineData),this.skeleton.updateWorldTransform(),this.stateData=new i.AnimationStateData(this.spineData),this.state=new i.AnimationState(this.stateData),this.slotContainers=[];for(var b=0,c=this.skeleton.drawOrder.length;c>b;b++){var e=this.skeleton.drawOrder[b],f=e.attachment,g=new d.DisplayObjectContainer;if(this.slotContainers.push(g),this.addChild(g),f instanceof i.RegionAttachment){var h=f.rendererObject.name,j=this.createSprite(e,f.rendererObject);e.currentSprite=j,e.currentSpriteName=h,g.addChild(j)}}},d.Spine.prototype=Object.create(d.DisplayObjectContainer.prototype),d.Spine.prototype.constructor=d.Spine,d.Spine.prototype.updateTransform=function(){this.lastTime=this.lastTime||Date.now();var a=.001*(Date.now()-this.lastTime);this.lastTime=Date.now(),this.state.update(a),this.state.apply(this.skeleton),this.skeleton.updateWorldTransform();for(var b=this.skeleton.drawOrder,c=0,e=b.length;e>c;c++){var f=b[c],g=f.attachment,h=this.slotContainers[c];if(g instanceof i.RegionAttachment){if(g.rendererObject&&(!f.currentSpriteName||f.currentSpriteName!=g.name)){var j=g.rendererObject.name;if(void 0!==f.currentSprite&&(f.currentSprite.visible=!1),f.sprites=f.sprites||{},void 0!==f.sprites[j])f.sprites[j].visible=!0;else{var k=this.createSprite(f,g.rendererObject);h.addChild(k)}f.currentSprite=f.sprites[j],f.currentSpriteName=j}h.visible=!0;var l=f.bone;h.position.x=l.worldX+g.x*l.m00+g.y*l.m01,h.position.y=l.worldY+g.x*l.m10+g.y*l.m11,h.scale.x=l.worldScaleX,h.scale.y=l.worldScaleY,h.rotation=-(f.bone.worldRotation*Math.PI/180)}else h.visible=!1}d.DisplayObjectContainer.prototype.updateTransform.call(this)},d.Spine.prototype.createSprite=function(a,b){var c=d.TextureCache[b.name]?b.name:b.name+".png",e=new d.Sprite(d.Texture.fromFrame(c));return e.scale=b.scale,e.rotation=b.rotation,e.anchor.x=e.anchor.y=.5,a.sprites=a.sprites||{},a.sprites[b.name]=e,e},d.BaseTextureCache={},d.texturesToUpdate=[],d.texturesToDestroy=[],d.BaseTextureCacheIdGenerator=0,d.BaseTexture=function(a,b){if(d.EventTarget.call(this),this.width=100,this.height=100,this.scaleMode=b||d.scaleModes.DEFAULT,this.hasLoaded=!1,this.source=a,a){if(this.source instanceof Image||this.source instanceof HTMLImageElement)if(this.source.complete)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,d.texturesToUpdate.push(this);else{var c=this;this.source.onload=function(){c.hasLoaded=!0,c.width=c.source.width,c.height=c.source.height,d.texturesToUpdate.push(c),c.dispatchEvent({type:"loaded",content:c})}}else this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,d.texturesToUpdate.push(this);this.imageUrl=null,this._powerOf2=!1,this.id=d.BaseTextureCacheIdGenerator++,this._glTextures=[]}},d.BaseTexture.prototype.constructor=d.BaseTexture,d.BaseTexture.prototype.destroy=function(){this.source instanceof Image&&(this.imageUrl in d.BaseTextureCache&&delete d.BaseTextureCache[this.imageUrl],this.imageUrl=null,this.source.src=null),this.source=null,d.texturesToDestroy.push(this)},d.BaseTexture.prototype.updateSourceImage=function(a){this.hasLoaded=!1,this.source.src=null,this.source.src=a},d.BaseTexture.fromImage=function(a,b,c){var e=d.BaseTextureCache[a];if(b=!b,!e){var f=new Image;b&&(f.crossOrigin=""),f.src=a,e=new d.BaseTexture(f,c),e.imageUrl=a,d.BaseTextureCache[a]=e}return e},d.BaseTexture.fromCanvas=function(a,b){a._pixiId||(a._pixiId="canvas_"+d.TextureCacheIdGenerator++);var c=d.BaseTextureCache[a._pixiId];return c||(c=new d.BaseTexture(a,b),d.BaseTextureCache[a._pixiId]=c),c},d.TextureCache={},d.FrameCache={},d.TextureCacheIdGenerator=0,d.Texture=function(a,b){if(d.EventTarget.call(this),b||(this.noFrame=!0,b=new d.Rectangle(0,0,1,1)),a instanceof d.Texture&&(a=a.baseTexture),this.baseTexture=a,this.frame=b,this.trim=new d.Point,this.scope=this,a.hasLoaded)this.noFrame&&(b=new d.Rectangle(0,0,a.width,a.height)),this.setFrame(b);else{var c=this;a.addEventListener("loaded",function(){c.onBaseTextureLoaded()})}},d.Texture.prototype.constructor=d.Texture,d.Texture.prototype.onBaseTextureLoaded=function(){var a=this.baseTexture;a.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new d.Rectangle(0,0,a.width,a.height)),this.setFrame(this.frame),this.scope.dispatchEvent({type:"update",content:this})},d.Texture.prototype.destroy=function(a){a&&this.baseTexture.destroy()},d.Texture.prototype.setFrame=function(a){if(this.frame=a,this.width=a.width,this.height=a.height,a.x+a.width>this.baseTexture.width||a.y+a.height>this.baseTexture.height)throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.updateFrame=!0,d.Texture.frameUpdates.push(this)},d.Texture.prototype._updateWebGLuvs=function(){this._uvs||(this._uvs=new Float32Array(8));var a=this.frame,b=this.baseTexture.width,c=this.baseTexture.height;this._uvs[0]=a.x/b,this._uvs[1]=a.y/c,this._uvs[2]=(a.x+a.width)/b,this._uvs[3]=a.y/c,this._uvs[4]=(a.x+a.width)/b,this._uvs[5]=(a.y+a.height)/c,this._uvs[6]=a.x/b,this._uvs[7]=(a.y+a.height)/c},d.Texture.fromImage=function(a,b,c){var e=d.TextureCache[a];return e||(e=new d.Texture(d.BaseTexture.fromImage(a,b,c)),d.TextureCache[a]=e),e},d.Texture.fromFrame=function(a){var b=d.TextureCache[a];if(!b)throw new Error('The frameId "'+a+'" does not exist in the texture cache ');return b},d.Texture.fromCanvas=function(a,b){var c=d.BaseTexture.fromCanvas(a,b);return new d.Texture(c)},d.Texture.addTextureToCache=function(a,b){d.TextureCache[b]=a},d.Texture.removeTextureFromCache=function(a){var b=d.TextureCache[a];return d.TextureCache[a]=null,b},d.Texture.frameUpdates=[],d.RenderTexture=function(a,b,c){if(d.EventTarget.call(this),this.width=a||100,this.height=b||100,this.identityMatrix=d.mat3.create(),this.frame=new d.Rectangle(0,0,this.width,this.height),this.baseTexture=new d.BaseTexture,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.baseTexture._glTextures=[],this.baseTexture.hasLoaded=!0,this.renderer=c||d.defaultRenderer,this.renderer.type===d.WEBGL_RENDERER){var e=this.renderer.gl;this.textureBuffer=new d.FilterTexture(e,this.width,this.height),this.baseTexture._glTextures[e.id]=this.textureBuffer.texture,this.render=this.renderWebGL,this.projection=new d.Point(this.width/2,-this.height/2)}else this.render=this.renderCanvas,this.textureBuffer=new d.CanvasBuffer(this.width,this.height),this.baseTexture.source=this.textureBuffer.canvas;d.Texture.frameUpdates.push(this)},d.RenderTexture.prototype=Object.create(d.Texture.prototype),d.RenderTexture.prototype.constructor=d.RenderTexture,d.RenderTexture.prototype.resize=function(a,b){if(this.width=a,this.height=b,this.frame.width=this.width,this.frame.height=this.height,this.renderer.type===d.WEBGL_RENDERER){this.projection.x=this.width/2,this.projection.y=-this.height/2;var c=this.gl;c.bindTexture(c.TEXTURE_2D,this.baseTexture._glTextures[c.id]),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,this.width,this.height,0,c.RGBA,c.UNSIGNED_BYTE,null)}else this.textureBuffer.resize(this.width,this.height);d.Texture.frameUpdates.push(this)},d.RenderTexture.prototype.renderWebGL=function(a,b,c){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.viewport(0,0,this.width,this.height),e.bindFramebuffer(e.FRAMEBUFFER,this.textureBuffer.frameBuffer),c&&this.textureBuffer.clear();var f=a.children,g=a.worldTransform;a.worldTransform=d.mat3.create(),a.worldTransform[4]=-1,a.worldTransform[5]=-2*this.projection.y,b&&(a.worldTransform[2]=b.x,a.worldTransform[5]-=b.y);for(var h=0,i=f.length;i>h;h++)f[h].updateTransform();d.WebGLRenderer.updateTextures(),this.renderer.renderDisplayObject(a,this.projection,this.textureBuffer.frameBuffer),a.worldTransform=g},d.RenderTexture.prototype.renderCanvas=function(a,b,c){var e=a.children;
+a.worldTransform=d.mat3.create(),b&&(a.worldTransform[2]=b.x,a.worldTransform[5]=b.y);for(var f=0,g=e.length;g>f;f++)e[f].updateTransform();c&&this.textureBuffer.clear();var h=this.textureBuffer.context;this.renderer.renderDisplayObject(a,h),h.setTransform(1,0,0,1,0,0)},d.AssetLoader=function(a,b){d.EventTarget.call(this),this.assetURLs=a,this.crossorigin=b,this.loadersByType={jpg:d.ImageLoader,jpeg:d.ImageLoader,png:d.ImageLoader,gif:d.ImageLoader,json:d.JsonLoader,atlas:d.AtlasLoader,anim:d.SpineLoader,xml:d.BitmapFontLoader,fnt:d.BitmapFontLoader}},d.AssetLoader.prototype.constructor=d.AssetLoader,d.AssetLoader.prototype._getDataType=function(a){var b="data:",c=a.slice(0,b.length).toLowerCase();if(c===b){var d=a.slice(b.length),e=d.indexOf(",");if(-1===e)return null;var f=d.slice(0,e).split(";")[0];return f&&"text/plain"!==f.toLowerCase()?f.split("/").pop().toLowerCase():"txt"}return null},d.AssetLoader.prototype.load=function(){function a(){b.onAssetLoaded()}var b=this;this.loadCount=this.assetURLs.length;for(var c=0;c0){if(f===g)this.atlas.meta.image.push(a[g]),c=this.atlas.meta.image.length-1,this.atlas.frames.push({}),b=-3;else if(b>0)if(b%7===1)null!=e&&(this.atlas.frames[c][e.name]=e),e={name:a[g],frame:{}};else{var j=a[g].split(" ");if(b%7===3)e.frame.x=Number(j[1].replace(",","")),e.frame.y=Number(j[2]);else if(b%7===4)e.frame.w=Number(j[1].replace(",","")),e.frame.h=Number(j[2]);else if(b%7===5){var k={x:0,y:0,w:Number(j[1].replace(",","")),h:Number(j[2])};k.w>e.frame.w||k.h>e.frame.h?(e.trimmed=!0,e.realSize=k):e.trimmed=!1}}b++}if(null!=e&&(this.atlas.frames[c][e.name]=e),this.atlas.meta.image.length>0){for(this.images=[],h=0;hthis.currentImageId?(this.currentImageId++,this.images[this.currentImageId].load()):(this.loaded=!0,this.dispatchEvent({type:"loaded",content:this}))},d.AtlasLoader.prototype.onError=function(){this.dispatchEvent({type:"error",content:this})},d.SpriteSheetLoader=function(a,b){d.EventTarget.call(this),this.url=a,this.crossorigin=b,this.baseUrl=a.replace(/[^\/]*$/,""),this.texture=null,this.frames={}},d.SpriteSheetLoader.prototype.constructor=d.SpriteSheetLoader,d.SpriteSheetLoader.prototype.load=function(){var a=this,b=new d.JsonLoader(this.url,this.crossorigin);b.addEventListener("loaded",function(b){a.json=b.content.json,a.onLoaded()}),b.load()},d.SpriteSheetLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},d.ImageLoader=function(a,b){d.EventTarget.call(this),this.texture=d.Texture.fromImage(a,b),this.frames=[]},d.ImageLoader.prototype.constructor=d.ImageLoader,d.ImageLoader.prototype.load=function(){if(this.texture.baseTexture.hasLoaded)this.onLoaded();else{var a=this;this.texture.baseTexture.addEventListener("loaded",function(){a.onLoaded()})}},d.ImageLoader.prototype.onLoaded=function(){this.dispatchEvent({type:"loaded",content:this})},d.ImageLoader.prototype.loadFramedSpriteSheet=function(a,b,c){this.frames=[];for(var e=Math.floor(this.texture.width/a),f=Math.floor(this.texture.height/b),g=0,h=0;f>h;h++)for(var i=0;e>i;i++,g++){var j=new d.Texture(this.texture,{x:i*a,y:h*b,width:a,height:b});this.frames.push(j),c&&(d.TextureCache[c+"-"+g]=j)}if(this.texture.baseTexture.hasLoaded)this.onLoaded();else{var k=this;this.texture.baseTexture.addEventListener("loaded",function(){k.onLoaded()})}},d.BitmapFontLoader=function(a,b){d.EventTarget.call(this),this.url=a,this.crossorigin=b,this.baseUrl=a.replace(/[^\/]*$/,""),this.texture=null},d.BitmapFontLoader.prototype.constructor=d.BitmapFontLoader,d.BitmapFontLoader.prototype.load=function(){this.ajaxRequest=new XMLHttpRequest;var a=this;this.ajaxRequest.onreadystatechange=function(){a.onXMLLoaded()},this.ajaxRequest.open("GET",this.url,!0),this.ajaxRequest.overrideMimeType&&this.ajaxRequest.overrideMimeType("application/xml"),this.ajaxRequest.send(null)},d.BitmapFontLoader.prototype.onXMLLoaded=function(){if(4===this.ajaxRequest.readyState&&(200===this.ajaxRequest.status||-1===window.location.protocol.indexOf("http"))){var a=this.ajaxRequest.responseXML;if(!a||/MSIE 9/i.test(navigator.userAgent)||navigator.isCocoonJS)if("function"==typeof window.DOMParser){var b=new DOMParser;a=b.parseFromString(this.ajaxRequest.responseText,"text/xml")}else{var c=document.createElement("div");c.innerHTML=this.ajaxRequest.responseText,a=c}var e=this.baseUrl+a.getElementsByTagName("page")[0].getAttribute("file"),f=new d.ImageLoader(e,this.crossorigin);this.texture=f.texture.baseTexture;var g={},h=a.getElementsByTagName("info")[0],i=a.getElementsByTagName("common")[0];g.font=h.getAttribute("face"),g.size=parseInt(h.getAttribute("size"),10),g.lineHeight=parseInt(i.getAttribute("lineHeight"),10),g.chars={};for(var j=a.getElementsByTagName("char"),k=0;k
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -194,7 +200,7 @@
-
This is the base class for creating a pixi.js filter. Currently only webGL supports filters.
+
This is the base class for creating a pixi.js filter. Currently only webGL supports filters.
If you want to make a custom filter this should be your base class.
diff --git a/docs/classes/AlphaMaskFilter.html b/docs/classes/AlphaMaskFilter.html
index 4ddca45..fb0355b 100644
--- a/docs/classes/AlphaMaskFilter.html
+++ b/docs/classes/AlphaMaskFilter.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -231,20 +237,6 @@
-
-
-
- offset
-
-
-
-
-
-
- scale
-
-
-
@@ -286,7 +278,7 @@
-
src/pixi/filters/AlphaMaskFilter.js:86
+
src/pixi/filters/AlphaMaskFilter.js:79
@@ -305,96 +297,6 @@
-
-
-
-
-
offset
-
Point
-
-
-
-
-
-
-
-
-
-
-
-
-
The offset used to move the displacement map.
-
-
-
-
-
-
-
-
-
-
-
-
-
scale
-
Point
-
-
-
-
-
-
-
-
-
-
-
-
-
The multiplier used to scale the displacement result from the map calculation.
-
-
-
-
-
-
-
-
diff --git a/docs/classes/AssetLoader.html b/docs/classes/AssetLoader.html
index 4244c5f..e7e2290 100644
--- a/docs/classes/AssetLoader.html
+++ b/docs/classes/AssetLoader.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/classes/AtlasLoader.html b/docs/classes/AtlasLoader.html
index cdb5cc7..84ef2c8 100644
--- a/docs/classes/AtlasLoader.html
+++ b/docs/classes/AtlasLoader.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -198,9 +204,9 @@
-
The atlas file loader is used to load in Atlas data and parsing it
+
The atlas file loader is used to load in Atlas data and parse it
When loaded this class will dispatch a 'loaded' event
-If load failed this class will dispatch a 'error' event
+If loading fails this class will dispatch an 'error' event
diff --git a/docs/classes/BaseTexture.html b/docs/classes/BaseTexture.html
index 216a2cd..9659249 100644
--- a/docs/classes/BaseTexture.html
+++ b/docs/classes/BaseTexture.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -187,7 +193,7 @@
@@ -252,7 +258,7 @@
-
src/pixi/textures/BaseTexture.js:9
+
src/pixi/textures/BaseTexture.js:11
@@ -438,7 +444,7 @@
-
src/pixi/textures/BaseTexture.js:113
+
src/pixi/textures/BaseTexture.js:117
@@ -493,7 +499,7 @@
-
src/pixi/textures/BaseTexture.js:131
+
src/pixi/textures/BaseTexture.js:135
@@ -563,7 +569,7 @@
-
src/pixi/textures/BaseTexture.js:144
+
src/pixi/textures/BaseTexture.js:148
@@ -575,7 +581,7 @@
Helper function that returns a base texture based on an image url
-If the image is not in the base texture cache it will be created and loaded
+If the image is not in the base texture cache it will be created and loaded
@@ -654,7 +660,7 @@ If the image is not in the base texture cache it will be created and loaded
-
src/pixi/textures/BaseTexture.js:47
+
src/pixi/textures/BaseTexture.js:49
@@ -699,7 +705,7 @@ If the image is not in the base texture cache it will be created and loaded
-
src/pixi/textures/BaseTexture.js:30
+
src/pixi/textures/BaseTexture.js:32
@@ -723,7 +729,7 @@ If the image is not in the base texture cache it will be created and loaded
-
Default: PIXI.BaseTexture.SCALE_MODE.LINEAR
+
Default: PIXI.scaleModes.LINEAR
@@ -791,7 +797,7 @@ If the image is not in the base texture cache it will be created and loaded
-
src/pixi/textures/BaseTexture.js:56
+
src/pixi/textures/BaseTexture.js:58
@@ -836,7 +842,7 @@ If the image is not in the base texture cache it will be created and loaded
-
src/pixi/textures/BaseTexture.js:21
+
src/pixi/textures/BaseTexture.js:23
diff --git a/docs/classes/BitmapFontLoader.html b/docs/classes/BitmapFontLoader.html
index 013b426..5e054a8 100644
--- a/docs/classes/BitmapFontLoader.html
+++ b/docs/classes/BitmapFontLoader.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -511,7 +517,7 @@ When loaded this class will dispatch a 'loaded' event
-
src/pixi/loaders/BitmapFontLoader.js:153
+
src/pixi/loaders/BitmapFontLoader.js:165
diff --git a/docs/classes/BitmapText.html b/docs/classes/BitmapText.html
index e9fc942..7f84921 100644
--- a/docs/classes/BitmapText.html
+++ b/docs/classes/BitmapText.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -330,7 +336,7 @@ You can generate the fnt files using
-
An alignment of the multiline text ('left', 'center' or 'right')
+
Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
@@ -849,7 +855,7 @@ You can generate the fnt files using
-
src/pixi/display/DisplayObjectContainer.js:95
+
src/pixi/display/DisplayObjectContainer.js:81
@@ -951,7 +957,7 @@ You can generate the fnt files using
-
src/pixi/display/DisplayObject.js:193
+
src/pixi/display/DisplayObject.js:188
@@ -981,7 +987,7 @@ You can generate the fnt files using
-
+
@@ -1036,7 +1042,7 @@ You can generate the fnt files using
-
src/pixi/display/DisplayObjectContainer.js:149
+
src/pixi/display/DisplayObjectContainer.js:135
@@ -1047,7 +1053,7 @@ You can generate the fnt files using
-
Returns the Child at the specified index
+
Returns the child at the specified index
@@ -1122,7 +1128,7 @@ You can generate the fnt files using
- src/pixi/display/DisplayObject.js:199
+ src/pixi/display/DisplayObject.js:194
@@ -1152,7 +1158,7 @@ You can generate the fnt files using
-
+
@@ -1207,7 +1213,7 @@ You can generate the fnt files using
- src/pixi/display/DisplayObject.js:225
+ src/pixi/display/DisplayObject.js:220
@@ -1237,7 +1243,7 @@ You can generate the fnt files using
-
+
@@ -1292,7 +1298,7 @@ You can generate the fnt files using
- src/pixi/display/DisplayObject.js:219
+ src/pixi/display/DisplayObject.js:214
@@ -1322,7 +1328,7 @@ You can generate the fnt files using
-
+
@@ -1377,7 +1383,7 @@ You can generate the fnt files using
- src/pixi/display/DisplayObject.js:205
+ src/pixi/display/DisplayObject.js:200
@@ -1408,7 +1414,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
-
+
@@ -1463,7 +1469,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
- src/pixi/display/DisplayObject.js:212
+ src/pixi/display/DisplayObject.js:207
@@ -1494,7 +1500,7 @@ for this callback to be fired, The touch must have started over the displayObjec
-
+
@@ -1549,7 +1555,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- src/pixi/display/DisplayObjectContainer.js:167
+ src/pixi/display/DisplayObjectContainer.js:153
@@ -1637,7 +1643,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- src/pixi/display/DisplayObject.js:266
+ src/pixi/display/DisplayObject.js:261
@@ -1670,7 +1676,7 @@ Instead of using this function you can now simply set the interactive property t
-
+
@@ -1787,7 +1793,7 @@ Instead of using this function you can now simply set the interactive property t
-
An alignment of the multiline text ('left', 'center' or 'right')
+
Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
@@ -1944,7 +1950,7 @@ Instead of using this function you can now simply set the interactive property t
- src/pixi/display/DisplayObjectContainer.js:123
+ src/pixi/display/DisplayObjectContainer.js:109
@@ -1974,7 +1980,7 @@ Instead of using this function you can now simply set the interactive property t
-
+
@@ -1989,7 +1995,7 @@ Instead of using this function you can now simply set the interactive property t
-
+
@@ -2044,7 +2050,7 @@ Instead of using this function you can now simply set the interactive property t
- src/pixi/display/DisplayObject.js:236
+ src/pixi/display/DisplayObject.js:231
@@ -2075,7 +2081,7 @@ basically a touch version of click
-
+
@@ -2130,7 +2136,7 @@ basically a touch version of click
- src/pixi/display/DisplayObject.js:249
+ src/pixi/display/DisplayObject.js:244
@@ -2160,7 +2166,7 @@ basically a touch version of click
-
+
@@ -2215,7 +2221,7 @@ basically a touch version of click
- src/pixi/display/DisplayObject.js:255
+ src/pixi/display/DisplayObject.js:250
@@ -2246,7 +2252,7 @@ for this callback to be fired, The touch must have started over the sprite
-
+
@@ -2301,7 +2307,7 @@ for this callback to be fired, The touch must have started over the sprite
- src/pixi/display/DisplayObject.js:243
+ src/pixi/display/DisplayObject.js:238
@@ -2312,7 +2318,7 @@ for this callback to be fired, The touch must have started over the sprite
-
A callback that is used when the user touch's over the displayObject
+
A callback that is used when the user touches over the displayObject
@@ -2331,7 +2337,7 @@ for this callback to be fired, The touch must have started over the sprite
-
+
@@ -2449,7 +2455,7 @@ for this callback to be fired, The touch must have started over the sprite
-
Updates the transfor of this object
+
Updates the transform of this object
@@ -2671,7 +2677,7 @@ for this callback to be fired, The touch must have started over the sprite
-
[NYI] Unkown
+
[NYI] Unknown
@@ -2713,7 +2719,7 @@ for this callback to be fired, The touch must have started over the sprite
-
This is the curser that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
+
This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
@@ -2789,7 +2795,7 @@ for this callback to be fired, The touch must have started over the sprite
- src/pixi/display/DisplayObject.js:340
+ src/pixi/display/DisplayObject.js:335
@@ -2845,7 +2851,7 @@ To remove filters simply set this property to 'null'
-
The height of the displayObjectContainer, setting this will actually modify the scale to acheive the value set
+
The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
@@ -2920,7 +2926,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
- src/pixi/display/DisplayObject.js:279
+ src/pixi/display/DisplayObject.js:274
@@ -3008,7 +3014,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
- src/pixi/display/DisplayObject.js:320
+ src/pixi/display/DisplayObject.js:315
@@ -3019,7 +3025,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.
-In PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping.
+In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.
To remove a mask, set this property to null.
@@ -3398,7 +3404,7 @@ To remove a mask, set this property to null.
-
The width of the displayObjectContainer, setting this will actually modify the scale to acheive the value set
+
The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
@@ -3440,7 +3446,7 @@ To remove a mask, set this property to null.
-
[read-only] The multiplied alpha of the displayobject
+
[read-only] The multiplied alpha of the displayObject
@@ -3516,7 +3522,7 @@ To remove a mask, set this property to null.
- src/pixi/display/DisplayObject.js:299
+ src/pixi/display/DisplayObject.js:294
diff --git a/docs/classes/BlurFilter.html b/docs/classes/BlurFilter.html
index fde23e7..e3590eb 100644
--- a/docs/classes/BlurFilter.html
+++ b/docs/classes/BlurFilter.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -342,7 +348,7 @@
-
Sets the strength of the blurX property simultaneously
+
Sets the strength of the blurX property
@@ -389,7 +395,7 @@
-
Sets the strength of the blurX property simultaneously
+
Sets the strength of the blurX property
diff --git a/docs/classes/CanvasGraphics.html b/docs/classes/CanvasGraphics.html
index dd09c1f..4039a8e 100644
--- a/docs/classes/CanvasGraphics.html
+++ b/docs/classes/CanvasGraphics.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -344,7 +350,7 @@
-
src/pixi/renderers/webgl/utils/WebGLGraphics.js:206
+
src/pixi/renderers/webgl/utils/WebGLGraphics.js:211
@@ -457,7 +463,7 @@
-
src/pixi/renderers/webgl/utils/WebGLGraphics.js:275
+
src/pixi/renderers/webgl/utils/WebGLGraphics.js:284
@@ -570,7 +576,7 @@
-
src/pixi/renderers/webgl/utils/WebGLGraphics.js:485
+
src/pixi/renderers/webgl/utils/WebGLGraphics.js:494
diff --git a/docs/classes/CanvasRenderer.html b/docs/classes/CanvasRenderer.html
index 272b7d9..108c6a3 100644
--- a/docs/classes/CanvasRenderer.html
+++ b/docs/classes/CanvasRenderer.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -511,7 +517,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
-
src/pixi/renderers/canvas/CanvasRenderer.js:111
+
src/pixi/renderers/canvas/CanvasRenderer.js:134
@@ -602,7 +608,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
-
src/pixi/renderers/canvas/CanvasRenderer.js:172
+
src/pixi/renderers/canvas/CanvasRenderer.js:208
@@ -693,7 +699,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
-
src/pixi/renderers/canvas/CanvasRenderer.js:223
+
src/pixi/renderers/canvas/CanvasRenderer.js:259
@@ -784,7 +790,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
-
src/pixi/renderers/canvas/CanvasRenderer.js:189
+
src/pixi/renderers/canvas/CanvasRenderer.js:225
@@ -879,7 +885,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
-
src/pixi/renderers/canvas/CanvasRenderer.js:156
+
src/pixi/renderers/canvas/CanvasRenderer.js:192
@@ -973,7 +979,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
-
src/pixi/renderers/canvas/CanvasRenderer.js:71
+
src/pixi/renderers/canvas/CanvasRenderer.js:97
@@ -1018,7 +1024,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
-
src/pixi/renderers/canvas/CanvasRenderer.js:54
+
src/pixi/renderers/canvas/CanvasRenderer.js:80
@@ -1065,7 +1071,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
-
src/pixi/renderers/canvas/CanvasRenderer.js:63
+
src/pixi/renderers/canvas/CanvasRenderer.js:89
@@ -1110,7 +1116,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
-
src/pixi/renderers/canvas/CanvasRenderer.js:45
+
src/pixi/renderers/canvas/CanvasRenderer.js:71
diff --git a/docs/classes/Circle.html b/docs/classes/Circle.html
index 9e7f851..7c308ae 100644
--- a/docs/classes/Circle.html
+++ b/docs/classes/Circle.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -194,7 +200,7 @@
-
The Circle object can be used to specify a hit area for displayobjects
+
The Circle object can be used to specify a hit area for displayObjects
diff --git a/docs/classes/ColorMatrixFilter.html b/docs/classes/ColorMatrixFilter.html
index bcd9f7c..8ba653d 100644
--- a/docs/classes/ColorMatrixFilter.html
+++ b/docs/classes/ColorMatrixFilter.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/classes/ColorStepFilter.html b/docs/classes/ColorStepFilter.html
index fc9b16c..2d0d7f7 100644
--- a/docs/classes/ColorStepFilter.html
+++ b/docs/classes/ColorStepFilter.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -194,7 +200,7 @@
-
This turns your displayObjects to black and white.
+
This lowers the color depth of your image by the given amount, producing an image with a smaller palette.
diff --git a/docs/classes/DisplacementFilter.html b/docs/classes/DisplacementFilter.html
index c1ccc34..afdb18e 100644
--- a/docs/classes/DisplacementFilter.html
+++ b/docs/classes/DisplacementFilter.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/classes/DisplayObject.html b/docs/classes/DisplayObject.html
index 1e75486..b66bcb4 100644
--- a/docs/classes/DisplayObject.html
+++ b/docs/classes/DisplayObject.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -580,7 +586,7 @@
-
src/pixi/display/DisplayObject.js:193
+
src/pixi/display/DisplayObject.js:188
@@ -668,7 +674,7 @@
-
src/pixi/display/DisplayObject.js:199
+
src/pixi/display/DisplayObject.js:194
@@ -756,7 +762,7 @@
-
src/pixi/display/DisplayObject.js:225
+
src/pixi/display/DisplayObject.js:220
@@ -844,7 +850,7 @@
-
src/pixi/display/DisplayObject.js:219
+
src/pixi/display/DisplayObject.js:214
@@ -932,7 +938,7 @@
-
src/pixi/display/DisplayObject.js:205
+
src/pixi/display/DisplayObject.js:200
@@ -1021,7 +1027,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
-
src/pixi/display/DisplayObject.js:212
+
src/pixi/display/DisplayObject.js:207
@@ -1112,7 +1118,7 @@ for this callback to be fired, The touch must have started over the displayObjec
-
src/pixi/display/DisplayObject.js:266
+
src/pixi/display/DisplayObject.js:261
@@ -1203,7 +1209,7 @@ Instead of using this function you can now simply set the interactive property t
-
src/pixi/display/DisplayObject.js:236
+
src/pixi/display/DisplayObject.js:231
@@ -1292,7 +1298,7 @@ basically a touch version of click
-
src/pixi/display/DisplayObject.js:249
+
src/pixi/display/DisplayObject.js:244
@@ -1380,7 +1386,7 @@ basically a touch version of click
-
src/pixi/display/DisplayObject.js:255
+
src/pixi/display/DisplayObject.js:250
@@ -1469,7 +1475,7 @@ for this callback to be fired, The touch must have started over the sprite
-
src/pixi/display/DisplayObject.js:243
+
src/pixi/display/DisplayObject.js:238
@@ -1480,7 +1486,7 @@ for this callback to be fired, The touch must have started over the sprite
-
A callback that is used when the user touch's over the displayObject
+
A callback that is used when the user touches over the displayObject
@@ -1695,7 +1701,7 @@ for this callback to be fired, The touch must have started over the sprite
-
[NYI] Unkown
+
[NYI] Unknown
@@ -1740,7 +1746,7 @@ for this callback to be fired, The touch must have started over the sprite
-
This is the curser that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
+
This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
@@ -1822,7 +1828,7 @@ for this callback to be fired, The touch must have started over the sprite
- src/pixi/display/DisplayObject.js:340
+ src/pixi/display/DisplayObject.js:335
@@ -1917,7 +1923,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
- src/pixi/display/DisplayObject.js:279
+ src/pixi/display/DisplayObject.js:274
@@ -2011,7 +2017,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
- src/pixi/display/DisplayObject.js:320
+ src/pixi/display/DisplayObject.js:315
@@ -2022,7 +2028,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.
-In PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping.
+In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.
To remove a mask, set this property to null.
@@ -2428,7 +2434,7 @@ To remove a mask, set this property to null.
-
[read-only] The multiplied alpha of the displayobject
+
[read-only] The multiplied alpha of the displayObject
@@ -2510,7 +2516,7 @@ To remove a mask, set this property to null.
- src/pixi/display/DisplayObject.js:299
+ src/pixi/display/DisplayObject.js:294
diff --git a/docs/classes/DisplayObjectContainer.html b/docs/classes/DisplayObjectContainer.html
index 89919d1..61f6ccd 100644
--- a/docs/classes/DisplayObjectContainer.html
+++ b/docs/classes/DisplayObjectContainer.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -736,7 +742,7 @@ It is the base class of all display objects that act as a container for other ob
-
src/pixi/display/DisplayObjectContainer.js:95
+
src/pixi/display/DisplayObjectContainer.js:81
@@ -838,7 +844,7 @@ It is the base class of all display objects that act as a container for other ob
-
src/pixi/display/DisplayObject.js:193
+
src/pixi/display/DisplayObject.js:188
@@ -926,7 +932,7 @@ It is the base class of all display objects that act as a container for other ob
-
src/pixi/display/DisplayObjectContainer.js:149
+
src/pixi/display/DisplayObjectContainer.js:135
@@ -937,7 +943,7 @@ It is the base class of all display objects that act as a container for other ob
-
Returns the Child at the specified index
+
Returns the child at the specified index
@@ -1012,7 +1018,7 @@ It is the base class of all display objects that act as a container for other ob
- src/pixi/display/DisplayObject.js:199
+ src/pixi/display/DisplayObject.js:194
@@ -1097,7 +1103,7 @@ It is the base class of all display objects that act as a container for other ob
- src/pixi/display/DisplayObject.js:225
+ src/pixi/display/DisplayObject.js:220
@@ -1182,7 +1188,7 @@ It is the base class of all display objects that act as a container for other ob
- src/pixi/display/DisplayObject.js:219
+ src/pixi/display/DisplayObject.js:214
@@ -1267,7 +1273,7 @@ It is the base class of all display objects that act as a container for other ob
- src/pixi/display/DisplayObject.js:205
+ src/pixi/display/DisplayObject.js:200
@@ -1353,7 +1359,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
- src/pixi/display/DisplayObject.js:212
+ src/pixi/display/DisplayObject.js:207
@@ -1442,7 +1448,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- src/pixi/display/DisplayObjectContainer.js:167
+ src/pixi/display/DisplayObjectContainer.js:153
@@ -1530,7 +1536,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- src/pixi/display/DisplayObject.js:266
+ src/pixi/display/DisplayObject.js:261
@@ -1629,7 +1635,7 @@ Instead of using this function you can now simply set the interactive property t
- src/pixi/display/DisplayObjectContainer.js:123
+ src/pixi/display/DisplayObjectContainer.js:109
@@ -1729,7 +1735,7 @@ Instead of using this function you can now simply set the interactive property t
- src/pixi/display/DisplayObject.js:236
+ src/pixi/display/DisplayObject.js:231
@@ -1815,7 +1821,7 @@ basically a touch version of click
- src/pixi/display/DisplayObject.js:249
+ src/pixi/display/DisplayObject.js:244
@@ -1900,7 +1906,7 @@ basically a touch version of click
- src/pixi/display/DisplayObject.js:255
+ src/pixi/display/DisplayObject.js:250
@@ -1986,7 +1992,7 @@ for this callback to be fired, The touch must have started over the sprite
- src/pixi/display/DisplayObject.js:243
+ src/pixi/display/DisplayObject.js:238
@@ -1997,7 +2003,7 @@ for this callback to be fired, The touch must have started over the sprite
-
A callback that is used when the user touch's over the displayObject
+
A callback that is used when the user touches over the displayObject
@@ -2245,7 +2251,7 @@ for this callback to be fired, The touch must have started over the sprite
-
[NYI] Unkown
+
[NYI] Unknown
@@ -2287,7 +2293,7 @@ for this callback to be fired, The touch must have started over the sprite
-
This is the curser that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
+
This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
@@ -2363,7 +2369,7 @@ for this callback to be fired, The touch must have started over the sprite
- src/pixi/display/DisplayObject.js:340
+ src/pixi/display/DisplayObject.js:335
@@ -2422,7 +2428,7 @@ To remove filters simply set this property to 'null'
-
The height of the displayObjectContainer, setting this will actually modify the scale to acheive the value set
+
The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
@@ -2497,7 +2503,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
- src/pixi/display/DisplayObject.js:279
+ src/pixi/display/DisplayObject.js:274
@@ -2585,7 +2591,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
- src/pixi/display/DisplayObject.js:320
+ src/pixi/display/DisplayObject.js:315
@@ -2596,7 +2602,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.
-In PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping.
+In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.
To remove a mask, set this property to null.
@@ -2978,7 +2984,7 @@ To remove a mask, set this property to null.
-
The width of the displayObjectContainer, setting this will actually modify the scale to acheive the value set
+
The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
@@ -3020,7 +3026,7 @@ To remove a mask, set this property to null.
-
[read-only] The multiplied alpha of the displayobject
+
[read-only] The multiplied alpha of the displayObject
@@ -3096,7 +3102,7 @@ To remove a mask, set this property to null.
- src/pixi/display/DisplayObject.js:299
+ src/pixi/display/DisplayObject.js:294
diff --git a/docs/classes/DotScreenFilter.html b/docs/classes/DotScreenFilter.html
new file mode 100644
index 0000000..8e8cfd1
--- /dev/null
+++ b/docs/classes/DotScreenFilter.html
@@ -0,0 +1,377 @@
+
+
+
+
+ DotScreenFilter - pixi.js
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Show:
+
+
+ Inherited
+
+
+
+
+ Protected
+
+
+
+
+ Private
+
+
+
+ Deprecated
+
+
+
+
+
+
+
+
+
DotScreenFilter Class
+
+
+
+
+
+
This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer
+
+
+
+
+
+
+
+
+
+
+
Item Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Properties
+
+
+
+
angle
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
This radius describes angle
+
+
+
+
+
+
+
+
+
+
+
+
+
scale
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
This describes the the scale
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/classes/Ellipse.html b/docs/classes/Ellipse.html
index 46de308..a199d5a 100644
--- a/docs/classes/Ellipse.html
+++ b/docs/classes/Ellipse.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -194,7 +200,7 @@
-
The Ellipse object can be used to specify a hit area for displayobjects
+
The Ellipse object can be used to specify a hit area for displayObjects
@@ -583,7 +589,7 @@
-
Checks if the x, and y coords passed to this function are contained within this ellipse
+
Checks if the x and y coords passed to this function are contained within this ellipse
diff --git a/docs/classes/EventTarget.html b/docs/classes/EventTarget.html
index 5bb814f..458d510 100644
--- a/docs/classes/EventTarget.html
+++ b/docs/classes/EventTarget.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -327,7 +333,7 @@
This helper function will automatically detect which renderer you should be using.
-WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by
+WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by
the browser then this function will return a canvas renderer
diff --git a/docs/classes/Graphics.html b/docs/classes/Graphics.html
index 946423c..dc08b88 100644
--- a/docs/classes/Graphics.html
+++ b/docs/classes/Graphics.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -348,6 +354,13 @@ Complex polys will not be filled. Heres an example of a complex poly:
+ generateTexture
+
+
+
@@ -493,6 +506,13 @@ Complex polys will not be filled. Heres an example of a complex poly:
+ cacheAsBitmap
+
+
+
@@ -829,7 +849,7 @@ Complex polys will not be filled. Heres an example of a complex poly: src/pixi/display/DisplayObjectContainer.js:95
+ src/pixi/display/DisplayObjectContainer.js:81
@@ -940,7 +960,7 @@ Complex polys will not be filled. Heres an example of a complex poly: src/pixi/primitives/Graphics.js:144
+ src/pixi/primitives/Graphics.js:167
@@ -1036,7 +1056,7 @@ Complex polys will not be filled. Heres an example of a complex poly: src/pixi/primitives/Graphics.js:235
+ src/pixi/primitives/Graphics.js:258
@@ -1098,7 +1118,7 @@ Complex polys will not be filled. Heres an example of a complex poly: src/pixi/display/DisplayObject.js:193
+ src/pixi/display/DisplayObject.js:188
@@ -1128,7 +1148,7 @@ Complex polys will not be filled. Heres an example of a complex poly:
-
+
@@ -1198,7 +1218,7 @@ Complex polys will not be filled. Heres an example of a complex poly: src/pixi/primitives/Graphics.js:192
+ src/pixi/primitives/Graphics.js:215
@@ -1337,7 +1357,7 @@ Complex polys will not be filled. Heres an example of a complex poly: src/pixi/primitives/Graphics.js:213
+ src/pixi/primitives/Graphics.js:236
@@ -1488,7 +1508,7 @@ Complex polys will not be filled. Heres an example of a complex poly: src/pixi/primitives/Graphics.js:172
+ src/pixi/primitives/Graphics.js:195
@@ -1614,7 +1634,7 @@ Complex polys will not be filled. Heres an example of a complex poly: src/pixi/primitives/Graphics.js:160
+ src/pixi/primitives/Graphics.js:183
@@ -1634,6 +1654,80 @@ Complex polys will not be filled. Heres an example of a complex poly:
+ generateTexture
+
+
+ ()
+
+
+
+
+ Texture
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Useful function that returns a texture of the graphics object that can then be used to create sprites
+This can be quite useful if your geometry is complicated and needs to be reused multiple times.
+
+
+
+
+
+
+
+
Returns:
+
+
+
+
+
Texture :
+
+
a texture of the graphics object
+
+
+
+
+
+
+
@@ -1676,7 +1770,7 @@ Complex polys will not be filled. Heres an example of a complex poly: src/pixi/display/DisplayObjectContainer.js:149
+ src/pixi/display/DisplayObjectContainer.js:135
@@ -1687,7 +1781,7 @@ Complex polys will not be filled. Heres an example of a complex poly:
- Returns the Child at the specified index
+ Returns the child at the specified index
@@ -1777,7 +1871,7 @@ Complex polys will not be filled. Heres an example of a complex poly: src/pixi/primitives/Graphics.js:89
+ src/pixi/primitives/Graphics.js:112
@@ -1904,7 +1998,7 @@ Complex polys will not be filled. Heres an example of a complex poly: src/pixi/primitives/Graphics.js:130
+ src/pixi/primitives/Graphics.js:153
@@ -2007,7 +2101,7 @@ the current drawing position is then set to (x, y).
- src/pixi/display/DisplayObject.js:199
+ src/pixi/display/DisplayObject.js:194
@@ -2037,7 +2131,7 @@ the current drawing position is then set to (x, y).
-
+
@@ -2092,7 +2186,7 @@ the current drawing position is then set to (x, y).
- src/pixi/display/DisplayObject.js:225
+ src/pixi/display/DisplayObject.js:220
@@ -2122,7 +2216,7 @@ the current drawing position is then set to (x, y).
-
+
@@ -2177,7 +2271,7 @@ the current drawing position is then set to (x, y).
- src/pixi/display/DisplayObject.js:219
+ src/pixi/display/DisplayObject.js:214
@@ -2207,7 +2301,7 @@ the current drawing position is then set to (x, y).
-
+
@@ -2262,7 +2356,7 @@ the current drawing position is then set to (x, y).
- src/pixi/display/DisplayObject.js:205
+ src/pixi/display/DisplayObject.js:200
@@ -2293,7 +2387,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
-
+
@@ -2348,7 +2442,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
- src/pixi/display/DisplayObject.js:212
+ src/pixi/display/DisplayObject.js:207
@@ -2379,7 +2473,7 @@ for this callback to be fired, The touch must have started over the displayObjec
-
+
@@ -2443,7 +2537,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- src/pixi/primitives/Graphics.js:111
+ src/pixi/primitives/Graphics.js:134
@@ -2545,7 +2639,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- src/pixi/display/DisplayObjectContainer.js:167
+ src/pixi/display/DisplayObjectContainer.js:153
@@ -2633,7 +2727,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- src/pixi/display/DisplayObject.js:266
+ src/pixi/display/DisplayObject.js:261
@@ -2666,7 +2760,7 @@ Instead of using this function you can now simply set the interactive property t
-
+
@@ -2729,7 +2823,7 @@ Instead of using this function you can now simply set the interactive property t
- src/pixi/display/DisplayObjectContainer.js:123
+ src/pixi/display/DisplayObjectContainer.js:109
@@ -2759,7 +2853,7 @@ Instead of using this function you can now simply set the interactive property t
-
+
@@ -2774,7 +2868,7 @@ Instead of using this function you can now simply set the interactive property t
-
+
@@ -2829,7 +2923,7 @@ Instead of using this function you can now simply set the interactive property t
- src/pixi/display/DisplayObject.js:236
+ src/pixi/display/DisplayObject.js:231
@@ -2860,7 +2954,7 @@ basically a touch version of click
-
+
@@ -2915,7 +3009,7 @@ basically a touch version of click
- src/pixi/display/DisplayObject.js:249
+ src/pixi/display/DisplayObject.js:244
@@ -2945,7 +3039,7 @@ basically a touch version of click
-
+
@@ -3000,7 +3094,7 @@ basically a touch version of click
- src/pixi/display/DisplayObject.js:255
+ src/pixi/display/DisplayObject.js:250
@@ -3031,7 +3125,7 @@ for this callback to be fired, The touch must have started over the sprite
-
+
@@ -3086,7 +3180,7 @@ for this callback to be fired, The touch must have started over the sprite
- src/pixi/display/DisplayObject.js:243
+ src/pixi/display/DisplayObject.js:238
@@ -3097,7 +3191,7 @@ for this callback to be fired, The touch must have started over the sprite
-
A callback that is used when the user touch's over the displayObject
+
A callback that is used when the user touches over the displayObject
@@ -3116,7 +3210,7 @@ for this callback to be fired, The touch must have started over the sprite
-
+
@@ -3265,6 +3359,58 @@ for this callback to be fired, The touch must have started over the sprite
+
+
+
+
+
cacheAsBitmap
+
Boolean
+
+
+
+
+
private
+
+
+
+
+
+
+
+
+
+
If cacheAsBitmap is true the graphics object will then be rendered as if it was a sprite.
+This is useful if your graphics element does not change often as it will speed up the rendering of the object
+It is also usful as the graphics object will always be antialiased because it will be rendered using canvas
+Not recommended if you are constanly redrawing the graphics element.
+
+
+
+
+
Default: false
+
+
+
+
+
@@ -3342,7 +3488,7 @@ for this callback to be fired, The touch must have started over the sprite
-
[NYI] Unkown
+
[NYI] Unknown
@@ -3431,7 +3577,7 @@ for this callback to be fired, The touch must have started over the sprite
-
This is the curser that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
+
This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
@@ -3552,7 +3698,7 @@ for this callback to be fired, The touch must have started over the sprite
- src/pixi/display/DisplayObject.js:340
+ src/pixi/display/DisplayObject.js:335
@@ -3655,7 +3801,7 @@ To remove filters simply set this property to 'null'
-
The height of the displayObjectContainer, setting this will actually modify the scale to acheive the value set
+
The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
@@ -3730,7 +3876,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
- src/pixi/display/DisplayObject.js:279
+ src/pixi/display/DisplayObject.js:274
@@ -3908,7 +4054,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
- src/pixi/display/DisplayObject.js:320
+ src/pixi/display/DisplayObject.js:315
@@ -3919,7 +4065,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.
-In PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping.
+In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.
To remove a mask, set this property to null.
@@ -4298,7 +4444,7 @@ To remove a mask, set this property to null.
-
The width of the displayObjectContainer, setting this will actually modify the scale to acheive the value set
+
The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
@@ -4340,7 +4486,7 @@ To remove a mask, set this property to null.
-
[read-only] The multiplied alpha of the displayobject
+
[read-only] The multiplied alpha of the displayObject
@@ -4416,7 +4562,7 @@ To remove a mask, set this property to null.
- src/pixi/display/DisplayObject.js:299
+ src/pixi/display/DisplayObject.js:294
diff --git a/docs/classes/GrayFilter.html b/docs/classes/GrayFilter.html
index b5319ce..a4b9aeb 100644
--- a/docs/classes/GrayFilter.html
+++ b/docs/classes/GrayFilter.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/classes/ImageLoader.html b/docs/classes/ImageLoader.html
index 98ec0ef..57af368 100644
--- a/docs/classes/ImageLoader.html
+++ b/docs/classes/ImageLoader.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -204,7 +210,7 @@
The image loader class is responsible for loading images file formats ('jpeg', 'jpg', 'png' and 'gif')
-Once the image has been loaded it is stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
+Once the image has been loaded it is stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFrameId()
When loaded this class will dispatch a 'loaded' event
@@ -539,7 +545,7 @@ When loaded this class will dispatch a 'loaded' event
-
with of each frame
+
width of each frame
diff --git a/docs/classes/InvertFilter.html b/docs/classes/InvertFilter.html
index 5461cdf..3bb0da7 100644
--- a/docs/classes/InvertFilter.html
+++ b/docs/classes/InvertFilter.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/classes/JsonLoader.html b/docs/classes/JsonLoader.html
index a2bb074..578cd59 100644
--- a/docs/classes/JsonLoader.html
+++ b/docs/classes/JsonLoader.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -203,9 +209,9 @@
-
The json file loader is used to load in JSON data and parsing it
+
The json file loader is used to load in JSON data and parse it
When loaded this class will dispatch a 'loaded' event
-If load failed this class will dispatch a 'error' event
+If loading fails this class will dispatch an 'error' event
diff --git a/docs/classes/MovieClip.html b/docs/classes/MovieClip.html
index 7cdab7c..dddb221 100644
--- a/docs/classes/MovieClip.html
+++ b/docs/classes/MovieClip.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -176,7 +182,7 @@
- Extends Sprite
+ Extends
Sprite
@@ -319,6 +325,34 @@
@@ -357,11 +491,74 @@
+
+ _height
+
+
+
+
+
+
+ _interactive
+
+
+
+
+
+
+ _width
+
+
+
+
+
+
+ alpha
+
+
+
+
+
+
+ anchor
+
+
+
+
+
animationSpeed
+
+
+
+ blendMode
+
+
+
+
+
+
+ buttonMode
+
+
+
+
+
+
+ children
+
+
+
+
+
+
+ color
+
+
+
@@ -369,6 +566,55 @@
+
+
+
+ defaultCursor
+
+
+
+
+
+
+ dynamic
+
+
+
+
+
+
+ filters
+
+
+
+
+
+
+ height
+
+
+
+
+
+
+ hitArea
+
+
+
+
+
+
+ interactive
+
+
+
+
+
+
+ localTransform
+
+
+
@@ -376,6 +622,13 @@
+
+
+
+ mask
+
+
+
@@ -383,6 +636,20 @@
+
+
+
+ parent
+
+
+
+
+
+
+ pivot
+
+
+
@@ -390,6 +657,48 @@
+
+
+
+ position
+
+
+
+
+
+
+ renderable
+
+
+
+
+
+
+ rotation
+
+
+
+
+
+
+ scale
+
+
+
+
+
+
+ stage
+
+
+
+
+
+
+ texture
+
+
+
@@ -397,6 +706,13 @@
+
+
+
+ tint
+
+
+
@@ -404,6 +720,41 @@
+
+
+
+ visible
+
+
+
+
+
+
+ width
+
+
+
+
+
+
+ worldAlpha
+
+
+
+
+
+
+ worldTransform
+
+
+
+
+
+
+ worldVisible
+
+
+
@@ -420,6 +771,371 @@
Methods
+
+
addChild
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Adds a child to the container.
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ child
+ DisplayObject
+
+
+
+
+
+
The DisplayObject to add to the container
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
addChildAt
+
+
+
+
(
+
+
+
+ child
+
+
+
+
+
+ index
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ child
+ DisplayObject
+
+
+
+
+
+
+
+
+
+
+
+ index
+ Number
+
+
+
+
+
+
The index to place the child in
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
click
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the users clicks on the displayObject with their mouse
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
getChildAt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns the child at the specified index
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ index
+ Number
+
+
+
+
+
+
The index to get the child from
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
gotoAndPlay
@@ -595,6 +1311,520 @@
+
+
+
+
+
mousedown
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the user clicks the mouse down over the sprite
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
mouseout
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the users mouse leaves the displayObject
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
mouseover
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the users mouse rolls over the displayObject
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
mouseup
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the user releases the mouse that was over the displayObject
+for this callback to be fired the mouse must have been pressed down over the displayObject
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
mouseupoutside
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the user releases the mouse that was over the displayObject but is no longer over the displayObject
+for this callback to be fired, The touch must have started over the displayObject
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
onTextureUpdate
+
+
+
+
+
+
+
+
+
+
+
private
+
+
+
+
+
+
+
+
+
+
+
+
+
+
When the texture is updated, this event will fire to update the scale and frame
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ event
+ Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -650,6 +1880,268 @@
+
+
+
+
+
removeChild
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Removes a child from the container.
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ child
+ DisplayObject
+
+
+
+
+
+
The DisplayObject to remove
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
setInteractive
+
+
+
+
(
+
+
+
+ interactive
+
+
+
+ )
+
+
+
+
+
+
+
deprecated
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
[Deprecated] Indicates if the sprite will have touch and mouse interactivity. It is false by default
+Instead of using this function you can now simply set the interactive property to true or false
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactive
+ Boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
setTexture
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Sets the texture of the sprite
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ texture
+ Texture
+
+
+
+
+
+
The PIXI texture that is displayed by the sprite
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -705,6 +2197,456 @@
+
+
+
+
+
swapChildren
+
+
+
+
(
+
+
+
+ child
+
+
+
+
+
+ child2
+
+
+
+ )
+
+
+
+
+
+
+
+
+
private
+
+
+
+
+
+
+
+
+
+
+
+
+
+
[NYI] Swaps the depth of 2 displayObjects
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
tap
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the users taps on the sprite with their finger
+basically a touch version of click
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
touchend
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the user releases a touch over the displayObject
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
touchendoutside
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the user releases the touch that was over the displayObject
+for this callback to be fired, The touch must have started over the sprite
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
touchstart
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the user touches over the displayObject
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -716,6 +2658,225 @@
Properties
+
+
_height
+
Number
+
+
+
+
+
private
+
+
+
+
+
+
+
+
+
+
The height of the sprite (this is initially set by the texture)
+
+
+
+
+
+
+
+
+
+
+
+
+
_interactive
+
Boolean
+
+
+
+
+
private
+
+
+
+
+
+
+
+
+
+
[read-only] Whether or not the object is interactive, do not toggle directly! use the interactive
property
+
+
+
+
+
+
+
+
+
+
+
+
+
_width
+
Number
+
+
+
+
+
private
+
+
+
+
+
+
+
+
+
+
The width of the sprite (this is initially set by the texture)
+
+
+
+
+
+
+
+
+
+
+
+
+
alpha
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
The opacity of the object.
+
+
+
+
+
+
+
+
+
+
+
+
+
anchor
+
Point
+
+
+
+
+
+
+
+
+
+
+
+
+
The anchor sets the origin point of the texture.
+The default is 0,0 this means the textures origin is the top left
+Setting than anchor to 0.5,0.5 means the textures origin is centered
+Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
+
+
+
+
+
+
+
+
+
+
+
animationSpeed
Number
@@ -760,6 +2921,178 @@
+
+
+
+
+
blendMode
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
The blend mode to be applied to the sprite
+
+
+
+
+
Default: PIXI.blendModes.NORMAL;
+
+
+
+
+
+
+
+
+
+
+
+
+
children
+
Array
+
+
+
+
+
+
+
+
+
+
+
+
+
[read-only] The of children of this container.
+
+
+
+
+
+
+
+
+
+
+
+
+
color
+
Array<>
+
+
+
+
+
private
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -796,7 +3129,7 @@
-
[read-only] The index MovieClips current frame (this may not have to be a whole number)
+
[read-only] The MovieClips current frame index (this may not have to be a whole number)
@@ -807,6 +3140,314 @@
+
+
+
+
+
defaultCursor
+
String
+
+
+
+
+
+
+
+
+
+
+
+
+
This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
+
+
+
+
+
+
+
+
+
+
+
+
+
dynamic
+
Boolean
+
+
+
+
+
private
+
+
+
+
+
+
+
+
+
+
[NYI] Holds whether or not this object is dynamic, for rendering optimization
+
+
+
+
+
+
+
+
+
+
+
+
+
filters
+
Array An array of filters
+
+
+
+
+
+
+
+
+
+
+
+
+
Sets the filters for the displayObject.
+
+IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.
+To remove filters simply set this property to 'null'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
height
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
The height of the sprite, setting this will actually modify the scale to achieve the value set
+
+
+
+
+
+
+
+
+
+
+
+
+
hitArea
+
Rectangle | Circle | Ellipse | Polygon
+
+
+
+
+
+
+
+
+
+
+
+
+
This is the defined area that will pick up mouse / touch events. It is null by default.
+Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)
+
+
+
+
+
+
+
+
+
+
+
+
+
interactive
+
Boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
Indicates if the sprite will have touch and mouse interactivity. It is false by default
+
+
+
+
+
Default: false
+
+
+
+
+
+
+
+
+
@@ -854,6 +3495,50 @@
+
+
+
+
+
mask
+
Graphics
+
+
+
+
+
+
+
+
+
+
+
+
+
Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.
+In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.
+To remove a mask, set this property to null.
+
+
+
+
+
+
+
+
@@ -899,6 +3584,90 @@
+
+
+
+
+
parent
+
DisplayObjectContainer
+
+
+
+
+
+
+
+
+
+
+
+
+
[read-only] The display object container that contains this display object.
+
+
+
+
+
+
+
+
+
+
+
+
+
pivot
+
Point
+
+
+
+
+
+
+
+
+
+
+
+
+
The pivot point of the displayObject that it rotates around
+
+
+
+
+
+
+
+
@@ -944,6 +3713,258 @@
+
+
+
+
+
position
+
Point
+
+
+
+
+
+
+
+
+
+
+
+
+
The coordinate of the object relative to the local coordinates of the parent.
+
+
+
+
+
+
+
+
+
+
+
+
+
renderable
+
Boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
Can this object be rendered
+
+
+
+
+
+
+
+
+
+
+
+
+
rotation
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
The rotation of the object in radians.
+
+
+
+
+
+
+
+
+
+
+
+
+
scale
+
Point
+
+
+
+
+
+
+
+
+
+
+
+
+
The scale factor of the object.
+
+
+
+
+
+
+
+
+
+
+
+
+
stage
+
Stage
+
+
+
+
+
+
+
+
+
+
+
+
+
[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
+
+
+
+
+
+
+
+
+
+
+
+
+
texture
+
Texture
+
+
+
+
+
+
+
+
+
+
+
+
+
The texture that the sprite is using
+
+
+
+
+
+
+
+
@@ -989,6 +4010,50 @@
+
+
+
+
+
tint
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
The tint applied to the sprite. This is a hex value
+
+
+
+
+
Default: 0xFFFFFF
+
+
+
+
+
@@ -1037,6 +4102,221 @@ assigned to the MovieClip.
+
+
+
+
+
visible
+
Boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
The visibility of the object.
+
+
+
+
+
+
+
+
+
+
+
+
+
width
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
The width of the sprite, setting this will actually modify the scale to achieve the value set
+
+
+
+
+
+
+
+
+
+
+
+
+
worldAlpha
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
[read-only] The multiplied alpha of the displayObject
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
worldVisible
+
Boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
[read-only] Indicates if the sprite is globaly visible.
+
+
+
+
+
+
+
+
diff --git a/docs/classes/PIXI.PixiFastShader.html b/docs/classes/PIXI.PixiFastShader.html
new file mode 100644
index 0000000..92574d3
--- /dev/null
+++ b/docs/classes/PIXI.PixiFastShader.html
@@ -0,0 +1,559 @@
+
+
+
+
+ PIXI.PixiFastShader - pixi.js
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Show:
+
+
+ Inherited
+
+
+
+
+ Protected
+
+
+
+
+ Private
+
+
+
+ Deprecated
+
+
+
+
+
+
+
+
+
PIXI.PixiFastShader Class
+
+
+
+
+
+
+
+
+
+
+
Constructor
+
+
PIXI.PixiFastShader
+
+
+
()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Item Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Methods
+
+
+
+
PIXI.PixiFastShader#init
+
+
+
()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Properties
+
+
+
+
fragmentSrc - The fragment shader.
+
Array
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
program - The WebGL program.
+
Any
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
textureCount - A local texture counter for multi-texture shaders.
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/classes/PIXI.PixiShader.html b/docs/classes/PIXI.PixiShader.html
index c390805..9536a91 100644
--- a/docs/classes/PIXI.PixiShader.html
+++ b/docs/classes/PIXI.PixiShader.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -385,7 +391,7 @@
-
src/pixi/renderers/webgl/shaders/PixiShader.js:42
+
src/pixi/renderers/webgl/shaders/PixiShader.js:43
@@ -439,7 +445,7 @@
-
src/pixi/renderers/webgl/shaders/PixiShader.js:164
+
src/pixi/renderers/webgl/shaders/PixiShader.js:167
@@ -450,7 +456,7 @@
-
Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture is has loaded)
+
Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)
@@ -494,7 +500,7 @@
- src/pixi/renderers/webgl/shaders/PixiShader.js:91
+ src/pixi/renderers/webgl/shaders/PixiShader.js:94
@@ -551,7 +557,7 @@ Uniforms are specified in the GLSL_ES Specification: src/pixi/renderers/webgl/shaders/PixiShader.js:239
+ src/pixi/renderers/webgl/shaders/PixiShader.js:242
diff --git a/docs/classes/PixelateFilter.html b/docs/classes/PixelateFilter.html
index 1567bb7..83a5076 100644
--- a/docs/classes/PixelateFilter.html
+++ b/docs/classes/PixelateFilter.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -178,7 +184,7 @@
@@ -194,7 +200,7 @@
-
This filter applies a pixlate effect making display objects appear 'blocky'
+
This filter applies a pixelate effect making display objects appear 'blocky'
@@ -224,41 +230,6 @@
-
- angle
-
-
-
-
-
-
- angle
-
-
-
-
-
-
- scale
-
-
-
-
-
-
- size
-
-
-
-
-
-
- size
-
-
-
-
-
size
@@ -282,141 +253,6 @@
Properties
-
-
angle
-
Number
-
-
-
-
-
-
-
-
-
-
-
-
-
This radius describes angle
-
-
-
-
-
-
-
-
-
-
-
-
-
angle
-
Number
-
-
-
-
-
-
-
-
-
-
-
-
-
This radius describes angle of the twist
-
-
-
-
-
-
-
-
-
-
-
-
-
scale
-
Number
-
-
-
-
-
-
-
-
-
-
-
-
-
This describes the the scale
-
-
-
-
-
-
-
-
-
-
-
size
Point
@@ -459,96 +295,6 @@
-
-
-
-
-
size
-
Point
-
-
-
-
-
-
-
-
-
-
-
-
-
This point describes the the offset of the twist
-
-
-
-
-
-
-
-
-
-
-
-
-
size
-
Number
-
-
-
-
-
-
-
-
-
-
-
-
-
This radius describes size of the twist
-
-
-
-
-
-
-
-
diff --git a/docs/classes/Point.html b/docs/classes/Point.html
index 6b2bba8..29fb6d9 100644
--- a/docs/classes/Point.html
+++ b/docs/classes/Point.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/classes/PolyK.AjaxRequest.html b/docs/classes/PolyK.AjaxRequest.html
index 96b4d8f..15eb618 100644
--- a/docs/classes/PolyK.AjaxRequest.html
+++ b/docs/classes/PolyK.AjaxRequest.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/classes/PolyK.InteractionData.html b/docs/classes/PolyK.InteractionData.html
index 950db55..77ef86c 100644
--- a/docs/classes/PolyK.InteractionData.html
+++ b/docs/classes/PolyK.InteractionData.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -178,7 +184,7 @@
@@ -233,7 +239,7 @@
-
src/pixi/InteractionManager.js:640
+
src/pixi/InteractionManager.js:665
@@ -379,7 +385,7 @@
-
src/pixi/InteractionManager.js:676
+
src/pixi/InteractionManager.js:701
@@ -471,7 +477,7 @@
-
src/pixi/InteractionManager.js:648
+
src/pixi/InteractionManager.js:673
@@ -516,7 +522,7 @@
-
src/pixi/InteractionManager.js:667
+
src/pixi/InteractionManager.js:692
@@ -540,7 +546,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -600,7 +606,7 @@ This manager also supports multitouch.
-
src/pixi/InteractionManager.js:409
+
src/pixi/InteractionManager.js:420
@@ -646,7 +652,7 @@ This manager also supports multitouch.
-
The interactiondata object to update in the case of a hit
+
The interactionData object to update in the case of a hit
@@ -707,7 +713,7 @@ This manager also supports multitouch.
-
src/pixi/InteractionManager.js:299
+
src/pixi/InteractionManager.js:307
@@ -798,7 +804,7 @@ This manager also supports multitouch.
-
src/pixi/InteractionManager.js:269
+
src/pixi/InteractionManager.js:277
@@ -809,7 +815,7 @@ This manager also supports multitouch.
-
Is called when the mouse moves accross the renderer element
+
Is called when the mouse moves across the renderer element
@@ -889,7 +895,7 @@ This manager also supports multitouch.
- src/pixi/InteractionManager.js:360
+ src/pixi/InteractionManager.js:370
@@ -980,7 +986,7 @@ This manager also supports multitouch.
- src/pixi/InteractionManager.js:567
+ src/pixi/InteractionManager.js:588
@@ -1071,7 +1077,7 @@ This manager also supports multitouch.
- src/pixi/InteractionManager.js:484
+ src/pixi/InteractionManager.js:495
@@ -1082,7 +1088,7 @@ This manager also supports multitouch.
-
Is called when a touch is moved accross the renderer element
+
Is called when a touch is moved across the renderer element
@@ -1101,7 +1107,7 @@ This manager also supports multitouch.
-
The DOM event of a touch moving accross the renderer view
+
The DOM event of a touch moving across the renderer view
@@ -1162,7 +1168,7 @@ This manager also supports multitouch.
- src/pixi/InteractionManager.js:518
+ src/pixi/InteractionManager.js:533
@@ -1536,7 +1542,7 @@ to receive those events
-
a refference to the stage
+
a reference to the stage
diff --git a/docs/classes/PolyK._PointInTriangle.html b/docs/classes/PolyK._PointInTriangle.html
index 011f0a8..2241a4f 100644
--- a/docs/classes/PolyK._PointInTriangle.html
+++ b/docs/classes/PolyK._PointInTriangle.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/classes/PolyK._convex.html b/docs/classes/PolyK._convex.html
index b3112fe..809dbfb 100644
--- a/docs/classes/PolyK._convex.html
+++ b/docs/classes/PolyK._convex.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/classes/Polygon.html b/docs/classes/Polygon.html
index 8ae2af0..224fe90 100644
--- a/docs/classes/Polygon.html
+++ b/docs/classes/Polygon.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -484,7 +490,7 @@
-
Checks if the x, and y coords passed to this function are contained within this polygon
+
Checks if the x and y coords passed to this function are contained within this polygon
diff --git a/docs/classes/Rectangle.html b/docs/classes/Rectangle.html
index d04a4ef..5ffc1bd 100644
--- a/docs/classes/Rectangle.html
+++ b/docs/classes/Rectangle.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -583,7 +589,7 @@
-
Checks if the x, and y coords passed to this function are contained within this Rectangle
+
Checks if the x and y coords passed to this function are contained within this Rectangle
diff --git a/docs/classes/RenderTexture.html b/docs/classes/RenderTexture.html
index 52a7cf9..732b3a0 100644
--- a/docs/classes/RenderTexture.html
+++ b/docs/classes/RenderTexture.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -199,7 +205,7 @@
A RenderTexture is a special texture that allows any pixi displayObject to be rendered to it.
-
Hint : All DisplayObjects (exmpl. Sprites) that renders on RenderTexture should be preloaded.
+
Hint : All DisplayObjects (exmpl. Sprites) that render on RenderTexture should be preloaded.
Otherwise black rectangles will be drawn instead.
RenderTexture takes snapshot of DisplayObject passed to render method. If DisplayObject is passed to render method, position and rotation of it will be ignored. For example:
var renderTexture = new PIXI.RenderTexture(800, 600);
@@ -474,7 +480,7 @@ Otherwise black rectangles will be drawn instead.
-
src/pixi/textures/Texture.js:91
+
src/pixi/textures/Texture.js:93
@@ -562,7 +568,7 @@ Otherwise black rectangles will be drawn instead.
-
src/pixi/textures/Texture.js:72
+
src/pixi/textures/Texture.js:74
@@ -658,7 +664,7 @@ Otherwise black rectangles will be drawn instead.
-
src/pixi/textures/RenderTexture.js:154
+
src/pixi/textures/RenderTexture.js:153
@@ -873,7 +879,7 @@ Otherwise black rectangles will be drawn instead.
-
src/pixi/textures/Texture.js:102
+
src/pixi/textures/Texture.js:104
@@ -948,7 +954,7 @@ Otherwise black rectangles will be drawn instead.
-
src/pixi/textures/Texture.js:31
+
src/pixi/textures/Texture.js:33
@@ -990,7 +996,7 @@ Otherwise black rectangles will be drawn instead.
-
src/pixi/textures/Texture.js:39
+
src/pixi/textures/Texture.js:41
@@ -1032,7 +1038,7 @@ Otherwise black rectangles will be drawn instead.
-
src/pixi/textures/Texture.js:47
+
src/pixi/textures/Texture.js:49
diff --git a/docs/classes/SepiaFilter.html b/docs/classes/SepiaFilter.html
index b93557c..781baef 100644
--- a/docs/classes/SepiaFilter.html
+++ b/docs/classes/SepiaFilter.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/classes/Spine.html b/docs/classes/Spine.html
index c50497c..05a2e36 100644
--- a/docs/classes/Spine.html
+++ b/docs/classes/Spine.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -208,7 +214,7 @@
The Spine loader is used to load in JSON spine data
-To generate the data you need to use http://esotericsoftware.com/ and export the "JSON" format
+To generate the data you need to use http://esotericsoftware.com/ and export in the "JSON" format
Due to a clash of names You will need to change the extension of the spine file from .json to .anim for it to load
See example 12 (http://www.goodboydigital.com/pixijs/examples/12/ ) to see a working example and check out the source
You will need to generate a sprite sheet to accompany the spine data
@@ -401,13 +407,6 @@ When loaded this class will dispatch a "loaded" event
-
-
-
- onJSONLoaded
-
-
-
@@ -819,7 +818,7 @@ When loaded this class will dispatch a "loaded" event
- src/pixi/display/DisplayObjectContainer.js:95
+ src/pixi/display/DisplayObjectContainer.js:81
@@ -921,7 +920,7 @@ When loaded this class will dispatch a "loaded" event
- src/pixi/display/DisplayObject.js:193
+ src/pixi/display/DisplayObject.js:188
@@ -951,7 +950,7 @@ When loaded this class will dispatch a "loaded" event
-
+
@@ -1006,7 +1005,7 @@ When loaded this class will dispatch a "loaded" event
- src/pixi/display/DisplayObjectContainer.js:149
+ src/pixi/display/DisplayObjectContainer.js:135
@@ -1017,7 +1016,7 @@ When loaded this class will dispatch a "loaded" event
-
Returns the Child at the specified index
+
Returns the child at the specified index
@@ -1147,7 +1146,7 @@ When loaded this class will dispatch a "loaded" event
-
src/pixi/display/DisplayObject.js:199
+
src/pixi/display/DisplayObject.js:194
@@ -1177,7 +1176,7 @@ When loaded this class will dispatch a "loaded" event
-
+
@@ -1232,7 +1231,7 @@ When loaded this class will dispatch a "loaded" event
-
src/pixi/display/DisplayObject.js:225
+
src/pixi/display/DisplayObject.js:220
@@ -1262,7 +1261,7 @@ When loaded this class will dispatch a "loaded" event
-
+
@@ -1317,7 +1316,7 @@ When loaded this class will dispatch a "loaded" event
-
src/pixi/display/DisplayObject.js:219
+
src/pixi/display/DisplayObject.js:214
@@ -1347,7 +1346,7 @@ When loaded this class will dispatch a "loaded" event
-
+
@@ -1402,7 +1401,7 @@ When loaded this class will dispatch a "loaded" event
-
src/pixi/display/DisplayObject.js:205
+
src/pixi/display/DisplayObject.js:200
@@ -1433,7 +1432,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
-
+
@@ -1488,7 +1487,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
-
src/pixi/display/DisplayObject.js:212
+
src/pixi/display/DisplayObject.js:207
@@ -1519,7 +1518,7 @@ for this callback to be fired, The touch must have started over the displayObjec
-
+
@@ -1532,63 +1531,6 @@ for this callback to be fired, The touch must have started over the displayObjec
-
-
-
-
-
onJSONLoaded
-
-
-
()
-
-
-
-
-
-
-
-
private
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Invoke when JSON file is loaded
-
-
-
-
-
-
-
-
@@ -1626,7 +1568,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- src/pixi/loaders/SpineLoader.js:87
+ src/pixi/loaders/SpineLoader.js:72
@@ -1688,7 +1630,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- src/pixi/display/DisplayObjectContainer.js:167
+ src/pixi/display/DisplayObjectContainer.js:153
@@ -1776,7 +1718,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- src/pixi/display/DisplayObject.js:266
+ src/pixi/display/DisplayObject.js:261
@@ -1809,7 +1751,7 @@ Instead of using this function you can now simply set the interactive property t
-
+
@@ -1872,7 +1814,7 @@ Instead of using this function you can now simply set the interactive property t
- src/pixi/display/DisplayObjectContainer.js:123
+ src/pixi/display/DisplayObjectContainer.js:109
@@ -1902,7 +1844,7 @@ Instead of using this function you can now simply set the interactive property t
-
+
@@ -1917,7 +1859,7 @@ Instead of using this function you can now simply set the interactive property t
-
+
@@ -1972,7 +1914,7 @@ Instead of using this function you can now simply set the interactive property t
- src/pixi/display/DisplayObject.js:236
+ src/pixi/display/DisplayObject.js:231
@@ -2003,7 +1945,7 @@ basically a touch version of click
-
+
@@ -2058,7 +2000,7 @@ basically a touch version of click
- src/pixi/display/DisplayObject.js:249
+ src/pixi/display/DisplayObject.js:244
@@ -2088,7 +2030,7 @@ basically a touch version of click
-
+
@@ -2143,7 +2085,7 @@ basically a touch version of click
- src/pixi/display/DisplayObject.js:255
+ src/pixi/display/DisplayObject.js:250
@@ -2174,7 +2116,7 @@ for this callback to be fired, The touch must have started over the sprite
-
+
@@ -2229,7 +2171,7 @@ for this callback to be fired, The touch must have started over the sprite
- src/pixi/display/DisplayObject.js:243
+ src/pixi/display/DisplayObject.js:238
@@ -2240,7 +2182,7 @@ for this callback to be fired, The touch must have started over the sprite
-
A callback that is used when the user touch's over the displayObject
+
A callback that is used when the user touches over the displayObject
@@ -2259,7 +2201,7 @@ for this callback to be fired, The touch must have started over the sprite
-
+
@@ -2485,7 +2427,7 @@ for this callback to be fired, The touch must have started over the sprite
-
[NYI] Unkown
+
[NYI] Unknown
@@ -2572,7 +2514,7 @@ for this callback to be fired, The touch must have started over the sprite
-
This is the curser that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
+
This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
@@ -2648,7 +2590,7 @@ for this callback to be fired, The touch must have started over the sprite
- src/pixi/display/DisplayObject.js:340
+ src/pixi/display/DisplayObject.js:335
@@ -2704,7 +2646,7 @@ To remove filters simply set this property to 'null'
-
The height of the displayObjectContainer, setting this will actually modify the scale to acheive the value set
+
The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
@@ -2779,7 +2721,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
- src/pixi/display/DisplayObject.js:279
+ src/pixi/display/DisplayObject.js:274
@@ -2912,7 +2854,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
- src/pixi/display/DisplayObject.js:320
+ src/pixi/display/DisplayObject.js:315
@@ -2923,7 +2865,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.
-In PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping.
+In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.
To remove a mask, set this property to null.
@@ -3347,7 +3289,7 @@ To remove a mask, set this property to null.
-
The width of the displayObjectContainer, setting this will actually modify the scale to acheive the value set
+
The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
@@ -3389,7 +3331,7 @@ To remove a mask, set this property to null.
-
[read-only] The multiplied alpha of the displayobject
+
[read-only] The multiplied alpha of the displayObject
@@ -3465,7 +3407,7 @@ To remove a mask, set this property to null.
- src/pixi/display/DisplayObject.js:299
+ src/pixi/display/DisplayObject.js:294
diff --git a/docs/classes/Sprite™.html b/docs/classes/Sprite.html
similarity index 94%
rename from docs/classes/Sprite™.html
rename to docs/classes/Sprite.html
index a389db1..fc36192 100644
--- a/docs/classes/Sprite™.html
+++ b/docs/classes/Sprite.html
@@ -2,7 +2,7 @@
- Sprite™ - pixi.js
+ Sprite - pixi.js
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -170,7 +176,7 @@
-
Sprite™ Class
+
Sprite Class
-
[read-only] The multiplied alpha of the displayobject
+
[read-only] The multiplied alpha of the displayObject
@@ -3865,7 +3871,7 @@ To remove a mask, set this property to null.
-
src/pixi/display/DisplayObject.js:299
+
src/pixi/display/DisplayObject.js:294
diff --git a/docs/classes/SpriteSheetLoader.html b/docs/classes/SpriteSheetLoader.html
index ac93b9f..00d5b81 100644
--- a/docs/classes/SpriteSheetLoader.html
+++ b/docs/classes/SpriteSheetLoader.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -204,11 +210,11 @@
The sprite sheet loader is used to load in JSON sprite sheet data
-To generate the data you can use http://www.codeandweb.com/texturepacker and publish the 'JSON' format
+To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format
There is a free version so thats nice, although the paid version is great value for money.
-It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
-Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
-This loader will also load the image file that the Spritesheet points to as well as the data.
+It is highly recommended to use Sprite sheets (also know as a 'texture atlas') as it means sprites can be batched and drawn together for highly increased rendering speed.
+Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFrameId()
+This loader will load the image file that the Spritesheet points to as well as the data.
When loaded this class will dispatch a 'loaded' event
@@ -357,13 +363,6 @@ When loaded this class will dispatch a 'loaded' event
-
-
-
- onJSONLoaded
-
-
-
@@ -484,63 +483,6 @@ When loaded this class will dispatch a 'loaded' event
-
-
-
-
-
onJSONLoaded
-
-
-
()
-
-
-
-
-
-
-
-
private
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Invoke when JSON file is loaded
-
-
-
-
-
-
-
-
@@ -578,7 +520,7 @@ When loaded this class will dispatch a 'loaded' event
-
src/pixi/loaders/SpriteSheetLoader.js:126
+
src/pixi/loaders/SpriteSheetLoader.js:88
diff --git a/docs/classes/Stage.html b/docs/classes/Stage.html
index aefbdff..ac29670 100644
--- a/docs/classes/Stage.html
+++ b/docs/classes/Stage.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -799,7 +805,7 @@
-
src/pixi/display/DisplayObjectContainer.js:95
+
src/pixi/display/DisplayObjectContainer.js:81
@@ -901,7 +907,7 @@
-
src/pixi/display/DisplayObject.js:193
+
src/pixi/display/DisplayObject.js:188
@@ -931,7 +937,7 @@
-
+
@@ -986,7 +992,7 @@
-
src/pixi/display/DisplayObjectContainer.js:149
+
src/pixi/display/DisplayObjectContainer.js:135
@@ -997,7 +1003,7 @@
-
Returns the Child at the specified index
+
Returns the child at the specified index
@@ -1069,7 +1075,7 @@
- src/pixi/display/Stage.js:124
+ src/pixi/display/Stage.js:119
@@ -1145,7 +1151,7 @@
- src/pixi/display/DisplayObject.js:199
+ src/pixi/display/DisplayObject.js:194
@@ -1175,7 +1181,7 @@
-
+
@@ -1230,7 +1236,7 @@
- src/pixi/display/DisplayObject.js:225
+ src/pixi/display/DisplayObject.js:220
@@ -1260,7 +1266,7 @@
-
+
@@ -1315,7 +1321,7 @@
- src/pixi/display/DisplayObject.js:219
+ src/pixi/display/DisplayObject.js:214
@@ -1345,7 +1351,7 @@
-
+
@@ -1400,7 +1406,7 @@
- src/pixi/display/DisplayObject.js:205
+ src/pixi/display/DisplayObject.js:200
@@ -1431,7 +1437,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
-
+
@@ -1486,7 +1492,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
- src/pixi/display/DisplayObject.js:212
+ src/pixi/display/DisplayObject.js:207
@@ -1517,7 +1523,7 @@ for this callback to be fired, The touch must have started over the displayObjec
-
+
@@ -1572,7 +1578,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- src/pixi/display/DisplayObjectContainer.js:167
+ src/pixi/display/DisplayObjectContainer.js:153
@@ -1661,7 +1667,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- src/pixi/display/Stage.js:108
+ src/pixi/display/Stage.js:103
@@ -1751,7 +1757,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- src/pixi/display/Stage.js:70
+ src/pixi/display/Stage.js:66
@@ -1763,7 +1769,7 @@ for this callback to be fired, The touch must have started over the displayObjec
Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element.
-This is useful for when you have other DOM elements ontop of the Canvas element.
+This is useful for when you have other DOM elements on top of the Canvas element.
@@ -1840,7 +1846,7 @@ This is useful for when you have other DOM elements ontop of the Canvas element.
- src/pixi/display/DisplayObject.js:266
+ src/pixi/display/DisplayObject.js:261
@@ -1873,7 +1879,7 @@ Instead of using this function you can now simply set the interactive property t
-
+
@@ -1936,7 +1942,7 @@ Instead of using this function you can now simply set the interactive property t
- src/pixi/display/DisplayObjectContainer.js:123
+ src/pixi/display/DisplayObjectContainer.js:109
@@ -1966,7 +1972,7 @@ Instead of using this function you can now simply set the interactive property t
-
+
@@ -1981,7 +1987,7 @@ Instead of using this function you can now simply set the interactive property t
-
+
@@ -2036,7 +2042,7 @@ Instead of using this function you can now simply set the interactive property t
- src/pixi/display/DisplayObject.js:236
+ src/pixi/display/DisplayObject.js:231
@@ -2067,7 +2073,7 @@ basically a touch version of click
-
+
@@ -2122,7 +2128,7 @@ basically a touch version of click
- src/pixi/display/DisplayObject.js:249
+ src/pixi/display/DisplayObject.js:244
@@ -2152,7 +2158,7 @@ basically a touch version of click
-
+
@@ -2207,7 +2213,7 @@ basically a touch version of click
- src/pixi/display/DisplayObject.js:255
+ src/pixi/display/DisplayObject.js:250
@@ -2238,7 +2244,7 @@ for this callback to be fired, The touch must have started over the sprite
-
+
@@ -2293,7 +2299,7 @@ for this callback to be fired, The touch must have started over the sprite
- src/pixi/display/DisplayObject.js:243
+ src/pixi/display/DisplayObject.js:238
@@ -2304,7 +2310,7 @@ for this callback to be fired, The touch must have started over the sprite
-
A callback that is used when the user touch's over the displayObject
+
A callback that is used when the user touches over the displayObject
@@ -2323,7 +2329,7 @@ for this callback to be fired, The touch must have started over the sprite
-
+
@@ -2549,7 +2555,7 @@ for this callback to be fired, The touch must have started over the sprite
-
[NYI] Unkown
+
[NYI] Unknown
@@ -2591,7 +2597,7 @@ for this callback to be fired, The touch must have started over the sprite
-
This is the curser that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
+
This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
@@ -2714,7 +2720,7 @@ for this callback to be fired, The touch must have started over the sprite
- src/pixi/display/DisplayObject.js:340
+ src/pixi/display/DisplayObject.js:335
@@ -2770,7 +2776,7 @@ To remove filters simply set this property to 'null'
-
The height of the displayObjectContainer, setting this will actually modify the scale to acheive the value set
+
The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
@@ -2979,7 +2985,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
- src/pixi/display/DisplayObject.js:320
+ src/pixi/display/DisplayObject.js:315
@@ -2990,7 +2996,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.
-In PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping.
+In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.
To remove a mask, set this property to null.
@@ -3369,7 +3375,7 @@ To remove a mask, set this property to null.
-
The width of the displayObjectContainer, setting this will actually modify the scale to acheive the value set
+
The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
@@ -3411,7 +3417,7 @@ To remove a mask, set this property to null.
-
[read-only] The multiplied alpha of the displayobject
+
[read-only] The multiplied alpha of the displayObject
@@ -3490,7 +3496,7 @@ To remove a mask, set this property to null.
- src/pixi/display/DisplayObject.js:299
+ src/pixi/display/DisplayObject.js:294
diff --git a/docs/classes/Text.html b/docs/classes/Text.html
index fa3ec25..63d413c 100644
--- a/docs/classes/Text.html
+++ b/docs/classes/Text.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -176,7 +182,7 @@
- Extends Sprite
+ Extends
Sprite
@@ -198,7 +204,7 @@
-
A Text Object will create a line(s) of text to split a line you can use '\n'
+
A Text Object will create a line(s) of text. To split a line you can use '\n'
@@ -344,7 +350,7 @@
-
An alignment of the multiline text ('left', 'center' or 'right')
+
Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
@@ -435,6 +441,8 @@
Methods
+
Properties
+
@@ -449,11 +457,97 @@
+
+ addChild
+
+
+
+
+
+
+ addChildAt
+
+
+
+
+
+
+ click
+
+
+
+
+
destroy
+
+
+
+ getChildAt
+
+
+
+
+
+
+ mousedown
+
+
+
+
+
+
+ mouseout
+
+
+
+
+
+
+ mouseover
+
+
+
+
+
+
+ mouseup
+
+
+
+
+
+
+ mouseupoutside
+
+
+
+
+
+
+ onTextureUpdate
+
+
+
+
+
+
+ removeChild
+
+
+
+
+
+
+ setInteractive
+
+
+
+ deprecated
+
@@ -468,6 +562,48 @@
+
+
+
+ setTexture
+
+
+
+
+
+
+ swapChildren
+
+
+
+
+
+
+ tap
+
+
+
+
+
+
+ touchend
+
+
+
+
+
+
+ touchendoutside
+
+
+
+
+
+
+ touchstart
+
+
+
@@ -503,6 +639,231 @@
+
+
@@ -514,6 +875,285 @@
Methods
+
+
addChild
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Adds a child to the container.
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ child
+ DisplayObject
+
+
+
+
+
+
The DisplayObject to add to the container
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
addChildAt
+
+
+
+
(
+
+
+
+ child
+
+
+
+
+
+ index
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ child
+ DisplayObject
+
+
+
+
+
+
+
+
+
+
+
+ index
+ Number
+
+
+
+
+
+
The index to place the child in
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
click
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the users clicks on the displayObject with their mouse
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
getChildAt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Returns the child at the specified index
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ index
+ Number
+
+
+
+
+
+
The index to get the child from
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
mousedown
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the user clicks the mouse down over the sprite
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
mouseout
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the users mouse leaves the displayObject
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
mouseover
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the users mouse rolls over the displayObject
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
mouseup
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the user releases the mouse that was over the displayObject
+for this callback to be fired the mouse must have been pressed down over the displayObject
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
mouseupoutside
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the user releases the mouse that was over the displayObject but is no longer over the displayObject
+for this callback to be fired, The touch must have started over the displayObject
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
onTextureUpdate
+
+
+
+
+
+
+
+
+
+
+
private
+
+
+
+
+
+
+
+
+
+
+
+
+
+
When the texture is updated, this event will fire to update the scale and frame
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ event
+ Object
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
removeChild
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Removes a child from the container.
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ child
+ DisplayObject
+
+
+
+
+
+
The DisplayObject to remove
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
setInteractive
+
+
+
+
(
+
+
+
+ interactive
+
+
+
+ )
+
+
+
+
+
+
+
deprecated
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
[Deprecated] Indicates if the sprite will have touch and mouse interactivity. It is false by default
+Instead of using this function you can now simply set the interactive property to true or false
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactive
+ Boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -711,7 +2127,7 @@
-
An alignment of the multiline text ('left', 'center' or 'right')
+
Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
@@ -894,6 +2310,542 @@
+
+
+
+
+
setTexture
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Sets the texture of the sprite
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ texture
+ Texture
+
+
+
+
+
+
The PIXI texture that is displayed by the sprite
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
swapChildren
+
+
+
+
(
+
+
+
+ child
+
+
+
+
+
+ child2
+
+
+
+ )
+
+
+
+
+
+
+
+
+
private
+
+
+
+
+
+
+
+
+
+
+
+
+
+
[NYI] Swaps the depth of 2 displayObjects
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
tap
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the users taps on the sprite with their finger
+basically a touch version of click
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
touchend
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the user releases a touch over the displayObject
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
touchendoutside
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the user releases the touch that was over the displayObject
+for this callback to be fired, The touch must have started over the sprite
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
touchstart
+
+
+
+
(
+
+
+
+ interactionData
+
+
+
+ )
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A callback that is used when the user touches over the displayObject
+
+
+
+
+
+
Parameters:
+
+
+
+
+
+ interactionData
+ InteractionData
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -931,7 +2883,7 @@
- src/pixi/text/Text.js:77
+ src/pixi/text/Text.js:78
@@ -988,7 +2940,7 @@
- src/pixi/text/Text.js:148
+ src/pixi/text/Text.js:151
@@ -1045,7 +2997,7 @@
- src/pixi/text/Text.js:167
+ src/pixi/text/Text.js:181
@@ -1056,7 +3008,7 @@
-
Updates the transfor of this object
+
Updates the transform of this object
@@ -1112,7 +3064,7 @@
- src/pixi/text/Text.js:216
+ src/pixi/text/Text.js:230
@@ -1163,6 +3115,1350 @@ bounds set by the Text object's wordWrapWidth property.
+
+
Properties
+
+
+
+
_height
+
Number
+
+
+
+
+
private
+
+
+
+
+
+
+
+
+
+
The height of the sprite (this is initially set by the texture)
+
+
+
+
+
+
+
+
+
+
+
+
+
_interactive
+
Boolean
+
+
+
+
+
private
+
+
+
+
+
+
+
+
+
+
[read-only] Whether or not the object is interactive, do not toggle directly! use the interactive
property
+
+
+
+
+
+
+
+
+
+
+
+
+
_width
+
Number
+
+
+
+
+
private
+
+
+
+
+
+
+
+
+
+
The width of the sprite (this is initially set by the texture)
+
+
+
+
+
+
+
+
+
+
+
+
+
alpha
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
The opacity of the object.
+
+
+
+
+
+
+
+
+
+
+
+
+
anchor
+
Point
+
+
+
+
+
+
+
+
+
+
+
+
+
The anchor sets the origin point of the texture.
+The default is 0,0 this means the textures origin is the top left
+Setting than anchor to 0.5,0.5 means the textures origin is centered
+Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
+
+
+
+
+
+
+
+
+
+
+
+
+
blendMode
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
The blend mode to be applied to the sprite
+
+
+
+
+
Default: PIXI.blendModes.NORMAL;
+
+
+
+
+
+
+
+
+
+
+
+
+
children
+
Array
+
+
+
+
+
+
+
+
+
+
+
+
+
[read-only] The of children of this container.
+
+
+
+
+
+
+
+
+
+
+
+
+
color
+
Array<>
+
+
+
+
+
private
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
defaultCursor
+
String
+
+
+
+
+
+
+
+
+
+
+
+
+
This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
+
+
+
+
+
+
+
+
+
+
+
+
+
dynamic
+
Boolean
+
+
+
+
+
private
+
+
+
+
+
+
+
+
+
+
[NYI] Holds whether or not this object is dynamic, for rendering optimization
+
+
+
+
+
+
+
+
+
+
+
+
+
filters
+
Array An array of filters
+
+
+
+
+
+
+
+
+
+
+
+
+
Sets the filters for the displayObject.
+
+IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.
+To remove filters simply set this property to 'null'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
height
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
The height of the sprite, setting this will actually modify the scale to achieve the value set
+
+
+
+
+
+
+
+
+
+
+
+
+
hitArea
+
Rectangle | Circle | Ellipse | Polygon
+
+
+
+
+
+
+
+
+
+
+
+
+
This is the defined area that will pick up mouse / touch events. It is null by default.
+Setting it is a neat way of optimising the hitTest function that the interactionManager will use (as it will not need to hit test all the children)
+
+
+
+
+
+
+
+
+
+
+
+
+
interactive
+
Boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
Indicates if the sprite will have touch and mouse interactivity. It is false by default
+
+
+
+
+
Default: false
+
+
+
+
+
+
+
+
+
+
+
+
+
mask
+
Graphics
+
+
+
+
+
+
+
+
+
+
+
+
+
Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.
+In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.
+To remove a mask, set this property to null.
+
+
+
+
+
+
+
+
+
+
+
+
+
parent
+
DisplayObjectContainer
+
+
+
+
+
+
+
+
+
+
+
+
+
[read-only] The display object container that contains this display object.
+
+
+
+
+
+
+
+
+
+
+
+
+
pivot
+
Point
+
+
+
+
+
+
+
+
+
+
+
+
+
The pivot point of the displayObject that it rotates around
+
+
+
+
+
+
+
+
+
+
+
+
+
position
+
Point
+
+
+
+
+
+
+
+
+
+
+
+
+
The coordinate of the object relative to the local coordinates of the parent.
+
+
+
+
+
+
+
+
+
+
+
+
+
renderable
+
Boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
Can this object be rendered
+
+
+
+
+
+
+
+
+
+
+
+
+
rotation
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
The rotation of the object in radians.
+
+
+
+
+
+
+
+
+
+
+
+
+
scale
+
Point
+
+
+
+
+
+
+
+
+
+
+
+
+
The scale factor of the object.
+
+
+
+
+
+
+
+
+
+
+
+
+
stage
+
Stage
+
+
+
+
+
+
+
+
+
+
+
+
+
[read-only] The stage the display object is connected to, or undefined if it is not connected to the stage.
+
+
+
+
+
+
+
+
+
+
+
+
+
texture
+
Texture
+
+
+
+
+
+
+
+
+
+
+
+
+
The texture that the sprite is using
+
+
+
+
+
+
+
+
+
+
+
+
+
tint
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
The tint applied to the sprite. This is a hex value
+
+
+
+
+
Default: 0xFFFFFF
+
+
+
+
+
+
+
+
+
+
visible
+
Boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
The visibility of the object.
+
+
+
+
+
+
+
+
+
+
+
+
+
width
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
The width of the sprite, setting this will actually modify the scale to achieve the value set
+
+
+
+
+
+
+
+
+
+
+
+
+
worldAlpha
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
[read-only] The multiplied alpha of the displayObject
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
worldVisible
+
Boolean
+
+
+
+
+
+
+
+
+
+
+
+
+
[read-only] Indicates if the sprite is globaly visible.
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/classes/Texture.html b/docs/classes/Texture.html
index bab3310..2f990e8 100644
--- a/docs/classes/Texture.html
+++ b/docs/classes/Texture.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -187,7 +193,7 @@
@@ -259,7 +265,7 @@ to the display list directly. To do this use PIXI.Sprite. If no frame is provide
-
src/pixi/textures/Texture.js:8
+
src/pixi/textures/Texture.js:10
@@ -508,7 +514,7 @@ to the display list directly. To do this use PIXI.Sprite. If no frame is provide
-
src/pixi/textures/Texture.js:201
+
src/pixi/textures/Texture.js:207
@@ -612,7 +618,7 @@ to the display list directly. To do this use PIXI.Sprite. If no frame is provide
-
src/pixi/textures/Texture.js:91
+
src/pixi/textures/Texture.js:93
@@ -707,7 +713,7 @@ to the display list directly. To do this use PIXI.Sprite. If no frame is provide
-
src/pixi/textures/Texture.js:185
+
src/pixi/textures/Texture.js:189
@@ -815,7 +821,7 @@ If the canvas is not in the texture cache it will be created and loaded
-
src/pixi/textures/Texture.js:169
+
src/pixi/textures/Texture.js:173
@@ -929,7 +935,7 @@ If the frame id is not in the texture cache an error will be thrown
-
src/pixi/textures/Texture.js:146
+
src/pixi/textures/Texture.js:150
@@ -1049,7 +1055,7 @@ If the image is not in the texture cache it will be created and loaded
-
src/pixi/textures/Texture.js:72
+
src/pixi/textures/Texture.js:74
@@ -1143,7 +1149,7 @@ If the image is not in the texture cache it will be created and loaded
-
src/pixi/textures/Texture.js:214
+
src/pixi/textures/Texture.js:220
@@ -1246,7 +1252,7 @@ If the image is not in the texture cache it will be created and loaded
-
src/pixi/textures/Texture.js:102
+
src/pixi/textures/Texture.js:104
@@ -1324,7 +1330,7 @@ If the image is not in the texture cache it will be created and loaded
-
src/pixi/textures/Texture.js:31
+
src/pixi/textures/Texture.js:33
@@ -1369,7 +1375,7 @@ If the image is not in the texture cache it will be created and loaded
-
src/pixi/textures/Texture.js:39
+
src/pixi/textures/Texture.js:41
@@ -1414,7 +1420,7 @@ If the image is not in the texture cache it will be created and loaded
-
src/pixi/textures/Texture.js:47
+
src/pixi/textures/Texture.js:49
diff --git a/docs/classes/TilingSprite.html b/docs/classes/TilingSprite.html
index 5f20d7c..a287c73 100644
--- a/docs/classes/TilingSprite.html
+++ b/docs/classes/TilingSprite.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -821,7 +827,7 @@
-
src/pixi/display/DisplayObjectContainer.js:95
+
src/pixi/display/DisplayObjectContainer.js:81
@@ -923,7 +929,7 @@
-
src/pixi/display/DisplayObject.js:193
+
src/pixi/display/DisplayObject.js:188
@@ -953,7 +959,7 @@
-
+
@@ -1008,7 +1014,7 @@
-
src/pixi/display/DisplayObjectContainer.js:149
+
src/pixi/display/DisplayObjectContainer.js:135
@@ -1019,7 +1025,7 @@
-
Returns the Child at the specified index
+
Returns the child at the specified index
@@ -1094,7 +1100,7 @@
- src/pixi/display/DisplayObject.js:199
+ src/pixi/display/DisplayObject.js:194
@@ -1124,7 +1130,7 @@
-
+
@@ -1179,7 +1185,7 @@
- src/pixi/display/DisplayObject.js:225
+ src/pixi/display/DisplayObject.js:220
@@ -1209,7 +1215,7 @@
-
+
@@ -1264,7 +1270,7 @@
- src/pixi/display/DisplayObject.js:219
+ src/pixi/display/DisplayObject.js:214
@@ -1294,7 +1300,7 @@
-
+
@@ -1349,7 +1355,7 @@
- src/pixi/display/DisplayObject.js:205
+ src/pixi/display/DisplayObject.js:200
@@ -1380,7 +1386,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
-
+
@@ -1435,7 +1441,7 @@ for this callback to be fired the mouse must have been pressed down over the dis
- src/pixi/display/DisplayObject.js:212
+ src/pixi/display/DisplayObject.js:207
@@ -1466,7 +1472,7 @@ for this callback to be fired, The touch must have started over the displayObjec
-
+
@@ -1521,7 +1527,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- src/pixi/display/DisplayObjectContainer.js:167
+ src/pixi/display/DisplayObjectContainer.js:153
@@ -1609,7 +1615,7 @@ for this callback to be fired, The touch must have started over the displayObjec
- src/pixi/display/DisplayObject.js:266
+ src/pixi/display/DisplayObject.js:261
@@ -1642,7 +1648,7 @@ Instead of using this function you can now simply set the interactive property t
-
+
@@ -1705,7 +1711,7 @@ Instead of using this function you can now simply set the interactive property t
- src/pixi/display/DisplayObjectContainer.js:123
+ src/pixi/display/DisplayObjectContainer.js:109
@@ -1735,7 +1741,7 @@ Instead of using this function you can now simply set the interactive property t
-
+
@@ -1750,7 +1756,7 @@ Instead of using this function you can now simply set the interactive property t
-
+
@@ -1805,7 +1811,7 @@ Instead of using this function you can now simply set the interactive property t
- src/pixi/display/DisplayObject.js:236
+ src/pixi/display/DisplayObject.js:231
@@ -1836,7 +1842,7 @@ basically a touch version of click
-
+
@@ -1891,7 +1897,7 @@ basically a touch version of click
- src/pixi/display/DisplayObject.js:249
+ src/pixi/display/DisplayObject.js:244
@@ -1921,7 +1927,7 @@ basically a touch version of click
-
+
@@ -1976,7 +1982,7 @@ basically a touch version of click
- src/pixi/display/DisplayObject.js:255
+ src/pixi/display/DisplayObject.js:250
@@ -2007,7 +2013,7 @@ for this callback to be fired, The touch must have started over the sprite
-
+
@@ -2062,7 +2068,7 @@ for this callback to be fired, The touch must have started over the sprite
- src/pixi/display/DisplayObject.js:243
+ src/pixi/display/DisplayObject.js:238
@@ -2073,7 +2079,7 @@ for this callback to be fired, The touch must have started over the sprite
-
A callback that is used when the user touch's over the displayObject
+
A callback that is used when the user touches over the displayObject
@@ -2092,7 +2098,7 @@ for this callback to be fired, The touch must have started over the sprite
-
+
@@ -2318,7 +2324,7 @@ for this callback to be fired, The touch must have started over the sprite
-
[NYI] Unkown
+
[NYI] Unknown
@@ -2360,7 +2366,7 @@ for this callback to be fired, The touch must have started over the sprite
-
This is the curser that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
+
This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
@@ -2436,7 +2442,7 @@ for this callback to be fired, The touch must have started over the sprite
- src/pixi/display/DisplayObject.js:340
+ src/pixi/display/DisplayObject.js:335
@@ -2485,7 +2491,7 @@ To remove filters simply set this property to 'null'
- src/pixi/extras/TilingSprite.js:67
+ src/pixi/extras/TilingSprite.js:68
@@ -2495,7 +2501,7 @@ To remove filters simply set this property to 'null'
-
The height of the TilingSprite, setting this will actually modify the scale to acheive the value set
+
The height of the TilingSprite, setting this will actually modify the scale to achieve the value set
@@ -2570,7 +2576,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
- src/pixi/display/DisplayObject.js:279
+ src/pixi/display/DisplayObject.js:274
@@ -2658,7 +2664,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
- src/pixi/display/DisplayObject.js:320
+ src/pixi/display/DisplayObject.js:315
@@ -2669,7 +2675,7 @@ Setting it is a neat way of optimising the hitTest function that the interaction
Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.
-In PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping.
+In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.
To remove a mask, set this property to null.
@@ -2999,7 +3005,7 @@ To remove a mask, set this property to null.
- src/pixi/extras/TilingSprite.js:32
+ src/pixi/extras/TilingSprite.js:33
@@ -3044,7 +3050,7 @@ To remove a mask, set this property to null.
- src/pixi/extras/TilingSprite.js:24
+ src/pixi/extras/TilingSprite.js:22
@@ -3131,7 +3137,7 @@ To remove a mask, set this property to null.
- src/pixi/extras/TilingSprite.js:51
+ src/pixi/extras/TilingSprite.js:52
@@ -3141,7 +3147,7 @@ To remove a mask, set this property to null.
-
The width of the sprite, setting this will actually modify the scale to acheive the value set
+
The width of the sprite, setting this will actually modify the scale to achieve the value set
@@ -3183,7 +3189,7 @@ To remove a mask, set this property to null.
-
[read-only] The multiplied alpha of the displayobject
+
[read-only] The multiplied alpha of the displayObject
@@ -3259,7 +3265,7 @@ To remove a mask, set this property to null.
- src/pixi/display/DisplayObject.js:299
+ src/pixi/display/DisplayObject.js:294
diff --git a/docs/classes/TwistFilter.html b/docs/classes/TwistFilter.html
new file mode 100644
index 0000000..01f8041
--- /dev/null
+++ b/docs/classes/TwistFilter.html
@@ -0,0 +1,429 @@
+
+
+
+
+ TwistFilter - pixi.js
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Show:
+
+
+ Inherited
+
+
+
+
+ Protected
+
+
+
+
+ Private
+
+
+
+ Deprecated
+
+
+
+
+
+
+
+
+
TwistFilter Class
+
+
+
+
+
+
This filter applies a twist effect making display objects appear twisted in the given direction
+
+
+
+
+
+
+
+
+
+
+
Item Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Properties
+
+
+
+
angle
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
This radius describes angle of the twist
+
+
+
+
+
+
+
+
+
+
+
+
+
size
+
Point
+
+
+
+
+
+
+
+
+
+
+
+
+
This point describes the the offset of the twist
+
+
+
+
+
+
+
+
+
+
+
+
+
size
+
Number
+
+
+
+
+
+
+
+
+
+
+
+
+
This radius describes size of the twist
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/classes/WebGLRenderer.html b/docs/classes/WebGLRenderer.html
index 14e6bef..048e90f 100644
--- a/docs/classes/WebGLRenderer.html
+++ b/docs/classes/WebGLRenderer.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -178,7 +184,7 @@
@@ -194,8 +200,8 @@
-
the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer
-should be used for browsers support webGL. This Render works by automatically managing webGLBatchs.
+
the WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer
+should be used for browsers that support webGL. This Render works by automatically managing webGLBatch's.
So no need for Sprite Batch's or Sprite Cloud's
Dont forget to add the view to your DOM or you will not see anything :)
@@ -270,7 +276,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
-
src/pixi/renderers/webgl/WebGLRenderer.js:13
+
src/pixi/renderers/webgl/WebGLRenderer.js:7
@@ -347,7 +353,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
-
the transparency of the render view, default false
+
If the render view is transparent, default false
@@ -437,15 +443,6 @@ Dont forget to add the view to your DOM or you will not see anything :)
-
-
-
- updateTexture
-
-
- static
-
-
@@ -517,7 +514,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
- src/pixi/renderers/webgl/WebGLRenderer.js:297
+ src/pixi/renderers/webgl/WebGLRenderer.js:267
@@ -608,7 +605,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
- src/pixi/renderers/webgl/WebGLRenderer.js:378
+ src/pixi/renderers/webgl/WebGLRenderer.js:385
@@ -698,7 +695,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
- src/pixi/renderers/webgl/WebGLRenderer.js:391
+ src/pixi/renderers/webgl/WebGLRenderer.js:398
@@ -786,7 +783,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
- src/pixi/renderers/webgl/WebGLRenderer.js:126
+ src/pixi/renderers/webgl/WebGLRenderer.js:134
@@ -881,7 +878,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
- src/pixi/renderers/webgl/WebGLRenderer.js:325
+ src/pixi/renderers/webgl/WebGLRenderer.js:301
@@ -941,99 +938,6 @@ Dont forget to add the view to your DOM or you will not see anything :)
-
-
-
-
-
updateTexture
-
-
-
-
-
-
-
-
-
-
-
private
-
-
-
-
-
-
static
-
-
-
-
-
-
-
-
-
-
Updates a loaded webgl texture
-
-
-
-
-
-
Parameters:
-
-
-
-
-
- texture
- Texture
-
-
-
-
-
-
The texture to update
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1073,7 +977,7 @@ Dont forget to add the view to your DOM or you will not see anything :)
-
src/pixi/renderers/webgl/WebGLRenderer.js:223
+
src/pixi/renderers/webgl/WebGLRenderer.js:240
diff --git a/docs/data.json b/docs/data.json
index 47cd728..b6fafb4 100644
--- a/docs/data.json
+++ b/docs/data.json
@@ -2,7 +2,7 @@
"project": {
"name": "pixi.js",
"description": "Pixi.js is a fast lightweight 2D library that works across all devices.",
- "version": "1.4.0",
+ "version": "1.4.3",
"url": "http://goodboydigital.com/",
"logo": "http://www.goodboydigital.com/pixijs/logo_small.png"
},
@@ -83,7 +83,7 @@
"name": "src/pixi/display/Sprite.js",
"modules": {},
"classes": {
- "Sprite™": 1
+ "Sprite": 1
},
"fors": {},
"namespaces": {}
@@ -205,7 +205,9 @@
"src/pixi/filters/DotScreenFilter.js": {
"name": "src/pixi/filters/DotScreenFilter.js",
"modules": {},
- "classes": {},
+ "classes": {
+ "DotScreenFilter": 1
+ },
"fors": {},
"namespaces": {}
},
@@ -237,7 +239,9 @@
"src/pixi/filters/PixelateFilter.js": {
"name": "src/pixi/filters/PixelateFilter.js",
"modules": {},
- "classes": {},
+ "classes": {
+ "PixelateFilter": 1
+ },
"fors": {},
"namespaces": {}
},
@@ -268,7 +272,7 @@
"name": "src/pixi/filters/TwistFilter.js",
"modules": {},
"classes": {
- "PixelateFilter": 1
+ "TwistFilter": 1
},
"fors": {},
"namespaces": {}
@@ -375,6 +379,15 @@
"fors": {},
"namespaces": {}
},
+ "src/pixi/renderers/webgl/shaders/PixiFastShader.js": {
+ "name": "src/pixi/renderers/webgl/shaders/PixiFastShader.js",
+ "modules": {},
+ "classes": {
+ "PIXI.PixiFastShader": 1
+ },
+ "fors": {},
+ "namespaces": {}
+ },
"src/pixi/renderers/webgl/shaders/PixiShader.js": {
"name": "src/pixi/renderers/webgl/shaders/PixiShader.js",
"modules": {},
@@ -398,6 +411,13 @@
"fors": {},
"namespaces": {}
},
+ "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js": {
+ "name": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js",
+ "modules": {},
+ "classes": {},
+ "fors": {},
+ "namespaces": {}
+ },
"src/pixi/renderers/webgl/utils/WebGLFilterManager.js": {
"name": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js",
"modules": {},
@@ -580,7 +600,7 @@
"DisplayObject": 1,
"DisplayObjectContainer": 1,
"MovieClip": 1,
- "Sprite™": 1,
+ "Sprite": 1,
"Stage": 1,
"Spine": 1,
"TilingSprite": 1,
@@ -590,10 +610,12 @@
"ColorMatrixFilter": 1,
"ColorStepFilter": 1,
"DisplacementFilter": 1,
- "PixelateFilter": 1,
+ "DotScreenFilter": 1,
"GrayFilter": 1,
"InvertFilter": 1,
+ "PixelateFilter": 1,
"SepiaFilter": 1,
+ "TwistFilter": 1,
"AssetLoader": 1,
"AtlasLoader": 1,
"BitmapFontLoader": 1,
@@ -603,6 +625,7 @@
"Graphics": 1,
"CanvasGraphics": 1,
"CanvasRenderer": 1,
+ "PIXI.PixiFastShader": 1,
"PIXI.PixiShader": 1,
"WebGLRenderer": 1,
"BitmapText": 1,
@@ -621,7 +644,7 @@
"namespaces": {},
"tag": "module",
"file": "src/pixi/InteractionManager.js",
- "line": 640
+ "line": 665
}
},
"classes": {
@@ -636,7 +659,7 @@
"module": "PIXI",
"file": "src/pixi/core/Circle.js",
"line": 5,
- "description": "The Circle object can be used to specify a hit area for displayobjects",
+ "description": "The Circle object can be used to specify a hit area for displayObjects",
"is_constructor": 1,
"params": [
{
@@ -667,7 +690,7 @@
"module": "PIXI",
"file": "src/pixi/core/Ellipse.js",
"line": 5,
- "description": "The Ellipse object can be used to specify a hit area for displayobjects",
+ "description": "The Ellipse object can be used to specify a hit area for displayObjects",
"is_constructor": 1,
"params": [
{
@@ -826,9 +849,9 @@
}
]
},
- "Sprite™": {
- "name": "Sprite™",
- "shortname": "Sprite™",
+ "Sprite": {
+ "name": "Sprite",
+ "shortname": "Sprite",
"classitems": [],
"plugins": [],
"extensions": [],
@@ -836,8 +859,8 @@
"extension_for": [],
"module": "PIXI",
"file": "src/pixi/display/Sprite.js",
- "line": 11,
- "description": "The SPrite object is the base for all textured objects that are rendered to the screen",
+ "line": 3,
+ "description": "The Sprite object is the base for all textured objects that are rendered to the screen",
"extends": "DisplayObjectContainer",
"is_constructor": 1,
"params": [
@@ -882,7 +905,7 @@
"module": "PIXI",
"file": "src/pixi/loaders/SpineLoader.js",
"line": 10,
- "description": "The Spine loader is used to load in JSON spine data\nTo generate the data you need to use http://esotericsoftware.com/ and export the \"JSON\" format\nDue to a clash of names You will need to change the extension of the spine file from *.json to *.anim for it to load\nSee example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source\nYou will need to generate a sprite sheet to accompany the spine data\nWhen loaded this class will dispatch a \"loaded\" event",
+ "description": "The Spine loader is used to load in JSON spine data\nTo generate the data you need to use http://esotericsoftware.com/ and export in the \"JSON\" format\nDue to a clash of names You will need to change the extension of the spine file from *.json to *.anim for it to load\nSee example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source\nYou will need to generate a sprite sheet to accompany the spine data\nWhen loaded this class will dispatch a \"loaded\" event",
"extends": "DisplayObjectContainer",
"is_constructor": 1,
"params": [
@@ -939,7 +962,7 @@
"module": "PIXI",
"file": "src/pixi/filters/AbstractFilter.js",
"line": 5,
- "description": "This is the base class for creating a pixi.js filter. Currently only webGL supports filters.\nIf you want to make a custom filter this should be your base class.",
+ "description": "This is the base class for creating a pixi.js filter. Currently only webGL supports filters.\nIf you want to make a custom filter this should be your base class.",
"is_constructor": 1,
"params": [
{
@@ -1012,7 +1035,7 @@
"module": "PIXI",
"file": "src/pixi/filters/ColorStepFilter.js",
"line": 5,
- "description": "This turns your displayObjects to black and white.",
+ "description": "This lowers the color depth of your image by the given amount, producing an image with a smaller palette.",
"contructor": ""
},
"DisplacementFilter": {
@@ -1036,18 +1059,18 @@
}
]
},
- "PixelateFilter": {
- "name": "PixelateFilter",
- "shortname": "PixelateFilter",
+ "DotScreenFilter": {
+ "name": "DotScreenFilter",
+ "shortname": "DotScreenFilter",
"classitems": [],
"plugins": [],
"extensions": [],
"plugin_for": [],
"extension_for": [],
"module": "PIXI",
- "file": "src/pixi/filters/TwistFilter.js",
- "line": 5,
- "description": "This filter applies a pixlate effect making display objects appear 'blocky'",
+ "file": "src/pixi/filters/DotScreenFilter.js",
+ "line": 6,
+ "description": "This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer",
"contructor": ""
},
"GrayFilter": {
@@ -1078,6 +1101,20 @@
"description": "This inverts your displayObjects colors.",
"contructor": ""
},
+ "PixelateFilter": {
+ "name": "PixelateFilter",
+ "shortname": "PixelateFilter",
+ "classitems": [],
+ "plugins": [],
+ "extensions": [],
+ "plugin_for": [],
+ "extension_for": [],
+ "module": "PIXI",
+ "file": "src/pixi/filters/PixelateFilter.js",
+ "line": 5,
+ "description": "This filter applies a pixelate effect making display objects appear 'blocky'",
+ "contructor": ""
+ },
"SepiaFilter": {
"name": "SepiaFilter",
"shortname": "SepiaFilter",
@@ -1092,6 +1129,20 @@
"description": "This applies a sepia effect to your displayObjects.",
"contructor": ""
},
+ "TwistFilter": {
+ "name": "TwistFilter",
+ "shortname": "TwistFilter",
+ "classitems": [],
+ "plugins": [],
+ "extensions": [],
+ "plugin_for": [],
+ "extension_for": [],
+ "module": "PIXI",
+ "file": "src/pixi/filters/TwistFilter.js",
+ "line": 5,
+ "description": "This filter applies a twist effect making display objects appear twisted in the given direction",
+ "contructor": ""
+ },
"AssetLoader": {
"name": "AssetLoader",
"shortname": "AssetLoader",
@@ -1132,7 +1183,7 @@
"module": "PIXI",
"file": "src/pixi/loaders/AtlasLoader.js",
"line": 5,
- "description": "The atlas file loader is used to load in Atlas data and parsing it\nWhen loaded this class will dispatch a 'loaded' event\nIf load failed this class will dispatch a 'error' event",
+ "description": "The atlas file loader is used to load in Atlas data and parse it\nWhen loaded this class will dispatch a 'loaded' event\nIf loading fails this class will dispatch an 'error' event",
"extends": "EventTarget",
"is_constructor": 1,
"params": [
@@ -1188,7 +1239,7 @@
"module": "PIXI",
"file": "src/pixi/loaders/ImageLoader.js",
"line": 5,
- "description": "The image loader class is responsible for loading images file formats ('jpeg', 'jpg', 'png' and 'gif')\nOnce the image has been loaded it is stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nWhen loaded this class will dispatch a 'loaded' event",
+ "description": "The image loader class is responsible for loading images file formats ('jpeg', 'jpg', 'png' and 'gif')\nOnce the image has been loaded it is stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFrameId()\nWhen loaded this class will dispatch a 'loaded' event",
"uses": [
"EventTarget"
],
@@ -1217,7 +1268,7 @@
"module": "PIXI",
"file": "src/pixi/loaders/JsonLoader.js",
"line": 5,
- "description": "The json file loader is used to load in JSON data and parsing it\nWhen loaded this class will dispatch a 'loaded' event\nIf load failed this class will dispatch a 'error' event",
+ "description": "The json file loader is used to load in JSON data and parse it\nWhen loaded this class will dispatch a 'loaded' event\nIf loading fails this class will dispatch an 'error' event",
"uses": [
"EventTarget"
],
@@ -1246,7 +1297,7 @@
"module": "PIXI",
"file": "src/pixi/loaders/SpriteSheetLoader.js",
"line": 5,
- "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish the 'JSON' format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()\nThis loader will also load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event",
+ "description": "The sprite sheet loader is used to load in JSON sprite sheet data\nTo generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format\nThere is a free version so thats nice, although the paid version is great value for money.\nIt is highly recommended to use Sprite sheets (also know as a 'texture atlas') as it means sprites can be batched and drawn together for highly increased rendering speed.\nOnce the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFrameId()\nThis loader will load the image file that the Spritesheet points to as well as the data.\nWhen loaded this class will dispatch a 'loaded' event",
"uses": [
"EventTarget"
],
@@ -1328,6 +1379,19 @@
}
]
},
+ "PIXI.PixiFastShader": {
+ "name": "PIXI.PixiFastShader",
+ "shortname": "PIXI.PixiFastShader",
+ "classitems": [],
+ "plugins": [],
+ "extensions": [],
+ "plugin_for": [],
+ "extension_for": [],
+ "module": "PIXI",
+ "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js",
+ "line": 6,
+ "is_constructor": 1
+ },
"PIXI.PixiShader": {
"name": "PIXI.PixiShader",
"shortname": "PIXI.PixiShader",
@@ -1351,8 +1415,8 @@
"extension_for": [],
"module": "PIXI",
"file": "src/pixi/renderers/webgl/WebGLRenderer.js",
- "line": 13,
- "description": "the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer\nshould be used for browsers support webGL. This Render works by automatically managing webGLBatchs.\nSo no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)",
+ "line": 7,
+ "description": "the WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer\nshould be used for browsers that support webGL. This Render works by automatically managing webGLBatch's.\nSo no need for Sprite Batch's or Sprite Cloud's\nDont forget to add the view to your DOM or you will not see anything :)",
"is_constructor": 1,
"params": [
{
@@ -1372,7 +1436,7 @@
},
{
"name": "transparent=false",
- "description": "the transparency of the render view, default false",
+ "description": "If the render view is transparent, default false",
"type": "Boolean"
},
{
@@ -1414,7 +1478,7 @@
},
{
"name": "align",
- "description": "An alignment of the multiline text ('left', 'center' or 'right')",
+ "description": "Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text",
"type": "String",
"optional": true,
"optdefault": "'left'"
@@ -1434,7 +1498,7 @@
"module": "PIXI",
"file": "src/pixi/text/Text.js",
"line": 5,
- "description": "A Text Object will create a line(s) of text to split a line you can use '\\n'",
+ "description": "A Text Object will create a line(s) of text. To split a line you can use '\\n'",
"extends": "Sprite",
"is_constructor": 1,
"params": [
@@ -1464,7 +1528,7 @@
},
{
"name": "align",
- "description": "An alignment of the multiline text ('left', 'center' or 'right')",
+ "description": "Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text",
"type": "String",
"optional": true,
"optdefault": "'left'"
@@ -1510,7 +1574,7 @@
"extension_for": [],
"module": "PIXI",
"file": "src/pixi/textures/BaseTexture.js",
- "line": 9,
+ "line": 11,
"description": "A texture stores the information that represents an image. All textures have a base texture",
"uses": [
"EventTarget"
@@ -1535,7 +1599,7 @@
"module": "PIXI",
"file": "src/pixi/textures/RenderTexture.js",
"line": 5,
- "description": "A RenderTexture is a special texture that allows any pixi displayObject to be rendered to it.\n\n__Hint__: All DisplayObjects (exmpl. Sprites) that renders on RenderTexture should be preloaded.\nOtherwise black rectangles will be drawn instead.\n\nRenderTexture takes snapshot of DisplayObject passed to render method. If DisplayObject is passed to render method, position and rotation of it will be ignored. For example:\n\n var renderTexture = new PIXI.RenderTexture(800, 600);\n var sprite = PIXI.Sprite.fromImage(\"spinObj_01.png\");\n sprite.position.x = 800/2;\n sprite.position.y = 600/2;\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n renderTexture.render(sprite);\n\nSprite in this case will be rendered to 0,0 position. To render this sprite at center DisplayObjectContainer should be used:\n\n var doc = new PIXI.DisplayObjectContainer();\n doc.addChild(sprite);\n renderTexture.render(doc); // Renders to center of renderTexture",
+ "description": "A RenderTexture is a special texture that allows any pixi displayObject to be rendered to it.\n\n__Hint__: All DisplayObjects (exmpl. Sprites) that render on RenderTexture should be preloaded.\nOtherwise black rectangles will be drawn instead.\n\nRenderTexture takes snapshot of DisplayObject passed to render method. If DisplayObject is passed to render method, position and rotation of it will be ignored. For example:\n\n var renderTexture = new PIXI.RenderTexture(800, 600);\n var sprite = PIXI.Sprite.fromImage(\"spinObj_01.png\");\n sprite.position.x = 800/2;\n sprite.position.y = 600/2;\n sprite.anchor.x = 0.5;\n sprite.anchor.y = 0.5;\n renderTexture.render(sprite);\n\nSprite in this case will be rendered to 0,0 position. To render this sprite at center DisplayObjectContainer should be used:\n\n var doc = new PIXI.DisplayObjectContainer();\n doc.addChild(sprite);\n renderTexture.render(doc); // Renders to center of renderTexture",
"extends": "Texture",
"is_constructor": 1,
"params": [
@@ -1561,7 +1625,7 @@
"extension_for": [],
"module": "PIXI",
"file": "src/pixi/textures/Texture.js",
- "line": 8,
+ "line": 10,
"description": "A texture stores the information that represents an image or part of an image. It cannot be added\nto the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used",
"uses": [
"EventTarget"
@@ -1685,7 +1749,7 @@
"module": "PIXI",
"namespace": "PolyK",
"file": "src/pixi/InteractionManager.js",
- "line": 640,
+ "line": 665,
"description": "Holds all information related to an Interaction event",
"is_constructor": 1
}
@@ -1817,7 +1881,7 @@
{
"file": "src/pixi/core/Ellipse.js",
"line": 57,
- "description": "Checks if the x, and y coords passed to this function are contained within this ellipse",
+ "description": "Checks if the x and y coords passed to this function are contained within this ellipse",
"itemtype": "method",
"name": "contains",
"params": [
@@ -1895,7 +1959,7 @@
{
"file": "src/pixi/core/Polygon.js",
"line": 51,
- "description": "Checks if the x, and y coords passed to this function are contained within this polygon",
+ "description": "Checks if the x and y coords passed to this function are contained within this polygon",
"itemtype": "method",
"name": "contains",
"params": [
@@ -1973,7 +2037,7 @@
{
"file": "src/pixi/core/Rectangle.js",
"line": 57,
- "description": "Checks if the x, and y coords passed to this function are contained within this Rectangle",
+ "description": "Checks if the x and y coords passed to this function are contained within this Rectangle",
"itemtype": "method",
"name": "contains",
"params": [
@@ -2104,7 +2168,7 @@
{
"file": "src/pixi/display/DisplayObject.js",
"line": 106,
- "description": "[read-only] The multiplied alpha of the displayobject",
+ "description": "[read-only] The multiplied alpha of the displayObject",
"itemtype": "property",
"name": "worldAlpha",
"type": "Number",
@@ -2126,7 +2190,7 @@
{
"file": "src/pixi/display/DisplayObject.js",
"line": 125,
- "description": "This is the curser that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true",
+ "description": "This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true",
"itemtype": "property",
"name": "defaultCursor",
"type": "String",
@@ -2159,7 +2223,7 @@
{
"file": "src/pixi/display/DisplayObject.js",
"line": 154,
- "description": "[NYI] Unkown",
+ "description": "[NYI] Unknown",
"itemtype": "property",
"name": "color",
"type": "Array<>",
@@ -2180,12 +2244,7 @@
},
{
"file": "src/pixi/display/DisplayObject.js",
- "line": 180,
- "class": "DisplayObject"
- },
- {
- "file": "src/pixi/display/DisplayObject.js",
- "line": 193,
+ "line": 188,
"description": "A callback that is used when the users clicks on the displayObject with their mouse",
"itemtype": "method",
"name": "click",
@@ -2200,7 +2259,7 @@
},
{
"file": "src/pixi/display/DisplayObject.js",
- "line": 199,
+ "line": 194,
"description": "A callback that is used when the user clicks the mouse down over the sprite",
"itemtype": "method",
"name": "mousedown",
@@ -2215,7 +2274,7 @@
},
{
"file": "src/pixi/display/DisplayObject.js",
- "line": 205,
+ "line": 200,
"description": "A callback that is used when the user releases the mouse that was over the displayObject\nfor this callback to be fired the mouse must have been pressed down over the displayObject",
"itemtype": "method",
"name": "mouseup",
@@ -2230,7 +2289,7 @@
},
{
"file": "src/pixi/display/DisplayObject.js",
- "line": 212,
+ "line": 207,
"description": "A callback that is used when the user releases the mouse that was over the displayObject but is no longer over the displayObject\nfor this callback to be fired, The touch must have started over the displayObject",
"itemtype": "method",
"name": "mouseupoutside",
@@ -2245,7 +2304,7 @@
},
{
"file": "src/pixi/display/DisplayObject.js",
- "line": 219,
+ "line": 214,
"description": "A callback that is used when the users mouse rolls over the displayObject",
"itemtype": "method",
"name": "mouseover",
@@ -2260,7 +2319,7 @@
},
{
"file": "src/pixi/display/DisplayObject.js",
- "line": 225,
+ "line": 220,
"description": "A callback that is used when the users mouse leaves the displayObject",
"itemtype": "method",
"name": "mouseout",
@@ -2275,7 +2334,7 @@
},
{
"file": "src/pixi/display/DisplayObject.js",
- "line": 236,
+ "line": 231,
"description": "A callback that is used when the users taps on the sprite with their finger\nbasically a touch version of click",
"itemtype": "method",
"name": "tap",
@@ -2290,8 +2349,8 @@
},
{
"file": "src/pixi/display/DisplayObject.js",
- "line": 243,
- "description": "A callback that is used when the user touch's over the displayObject",
+ "line": 238,
+ "description": "A callback that is used when the user touches over the displayObject",
"itemtype": "method",
"name": "touchstart",
"params": [
@@ -2305,7 +2364,7 @@
},
{
"file": "src/pixi/display/DisplayObject.js",
- "line": 249,
+ "line": 244,
"description": "A callback that is used when the user releases a touch over the displayObject",
"itemtype": "method",
"name": "touchend",
@@ -2320,7 +2379,7 @@
},
{
"file": "src/pixi/display/DisplayObject.js",
- "line": 255,
+ "line": 250,
"description": "A callback that is used when the user releases the touch that was over the displayObject\nfor this callback to be fired, The touch must have started over the sprite",
"itemtype": "method",
"name": "touchendoutside",
@@ -2335,7 +2394,7 @@
},
{
"file": "src/pixi/display/DisplayObject.js",
- "line": 266,
+ "line": 261,
"description": "[Deprecated] Indicates if the sprite will have touch and mouse interactivity. It is false by default\nInstead of using this function you can now simply set the interactive property to true or false",
"itemtype": "method",
"name": "setInteractive",
@@ -2352,7 +2411,7 @@
},
{
"file": "src/pixi/display/DisplayObject.js",
- "line": 279,
+ "line": 274,
"description": "Indicates if the sprite will have touch and mouse interactivity. It is false by default",
"itemtype": "property",
"name": "interactive",
@@ -2362,7 +2421,7 @@
},
{
"file": "src/pixi/display/DisplayObject.js",
- "line": 299,
+ "line": 294,
"description": "[read-only] Indicates if the sprite is globaly visible.",
"itemtype": "property",
"name": "worldVisible",
@@ -2371,8 +2430,8 @@
},
{
"file": "src/pixi/display/DisplayObject.js",
- "line": 320,
- "description": "Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.\nIn PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping.\nTo remove a mask, set this property to null.",
+ "line": 315,
+ "description": "Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.\nIn PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.\nTo remove a mask, set this property to null.",
"itemtype": "property",
"name": "mask",
"type": "Graphics",
@@ -2380,7 +2439,7 @@
},
{
"file": "src/pixi/display/DisplayObject.js",
- "line": 340,
+ "line": 335,
"description": "Sets the filters for the displayObject.\n* IMPORTANT: This is a webGL only feature and will be ignored by the canvas renderer.\nTo remove filters simply set this property to 'null'",
"itemtype": "property",
"name": "filters",
@@ -2406,7 +2465,7 @@
{
"file": "src/pixi/display/DisplayObjectContainer.js",
"line": 32,
- "description": "The width of the displayObjectContainer, setting this will actually modify the scale to acheive the value set",
+ "description": "The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set",
"itemtype": "property",
"name": "width",
"type": "Number",
@@ -2415,7 +2474,7 @@
{
"file": "src/pixi/display/DisplayObjectContainer.js",
"line": 51,
- "description": "The height of the displayObjectContainer, setting this will actually modify the scale to acheive the value set",
+ "description": "The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set",
"itemtype": "property",
"name": "height",
"type": "Number",
@@ -2438,7 +2497,7 @@
},
{
"file": "src/pixi/display/DisplayObjectContainer.js",
- "line": 95,
+ "line": 81,
"description": "Adds a child to the container at a specified index. If the index is out of bounds an error will be thrown",
"itemtype": "method",
"name": "addChildAt",
@@ -2458,7 +2517,7 @@
},
{
"file": "src/pixi/display/DisplayObjectContainer.js",
- "line": 123,
+ "line": 109,
"description": "[NYI] Swaps the depth of 2 displayObjects",
"itemtype": "method",
"name": "swapChildren",
@@ -2480,8 +2539,8 @@
},
{
"file": "src/pixi/display/DisplayObjectContainer.js",
- "line": 149,
- "description": "Returns the Child at the specified index",
+ "line": 135,
+ "description": "Returns the child at the specified index",
"itemtype": "method",
"name": "getChildAt",
"params": [
@@ -2495,7 +2554,7 @@
},
{
"file": "src/pixi/display/DisplayObjectContainer.js",
- "line": 167,
+ "line": 153,
"description": "Removes a child from the container.",
"itemtype": "method",
"name": "removeChild",
@@ -2555,7 +2614,7 @@
{
"file": "src/pixi/display/MovieClip.js",
"line": 51,
- "description": "[read-only] The index MovieClips current frame (this may not have to be a whole number)",
+ "description": "[read-only] The MovieClips current frame index (this may not have to be a whole number)",
"itemtype": "property",
"name": "currentFrame",
"type": "Number",
@@ -2632,91 +2691,85 @@
},
{
"file": "src/pixi/display/Sprite.js",
- "line": 1,
- "author": "Mat Groves http://matgroves.com/ @Doormat23",
- "class": "Sprite™"
- },
- {
- "file": "src/pixi/display/Sprite.js",
- "line": 24,
+ "line": 16,
"description": "The anchor sets the origin point of the texture.\nThe default is 0,0 this means the textures origin is the top left\nSetting than anchor to 0.5,0.5 means the textures origin is centered\nSetting the anchor to 1,1 would mean the textures origin points will be the bottom right",
"itemtype": "property",
"name": "anchor",
"type": "Point",
- "class": "Sprite™"
+ "class": "Sprite"
},
{
"file": "src/pixi/display/Sprite.js",
- "line": 35,
+ "line": 27,
"description": "The texture that the sprite is using",
"itemtype": "property",
"name": "texture",
"type": "Texture",
- "class": "Sprite™"
+ "class": "Sprite"
},
{
"file": "src/pixi/display/Sprite.js",
- "line": 43,
+ "line": 35,
"description": "The width of the sprite (this is initially set by the texture)",
"itemtype": "property",
"name": "_width",
"type": "Number",
"access": "private",
"tagname": "",
- "class": "Sprite™"
+ "class": "Sprite"
},
{
"file": "src/pixi/display/Sprite.js",
- "line": 52,
+ "line": 44,
"description": "The height of the sprite (this is initially set by the texture)",
"itemtype": "property",
"name": "_height",
"type": "Number",
"access": "private",
"tagname": "",
- "class": "Sprite™"
+ "class": "Sprite"
},
{
"file": "src/pixi/display/Sprite.js",
- "line": 62,
+ "line": 54,
"description": "The tint applied to the sprite. This is a hex value",
"itemtype": "property",
"name": "tint",
"type": "Number",
"default": "0xFFFFFF",
- "class": "Sprite™"
+ "class": "Sprite"
},
{
"file": "src/pixi/display/Sprite.js",
- "line": 71,
+ "line": 63,
"description": "The blend mode to be applied to the sprite",
"itemtype": "property",
"name": "blendMode",
"type": "Number",
"default": "PIXI.blendModes.NORMAL;",
- "class": "Sprite™"
+ "class": "Sprite"
},
{
"file": "src/pixi/display/Sprite.js",
- "line": 97,
- "description": "The width of the sprite, setting this will actually modify the scale to acheive the value set",
+ "line": 89,
+ "description": "The width of the sprite, setting this will actually modify the scale to achieve the value set",
"itemtype": "property",
"name": "width",
"type": "Number",
- "class": "Sprite™"
+ "class": "Sprite"
},
{
"file": "src/pixi/display/Sprite.js",
- "line": 113,
- "description": "The height of the sprite, setting this will actually modify the scale to acheive the value set",
+ "line": 105,
+ "description": "The height of the sprite, setting this will actually modify the scale to achieve the value set",
"itemtype": "property",
"name": "height",
"type": "Number",
- "class": "Sprite™"
+ "class": "Sprite"
},
{
"file": "src/pixi/display/Sprite.js",
- "line": 129,
+ "line": 121,
"description": "Sets the texture of the sprite",
"itemtype": "method",
"name": "setTexture",
@@ -2727,11 +2780,11 @@
"type": "Texture"
}
],
- "class": "Sprite™"
+ "class": "Sprite"
},
{
"file": "src/pixi/display/Sprite.js",
- "line": 152,
+ "line": 144,
"description": "When the texture is updated, this event will fire to update the scale and frame",
"itemtype": "method",
"name": "onTextureUpdate",
@@ -2743,11 +2796,11 @@
],
"access": "private",
"tagname": "",
- "class": "Sprite™"
+ "class": "Sprite"
},
{
"file": "src/pixi/display/Sprite.js",
- "line": 415,
+ "line": 407,
"description": "Helper function that creates a sprite that will contain a texture from the TextureCache based on the frameId\n The frame ids are created when a Texture packer file has been loaded",
"itemtype": "method",
"name": "fromFrame",
@@ -2763,11 +2816,11 @@
"description": "A new Sprite using a texture from the texture cache matching the frameId",
"type": "Sprite"
},
- "class": "Sprite™"
+ "class": "Sprite"
},
{
"file": "src/pixi/display/Sprite.js",
- "line": 432,
+ "line": 424,
"description": "Helper function that creates a sprite that will contain a texture based on an image url\n If the image is not in the texture cache it will be loaded",
"itemtype": "method",
"name": "fromImage",
@@ -2783,7 +2836,7 @@
"description": "A new Sprite using a texture from the texture cache matching the image id",
"type": "Sprite"
},
- "class": "Sprite™"
+ "class": "Sprite"
},
{
"file": "src/pixi/display/Stage.js",
@@ -2834,8 +2887,8 @@
},
{
"file": "src/pixi/display/Stage.js",
- "line": 70,
- "description": "Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element.\nThis is useful for when you have other DOM elements ontop of the Canvas element.",
+ "line": 66,
+ "description": "Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element.\nThis is useful for when you have other DOM elements on top of the Canvas element.",
"itemtype": "method",
"name": "setInteractionDelegate",
"params": [
@@ -2849,7 +2902,7 @@
},
{
"file": "src/pixi/display/Stage.js",
- "line": 108,
+ "line": 103,
"description": "Sets the background color for the stage",
"itemtype": "method",
"name": "setBackgroundColor",
@@ -2864,7 +2917,7 @@
},
{
"file": "src/pixi/display/Stage.js",
- "line": 124,
+ "line": 119,
"description": "This will return the point containing global coords of the mouse.",
"itemtype": "method",
"name": "getMousePosition",
@@ -3022,7 +3075,7 @@
},
{
"file": "src/pixi/extras/TilingSprite.js",
- "line": 24,
+ "line": 22,
"description": "The scaling of the image that is being tiled",
"itemtype": "property",
"name": "tileScale",
@@ -3031,7 +3084,7 @@
},
{
"file": "src/pixi/extras/TilingSprite.js",
- "line": 32,
+ "line": 33,
"description": "The offset position of the image that is being tiled",
"itemtype": "property",
"name": "tilePosition",
@@ -3040,8 +3093,8 @@
},
{
"file": "src/pixi/extras/TilingSprite.js",
- "line": 51,
- "description": "The width of the sprite, setting this will actually modify the scale to acheive the value set",
+ "line": 52,
+ "description": "The width of the sprite, setting this will actually modify the scale to achieve the value set",
"itemtype": "property",
"name": "width",
"type": "Number",
@@ -3049,8 +3102,8 @@
},
{
"file": "src/pixi/extras/TilingSprite.js",
- "line": 67,
- "description": "The height of the TilingSprite, setting this will actually modify the scale to acheive the value set",
+ "line": 68,
+ "description": "The height of the TilingSprite, setting this will actually modify the scale to achieve the value set",
"itemtype": "property",
"name": "height",
"type": "Number",
@@ -3090,31 +3143,13 @@
},
{
"file": "src/pixi/filters/AlphaMaskFilter.js",
- "line": 86,
+ "line": 79,
"description": "The texture used for the displacemtent map * must be power of 2 texture at the moment",
"itemtype": "property",
"name": "map",
"type": "Texture",
"class": "AlphaMaskFilter"
},
- {
- "file": "src/pixi/filters/AlphaMaskFilter.js",
- "line": 101,
- "description": "The multiplier used to scale the displacement result from the map calculation.",
- "itemtype": "property",
- "name": "scale",
- "type": "Point",
- "class": "AlphaMaskFilter"
- },
- {
- "file": "src/pixi/filters/AlphaMaskFilter.js",
- "line": 116,
- "description": "The offset used to move the displacement map.",
- "itemtype": "property",
- "name": "offset",
- "type": "Point",
- "class": "AlphaMaskFilter"
- },
{
"file": "src/pixi/filters/BlurFilter.js",
"line": 1,
@@ -3134,7 +3169,7 @@
{
"file": "src/pixi/filters/BlurFilter.js",
"line": 37,
- "description": "Sets the strength of the blurX property simultaneously",
+ "description": "Sets the strength of the blurX property",
"itemtype": "property",
"name": "blurX",
"type": "Number the strength of the blurX",
@@ -3144,7 +3179,7 @@
{
"file": "src/pixi/filters/BlurFilter.js",
"line": 53,
- "description": "Sets the strength of the blurX property simultaneously",
+ "description": "Sets the strength of the blurX property",
"itemtype": "property",
"name": "blurY",
"type": "Number the strength of the blurY",
@@ -3236,7 +3271,7 @@
"file": "src/pixi/filters/DotScreenFilter.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/ @Doormat23\noriginal filter: https://github.com/evanw/glfx.js/blob/master/src/filters/fun/dotscreen.js",
- "class": "PixelateFilter"
+ "class": "DotScreenFilter"
},
{
"file": "src/pixi/filters/DotScreenFilter.js",
@@ -3245,7 +3280,7 @@
"itemtype": "property",
"name": "scale",
"type": "Number",
- "class": "PixelateFilter"
+ "class": "DotScreenFilter"
},
{
"file": "src/pixi/filters/DotScreenFilter.js",
@@ -3254,7 +3289,7 @@
"itemtype": "property",
"name": "angle",
"type": "Number",
- "class": "PixelateFilter"
+ "class": "DotScreenFilter"
},
{
"file": "src/pixi/filters/FilterBlock.js",
@@ -3329,13 +3364,13 @@
"file": "src/pixi/filters/SmartBlurFilter.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/ @Doormat23",
- "class": "PixelateFilter"
+ "class": "TwistFilter"
},
{
"file": "src/pixi/filters/TwistFilter.js",
"line": 1,
"author": "Mat Groves http://matgroves.com/ @Doormat23",
- "class": "PixelateFilter"
+ "class": "TwistFilter"
},
{
"file": "src/pixi/filters/TwistFilter.js",
@@ -3344,7 +3379,7 @@
"itemtype": "property",
"name": "size",
"type": "Point",
- "class": "PixelateFilter"
+ "class": "TwistFilter"
},
{
"file": "src/pixi/filters/TwistFilter.js",
@@ -3353,7 +3388,7 @@
"itemtype": "property",
"name": "size",
"type": "Number",
- "class": "PixelateFilter"
+ "class": "TwistFilter"
},
{
"file": "src/pixi/filters/TwistFilter.js",
@@ -3362,7 +3397,7 @@
"itemtype": "property",
"name": "angle",
"type": "Number",
- "class": "PixelateFilter"
+ "class": "TwistFilter"
},
{
"file": "src/pixi/loaders/AssetLoader.js",
@@ -3530,7 +3565,7 @@
},
{
"file": "src/pixi/loaders/BitmapFontLoader.js",
- "line": 153,
+ "line": 165,
"description": "Invoked when all files are loaded (xml/fnt and texture)",
"itemtype": "method",
"name": "onLoaded",
@@ -3586,7 +3621,7 @@
"params": [
{
"name": "frameWidth",
- "description": "with of each frame",
+ "description": "width of each frame",
"type": "Number"
},
{
@@ -3731,16 +3766,6 @@
"line": 72,
"description": "Invoke when JSON file is loaded",
"itemtype": "method",
- "name": "onJSONLoaded",
- "access": "private",
- "tagname": "",
- "class": "Spine"
- },
- {
- "file": "src/pixi/loaders/SpineLoader.js",
- "line": 87,
- "description": "Invoke when JSON file is loaded",
- "itemtype": "method",
"name": "onLoaded",
"access": "private",
"tagname": "",
@@ -3809,16 +3834,6 @@
{
"file": "src/pixi/loaders/SpriteSheetLoader.js",
"line": 88,
- "description": "Invoke when JSON file is loaded",
- "itemtype": "method",
- "name": "onJSONLoaded",
- "access": "private",
- "tagname": "",
- "class": "SpriteSheetLoader"
- },
- {
- "file": "src/pixi/loaders/SpriteSheetLoader.js",
- "line": 126,
"description": "Invoke when all files are loaded (json and texture)",
"itemtype": "method",
"name": "onLoaded",
@@ -3883,7 +3898,19 @@
},
{
"file": "src/pixi/primitives/Graphics.js",
- "line": 89,
+ "line": 80,
+ "description": "If cacheAsBitmap is true the graphics object will then be rendered as if it was a sprite.\nThis is useful if your graphics element does not change often as it will speed up the rendering of the object\nIt is also usful as the graphics object will always be antialiased because it will be rendered using canvas\nNot recommended if you are constanly redrawing the graphics element.",
+ "itemtype": "property",
+ "name": "cacheAsBitmap",
+ "default": "false",
+ "type": "Boolean",
+ "access": "private",
+ "tagname": "",
+ "class": "Graphics"
+ },
+ {
+ "file": "src/pixi/primitives/Graphics.js",
+ "line": 112,
"description": "Specifies a line style used for subsequent calls to Graphics methods such as the lineTo() method or the drawCircle() method.",
"itemtype": "method",
"name": "lineStyle",
@@ -3908,7 +3935,7 @@
},
{
"file": "src/pixi/primitives/Graphics.js",
- "line": 111,
+ "line": 134,
"description": "Moves the current drawing position to (x, y).",
"itemtype": "method",
"name": "moveTo",
@@ -3928,7 +3955,7 @@
},
{
"file": "src/pixi/primitives/Graphics.js",
- "line": 130,
+ "line": 153,
"description": "Draws a line using the current line style from the current drawing position to (x, y);\nthe current drawing position is then set to (x, y).",
"itemtype": "method",
"name": "lineTo",
@@ -3948,7 +3975,7 @@
},
{
"file": "src/pixi/primitives/Graphics.js",
- "line": 144,
+ "line": 167,
"description": "Specifies a simple one-color fill that subsequent calls to other Graphics methods\n(such as lineTo() or drawCircle()) use when drawing.",
"itemtype": "method",
"name": "beginFill",
@@ -3968,7 +3995,7 @@
},
{
"file": "src/pixi/primitives/Graphics.js",
- "line": 160,
+ "line": 183,
"description": "Applies a fill to the lines and shapes that were added since the last call to the beginFill() method.",
"itemtype": "method",
"name": "endFill",
@@ -3976,7 +4003,7 @@
},
{
"file": "src/pixi/primitives/Graphics.js",
- "line": 172,
+ "line": 195,
"itemtype": "method",
"name": "drawRect",
"params": [
@@ -4005,7 +4032,7 @@
},
{
"file": "src/pixi/primitives/Graphics.js",
- "line": 192,
+ "line": 215,
"description": "Draws a circle.",
"itemtype": "method",
"name": "drawCircle",
@@ -4030,7 +4057,7 @@
},
{
"file": "src/pixi/primitives/Graphics.js",
- "line": 213,
+ "line": 236,
"description": "Draws an ellipse.",
"itemtype": "method",
"name": "drawEllipse",
@@ -4060,12 +4087,24 @@
},
{
"file": "src/pixi/primitives/Graphics.js",
- "line": 235,
+ "line": 258,
"description": "Clears the graphics that were drawn to this Graphics object, and resets fill and line style settings.",
"itemtype": "method",
"name": "clear",
"class": "Graphics"
},
+ {
+ "file": "src/pixi/primitives/Graphics.js",
+ "line": 275,
+ "description": "Useful function that returns a texture of the graphics object that can then be used to create sprites\nThis can be quite useful if your geometry is complicated and needs to be reused multiple times.",
+ "itemtype": "method",
+ "name": "generateTexture",
+ "return": {
+ "description": "a texture of the graphics object",
+ "type": "Texture"
+ },
+ "class": "Graphics"
+ },
{
"file": "src/pixi/renderers/canvas/utils/CanvasMaskManager.js",
"line": 1,
@@ -4092,7 +4131,7 @@
},
{
"file": "src/pixi/renderers/canvas/CanvasRenderer.js",
- "line": 45,
+ "line": 71,
"description": "The width of the canvas view",
"itemtype": "property",
"name": "width",
@@ -4102,7 +4141,7 @@
},
{
"file": "src/pixi/renderers/canvas/CanvasRenderer.js",
- "line": 54,
+ "line": 80,
"description": "The height of the canvas view",
"itemtype": "property",
"name": "height",
@@ -4112,7 +4151,7 @@
},
{
"file": "src/pixi/renderers/canvas/CanvasRenderer.js",
- "line": 63,
+ "line": 89,
"description": "The canvas element that the everything is drawn to",
"itemtype": "property",
"name": "view",
@@ -4121,7 +4160,7 @@
},
{
"file": "src/pixi/renderers/canvas/CanvasRenderer.js",
- "line": 71,
+ "line": 97,
"description": "The canvas context that the everything is drawn to",
"itemtype": "property",
"name": "context",
@@ -4130,7 +4169,7 @@
},
{
"file": "src/pixi/renderers/canvas/CanvasRenderer.js",
- "line": 111,
+ "line": 134,
"description": "Renders the stage to its canvas view",
"itemtype": "method",
"name": "render",
@@ -4145,7 +4184,7 @@
},
{
"file": "src/pixi/renderers/canvas/CanvasRenderer.js",
- "line": 156,
+ "line": 192,
"description": "resizes the canvas view to the specified width and height",
"itemtype": "method",
"name": "resize",
@@ -4165,7 +4204,7 @@
},
{
"file": "src/pixi/renderers/canvas/CanvasRenderer.js",
- "line": 172,
+ "line": 208,
"description": "Renders a display object",
"itemtype": "method",
"name": "renderDisplayObject",
@@ -4182,7 +4221,7 @@
},
{
"file": "src/pixi/renderers/canvas/CanvasRenderer.js",
- "line": 189,
+ "line": 225,
"description": "Renders a flat strip",
"itemtype": "method",
"name": "renderStripFlat",
@@ -4199,7 +4238,7 @@
},
{
"file": "src/pixi/renderers/canvas/CanvasRenderer.js",
- "line": 223,
+ "line": 259,
"description": "Renders a strip",
"itemtype": "method",
"name": "renderStrip",
@@ -4214,6 +4253,43 @@
"tagname": "",
"class": "CanvasRenderer"
},
+ {
+ "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js",
+ "line": 1,
+ "author": "Richard Davey http://www.photonstorm.com @photonstorm",
+ "class": "PIXI.PixiFastShader"
+ },
+ {
+ "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js",
+ "line": 14,
+ "itemtype": "property",
+ "name": "program - The WebGL program.",
+ "type": "Any",
+ "class": "PIXI.PixiFastShader"
+ },
+ {
+ "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js",
+ "line": 19,
+ "itemtype": "property",
+ "name": "fragmentSrc - The fragment shader.",
+ "type": "Array",
+ "class": "PIXI.PixiFastShader"
+ },
+ {
+ "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js",
+ "line": 63,
+ "itemtype": "property",
+ "name": "textureCount - A local texture counter for multi-texture shaders.",
+ "type": "Number",
+ "class": "PIXI.PixiFastShader"
+ },
+ {
+ "file": "src/pixi/renderers/webgl/shaders/PixiFastShader.js",
+ "line": 72,
+ "itemtype": "method",
+ "name": "PIXI.PixiFastShader#init",
+ "class": "PIXI.PixiFastShader"
+ },
{
"file": "src/pixi/renderers/webgl/shaders/PixiShader.js",
"line": 1,
@@ -4246,14 +4322,14 @@
},
{
"file": "src/pixi/renderers/webgl/shaders/PixiShader.js",
- "line": 42,
+ "line": 43,
"itemtype": "method",
"name": "PIXI.PixiShader#init",
"class": "PIXI.PixiShader"
},
{
"file": "src/pixi/renderers/webgl/shaders/PixiShader.js",
- "line": 91,
+ "line": 94,
"description": "Initialises the shader uniform values.\nUniforms are specified in the GLSL_ES Specification: http://www.khronos.org/registry/webgl/specs/latest/1.0/\nhttp://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf",
"itemtype": "method",
"name": "PIXI.PixiShader#initUniforms",
@@ -4261,15 +4337,15 @@
},
{
"file": "src/pixi/renderers/webgl/shaders/PixiShader.js",
- "line": 164,
- "description": "Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture is has loaded)",
+ "line": 167,
+ "description": "Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)",
"itemtype": "method",
"name": "PIXI.PixiShader#initSampler2D",
"class": "PIXI.PixiShader"
},
{
"file": "src/pixi/renderers/webgl/shaders/PixiShader.js",
- "line": 239,
+ "line": 242,
"description": "Updates the shader uniform values.",
"itemtype": "method",
"name": "PIXI.PixiShader#syncUniforms",
@@ -4287,6 +4363,12 @@
"author": "Mat Groves http://matgroves.com/ @Doormat23",
"class": "CanvasGraphics"
},
+ {
+ "file": "src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js",
+ "line": 1,
+ "author": "Mat Groves\n\nBig thanks to the very clever Matt DesLauriers
https://github.com/mattdesl/\nfor creating the original pixi version!\n\nHeavily inspired by LibGDX's WebGLSpriteBatch:\nhttps://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java",
+ "class": "CanvasGraphics"
+ },
{
"file": "src/pixi/renderers/webgl/utils/WebGLFilterManager.js",
"line": 1,
@@ -4365,7 +4447,7 @@
},
{
"file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js",
- "line": 206,
+ "line": 211,
"description": "Builds a circle to draw",
"static": 1,
"access": "private",
@@ -4388,7 +4470,7 @@
},
{
"file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js",
- "line": 275,
+ "line": 284,
"description": "Builds a line to draw",
"static": 1,
"access": "private",
@@ -4411,7 +4493,7 @@
},
{
"file": "src/pixi/renderers/webgl/utils/WebGLGraphics.js",
- "line": 485,
+ "line": 494,
"description": "Builds a polygon to draw",
"static": 1,
"access": "private",
@@ -4464,7 +4546,7 @@
},
{
"file": "src/pixi/renderers/webgl/WebGLRenderer.js",
- "line": 126,
+ "line": 134,
"description": "Renders the stage to its webGL view",
"itemtype": "method",
"name": "render",
@@ -4479,7 +4561,7 @@
},
{
"file": "src/pixi/renderers/webgl/WebGLRenderer.js",
- "line": 223,
+ "line": 240,
"description": "Updates the textures loaded into this webgl renderer",
"static": 1,
"itemtype": "method",
@@ -4490,25 +4572,7 @@
},
{
"file": "src/pixi/renderers/webgl/WebGLRenderer.js",
- "line": 250,
- "description": "Updates a loaded webgl texture",
- "static": 1,
- "itemtype": "method",
- "name": "updateTexture",
- "params": [
- {
- "name": "texture",
- "description": "The texture to update",
- "type": "Texture"
- }
- ],
- "access": "private",
- "tagname": "",
- "class": "WebGLRenderer"
- },
- {
- "file": "src/pixi/renderers/webgl/WebGLRenderer.js",
- "line": 297,
+ "line": 267,
"description": "Destroys a loaded webgl texture",
"itemtype": "method",
"name": "destroyTexture",
@@ -4525,7 +4589,7 @@
},
{
"file": "src/pixi/renderers/webgl/WebGLRenderer.js",
- "line": 325,
+ "line": 301,
"description": "resizes the webGL view to the specified width and height",
"itemtype": "method",
"name": "resize",
@@ -4545,7 +4609,7 @@
},
{
"file": "src/pixi/renderers/webgl/WebGLRenderer.js",
- "line": 378,
+ "line": 385,
"description": "Handles a lost webgl context",
"itemtype": "method",
"name": "handleContextLost",
@@ -4562,7 +4626,7 @@
},
{
"file": "src/pixi/renderers/webgl/WebGLRenderer.js",
- "line": 391,
+ "line": 398,
"description": "Handles a restored webgl context",
"itemtype": "method",
"name": "handleContextRestored",
@@ -4617,7 +4681,7 @@
},
{
"name": "align",
- "description": "An alignment of the multiline text ('left', 'center' or 'right')",
+ "description": "Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text",
"type": "String",
"optional": true,
"optdefault": "'left'"
@@ -4640,7 +4704,7 @@
{
"file": "src/pixi/text/BitmapText.js",
"line": 141,
- "description": "Updates the transfor of this object",
+ "description": "Updates the transform of this object",
"itemtype": "method",
"name": "updateTransform",
"access": "private",
@@ -4675,7 +4739,7 @@
},
{
"name": "align",
- "description": "An alignment of the multiline text ('left', 'center' or 'right')",
+ "description": "Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text",
"type": "String",
"optional": true,
"optdefault": "'left'"
@@ -4735,7 +4799,7 @@
},
{
"file": "src/pixi/text/Text.js",
- "line": 77,
+ "line": 78,
"description": "Renders text",
"itemtype": "method",
"name": "updateText",
@@ -4745,7 +4809,7 @@
},
{
"file": "src/pixi/text/Text.js",
- "line": 148,
+ "line": 151,
"description": "Updates texture size based on canvas size",
"itemtype": "method",
"name": "updateTexture",
@@ -4755,8 +4819,8 @@
},
{
"file": "src/pixi/text/Text.js",
- "line": 167,
- "description": "Updates the transfor of this object",
+ "line": 181,
+ "description": "Updates the transform of this object",
"itemtype": "method",
"name": "updateTransform",
"access": "private",
@@ -4765,7 +4829,7 @@
},
{
"file": "src/pixi/text/Text.js",
- "line": 216,
+ "line": 230,
"description": "Applies newlines to a string to have it optimally fit into the horizontal\nbounds set by the Text object's wordWrapWidth property.",
"itemtype": "method",
"name": "wordWrap",
@@ -4782,7 +4846,7 @@
},
{
"file": "src/pixi/text/Text.js",
- "line": 260,
+ "line": 274,
"description": "Destroys this text object",
"itemtype": "method",
"name": "destroy",
@@ -4803,7 +4867,7 @@
},
{
"file": "src/pixi/textures/BaseTexture.js",
- "line": 21,
+ "line": 23,
"description": "[read-only] The width of the base texture set when the image has loaded",
"itemtype": "property",
"name": "width",
@@ -4813,7 +4877,7 @@
},
{
"file": "src/pixi/textures/BaseTexture.js",
- "line": 30,
+ "line": 32,
"description": "[read-only] The height of the base texture set when the image has loaded",
"itemtype": "property",
"name": "height",
@@ -4823,17 +4887,17 @@
},
{
"file": "src/pixi/textures/BaseTexture.js",
- "line": 39,
+ "line": 41,
"description": "The scale mode to apply when scaling this texture",
"itemtype": "property",
"name": "scaleMode",
- "type": "PIXI.BaseTexture.SCALE_MODE",
- "default": "PIXI.BaseTexture.SCALE_MODE.LINEAR",
+ "type": "PIXI.scaleModes",
+ "default": "PIXI.scaleModes.LINEAR",
"class": "BaseTexture"
},
{
"file": "src/pixi/textures/BaseTexture.js",
- "line": 47,
+ "line": 49,
"description": "[read-only] Describes if the base texture has loaded or not",
"itemtype": "property",
"name": "hasLoaded",
@@ -4843,7 +4907,7 @@
},
{
"file": "src/pixi/textures/BaseTexture.js",
- "line": 56,
+ "line": 58,
"description": "The source that is loaded to create the texture",
"itemtype": "property",
"name": "source",
@@ -4852,7 +4916,7 @@
},
{
"file": "src/pixi/textures/BaseTexture.js",
- "line": 113,
+ "line": 117,
"description": "Destroys this base texture",
"itemtype": "method",
"name": "destroy",
@@ -4860,15 +4924,15 @@
},
{
"file": "src/pixi/textures/BaseTexture.js",
- "line": 131,
+ "line": 135,
"itemtype": "method",
"name": "destroy",
"class": "BaseTexture"
},
{
"file": "src/pixi/textures/BaseTexture.js",
- "line": 144,
- "description": "Helper function that returns a base texture based on an image url\nIf the image is not in the base texture cache it will be created and loaded",
+ "line": 148,
+ "description": "Helper function that returns a base texture based on an image url\nIf the image is not in the base texture cache it will be created and loaded",
"static": 1,
"itemtype": "method",
"name": "fromImage",
@@ -4914,7 +4978,7 @@
},
{
"file": "src/pixi/textures/RenderTexture.js",
- "line": 154,
+ "line": 153,
"description": "This function will draw the display object to the texture.",
"itemtype": "method",
"name": "renderCanvas",
@@ -4942,7 +5006,7 @@
},
{
"file": "src/pixi/textures/Texture.js",
- "line": 31,
+ "line": 33,
"description": "The base texture of this texture",
"itemtype": "property",
"name": "baseTexture",
@@ -4951,7 +5015,7 @@
},
{
"file": "src/pixi/textures/Texture.js",
- "line": 39,
+ "line": 41,
"description": "The frame specifies the region of the base texture that this texture uses",
"itemtype": "property",
"name": "frame",
@@ -4960,7 +5024,7 @@
},
{
"file": "src/pixi/textures/Texture.js",
- "line": 47,
+ "line": 49,
"description": "The trim point",
"itemtype": "property",
"name": "trim",
@@ -4969,7 +5033,7 @@
},
{
"file": "src/pixi/textures/Texture.js",
- "line": 72,
+ "line": 74,
"description": "Called when the base texture is loaded",
"itemtype": "method",
"name": "onBaseTextureLoaded",
@@ -4985,7 +5049,7 @@
},
{
"file": "src/pixi/textures/Texture.js",
- "line": 91,
+ "line": 93,
"description": "Destroys this texture",
"itemtype": "method",
"name": "destroy",
@@ -5000,7 +5064,7 @@
},
{
"file": "src/pixi/textures/Texture.js",
- "line": 102,
+ "line": 104,
"description": "Specifies the rectangle region of the baseTexture",
"itemtype": "method",
"name": "setFrame",
@@ -5015,7 +5079,7 @@
},
{
"file": "src/pixi/textures/Texture.js",
- "line": 146,
+ "line": 150,
"description": "Helper function that returns a texture based on an image url\nIf the image is not in the texture cache it will be created and loaded",
"static": 1,
"itemtype": "method",
@@ -5039,7 +5103,7 @@
},
{
"file": "src/pixi/textures/Texture.js",
- "line": 169,
+ "line": 173,
"description": "Helper function that returns a texture based on a frame id\nIf the frame id is not in the texture cache an error will be thrown",
"static": 1,
"itemtype": "method",
@@ -5058,7 +5122,7 @@
},
{
"file": "src/pixi/textures/Texture.js",
- "line": 185,
+ "line": 189,
"description": "Helper function that returns a texture based on a canvas element\nIf the canvas is not in the texture cache it will be created and loaded",
"static": 1,
"itemtype": "method",
@@ -5077,7 +5141,7 @@
},
{
"file": "src/pixi/textures/Texture.js",
- "line": 201,
+ "line": 207,
"description": "Adds a texture to the textureCache.",
"static": 1,
"itemtype": "method",
@@ -5098,7 +5162,7 @@
},
{
"file": "src/pixi/textures/Texture.js",
- "line": 214,
+ "line": 220,
"description": "Remove a texture from the textureCache.",
"static": 1,
"itemtype": "method",
@@ -5125,7 +5189,7 @@
{
"file": "src/pixi/utils/Detector.js",
"line": 5,
- "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by\nthe browser then this function will return a canvas renderer",
+ "description": "This helper function will automatically detect which renderer you should be using.\nWebGL is the preferred renderer as it is a lot faster. If webGL is not supported by\nthe browser then this function will return a canvas renderer",
"itemtype": "method",
"name": "autoDetectRenderer",
"static": 1,
@@ -5227,7 +5291,7 @@
{
"file": "src/pixi/InteractionManager.js",
"line": 15,
- "description": "a refference to the stage",
+ "description": "a reference to the stage",
"itemtype": "property",
"name": "stage",
"type": "Stage",
@@ -5326,8 +5390,8 @@
},
{
"file": "src/pixi/InteractionManager.js",
- "line": 269,
- "description": "Is called when the mouse moves accross the renderer element",
+ "line": 277,
+ "description": "Is called when the mouse moves across the renderer element",
"itemtype": "method",
"name": "onMouseMove",
"params": [
@@ -5344,7 +5408,7 @@
},
{
"file": "src/pixi/InteractionManager.js",
- "line": 299,
+ "line": 307,
"description": "Is called when the mouse button is pressed down on the renderer element",
"itemtype": "method",
"name": "onMouseDown",
@@ -5362,7 +5426,7 @@
},
{
"file": "src/pixi/InteractionManager.js",
- "line": 360,
+ "line": 370,
"description": "Is called when the mouse button is released on the renderer element",
"itemtype": "method",
"name": "onMouseUp",
@@ -5380,7 +5444,7 @@
},
{
"file": "src/pixi/InteractionManager.js",
- "line": 409,
+ "line": 420,
"description": "Tests if the current mouse coords hit a sprite",
"itemtype": "method",
"name": "hitTest",
@@ -5392,7 +5456,7 @@
},
{
"name": "interactionData",
- "description": "The interactiondata object to update in the case of a hit",
+ "description": "The interactionData object to update in the case of a hit",
"type": "InteractionData"
}
],
@@ -5403,14 +5467,14 @@
},
{
"file": "src/pixi/InteractionManager.js",
- "line": 484,
- "description": "Is called when a touch is moved accross the renderer element",
+ "line": 495,
+ "description": "Is called when a touch is moved across the renderer element",
"itemtype": "method",
"name": "onTouchMove",
"params": [
{
"name": "event",
- "description": "The DOM event of a touch moving accross the renderer view",
+ "description": "The DOM event of a touch moving across the renderer view",
"type": "Event"
}
],
@@ -5421,7 +5485,7 @@
},
{
"file": "src/pixi/InteractionManager.js",
- "line": 518,
+ "line": 533,
"description": "Is called when a touch is started on the renderer element",
"itemtype": "method",
"name": "onTouchStart",
@@ -5439,7 +5503,7 @@
},
{
"file": "src/pixi/InteractionManager.js",
- "line": 567,
+ "line": 588,
"description": "Is called when a touch is ended on the renderer element",
"itemtype": "method",
"name": "onTouchEnd",
@@ -5457,7 +5521,7 @@
},
{
"file": "src/pixi/InteractionManager.js",
- "line": 648,
+ "line": 673,
"description": "This point stores the global coords of where the touch/mouse event happened",
"itemtype": "property",
"name": "global",
@@ -5467,7 +5531,7 @@
},
{
"file": "src/pixi/InteractionManager.js",
- "line": 659,
+ "line": 684,
"description": "The target Sprite that was interacted with",
"itemtype": "property",
"name": "target",
@@ -5477,7 +5541,7 @@
},
{
"file": "src/pixi/InteractionManager.js",
- "line": 667,
+ "line": 692,
"description": "When passed to an event handler, this will be the original DOM Event that was captured",
"itemtype": "property",
"name": "originalEvent",
@@ -5487,7 +5551,7 @@
},
{
"file": "src/pixi/InteractionManager.js",
- "line": 676,
+ "line": 701,
"description": "This will return the local coords of the specified displayObject for this InteractionData",
"itemtype": "method",
"name": "getLocalPosition",
@@ -5596,10 +5660,6 @@
"message": "Missing item type",
"line": " src/pixi/display/DisplayObject.js:1"
},
- {
- "message": "Missing item type",
- "line": " src/pixi/display/DisplayObject.js:180"
- },
{
"message": "Missing item type",
"line": " src/pixi/display/DisplayObjectContainer.js:1"
@@ -5608,10 +5668,6 @@
"message": "Missing item type",
"line": " src/pixi/display/MovieClip.js:1"
},
- {
- "message": "Missing item type",
- "line": " src/pixi/display/Sprite.js:1"
- },
{
"message": "Missing item type",
"line": " src/pixi/display/Stage.js:1"
@@ -5868,6 +5924,10 @@
"message": "Missing item type",
"line": " src/pixi/renderers/canvas/CanvasRenderer.js:1"
},
+ {
+ "message": "Missing item type",
+ "line": " src/pixi/renderers/webgl/shaders/PixiFastShader.js:1"
+ },
{
"message": "Missing item type",
"line": " src/pixi/renderers/webgl/shaders/PixiShader.js:1"
@@ -5880,6 +5940,10 @@
"message": "Missing item type",
"line": " src/pixi/renderers/webgl/shaders/StripShader.js:1"
},
+ {
+ "message": "Missing item type",
+ "line": " src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js:1"
+ },
{
"message": "Missing item type",
"line": " src/pixi/renderers/webgl/utils/WebGLFilterManager.js:1"
diff --git a/docs/files/src_pixi_InteractionManager.js.html b/docs/files/src_pixi_InteractionManager.js.html
index 17bebb9..95ec7ad 100644
--- a/docs/files/src_pixi_InteractionManager.js.html
+++ b/docs/files/src_pixi_InteractionManager.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -189,7 +195,7 @@
PIXI.InteractionManager = function(stage)
{
/**
- * a refference to the stage
+ * a reference to the stage
*
* @property stage
* @type Stage
@@ -366,7 +372,7 @@ PIXI.InteractionManager.prototype.update = function()
// frequency of 30fps??
var now = Date.now();
var diff = now - this.last;
- diff = (diff * 30) / 1000;
+ diff = (diff * PIXI.INTERACTION_FREQUENCY ) / 1000;
if(diff < 1)return;
this.last = now;
//
@@ -375,7 +381,7 @@ PIXI.InteractionManager.prototype.update = function()
// ok.. so mouse events??
// yes for now :)
- // OPTIMSE - how often to check??
+ // OPTIMISE - how often to check??
if(this.dirty)
{
this.dirty = false;
@@ -398,6 +404,8 @@ PIXI.InteractionManager.prototype.update = function()
this.interactionDOMElement.style.cursor = 'inherit';
+ var over = false;
+
for (i = 0; i < length; i++)
{
var item = this.interactiveItems[i];
@@ -408,42 +416,48 @@ PIXI.InteractionManager.prototype.update = function()
// OPTIMISATION - only calculate every time if the mousemove function exists..
// OK so.. does the object have any other interactive functions?
// hit-test the clip!
-
-
- if(item.mouseover || item.mouseout || item.buttonMode)
+ // if(item.mouseover || item.mouseout || item.buttonMode)
+ // {
+ // ok so there are some functions so lets hit test it..
+ item.__hit = this.hitTest(item, this.mouse);
+ this.mouse.target = item;
+ // ok so deal with interactions..
+ // looks like there was a hit!
+ if(item.__hit && !over)
{
- // ok so there are some functions so lets hit test it..
- item.__hit = this.hitTest(item, this.mouse);
- this.mouse.target = item;
- // ok so deal with interactions..
- // loks like there was a hit!
- if(item.__hit)
+ if(item.buttonMode) this.interactionDOMElement.style.cursor = item.defaultCursor;
+
+ if(!item.interactiveChildren)over = true;
+
+ if(!item.__isOver)
{
- if(item.buttonMode) this.interactionDOMElement.style.cursor = item.defaultCursor;
- if(!item.__isOver)
- {
+ if(item.mouseover)item.mouseover(this.mouse);
+ item.__isOver = true;
+
+ // just the one!
+ //break;
+
- if(item.mouseover)item.mouseover(this.mouse);
- item.__isOver = true;
- }
}
- else
+ //break;
+ }
+ else
+ {
+ if(item.__isOver)
{
- if(item.__isOver)
- {
- // roll out!
- if(item.mouseout)item.mouseout(this.mouse);
- item.__isOver = false;
- }
+ // roll out!
+ if(item.mouseout)item.mouseout(this.mouse);
+ item.__isOver = false;
}
}
+ // }
// --->
}
};
/**
- * Is called when the mouse moves accross the renderer element
+ * Is called when the mouse moves across the renderer element
*
* @method onMouseMove
* @param event {Event} The DOM event of the mouse moving
@@ -483,7 +497,9 @@ PIXI.InteractionManager.prototype.onMouseDown = function(event)
{
this.mouse.originalEvent = event || window.event; //IE uses window.event
- // loop through inteaction tree...
+ if(PIXI.AUTO_PREVENT_DEFULT)this.mouse.originalEvent.preventDefault();
+
+ // loop through interaction tree...
// hit test each item! ->
// get interactive items under point??
//stage.__i
@@ -542,6 +558,7 @@ PIXI.InteractionManager.prototype.onMouseOut = function()
*/
PIXI.InteractionManager.prototype.onMouseUp = function(event)
{
+
this.mouse.originalEvent = event || window.event; //IE uses window.event
var length = this.interactiveItems.length;
@@ -551,34 +568,34 @@ PIXI.InteractionManager.prototype.onMouseUp = function(event)
{
var item = this.interactiveItems[i];
- if(item.mouseup || item.mouseupoutside || item.click)
+ //if(item.mouseup || item.mouseupoutside || item.click)
+ //{
+ item.__hit = this.hitTest(item, this.mouse);
+
+ if(item.__hit && !up)
{
- item.__hit = this.hitTest(item, this.mouse);
-
- if(item.__hit && !up)
+ //call the function!
+ if(item.mouseup)
{
- //call the function!
- if(item.mouseup)
- {
- item.mouseup(this.mouse);
- }
- if(item.__isDown)
- {
- if(item.click)item.click(this.mouse);
- }
-
- if(!item.interactiveChildren)up = true;
+ item.mouseup(this.mouse);
}
- else
+ if(item.__isDown)
{
- if(item.__isDown)
- {
- if(item.mouseupoutside)item.mouseupoutside(this.mouse);
- }
+ if(item.click)item.click(this.mouse);
}
- item.__isDown = false;
+ if(!item.interactiveChildren)up = true;
}
+ else
+ {
+ if(item.__isDown)
+ {
+ if(item.mouseupoutside)item.mouseupoutside(this.mouse);
+ }
+ }
+
+ item.__isDown = false;
+ //}
}
};
@@ -587,7 +604,7 @@ PIXI.InteractionManager.prototype.onMouseUp = function(event)
*
* @method hitTest
* @param item {DisplayObject} The displayObject to test for a hit
- * @param interactionData {InteractionData} The interactiondata object to update in the case of a hit
+ * @param interactionData {InteractionData} The interactionData object to update in the case of a hit
* @private
*/
PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
@@ -658,10 +675,10 @@ PIXI.InteractionManager.prototype.hitTest = function(item, interactionData)
};
/**
- * Is called when a touch is moved accross the renderer element
+ * Is called when a touch is moved across the renderer element
*
* @method onTouchMove
- * @param event {Event} The DOM event of a touch moving accross the renderer view
+ * @param event {Event} The DOM event of a touch moving across the renderer view
* @private
*/
PIXI.InteractionManager.prototype.onTouchMove = function(event)
@@ -680,6 +697,10 @@ PIXI.InteractionManager.prototype.onTouchMove = function(event)
// update the touch position
touchData.global.x = (touchEvent.clientX - rect.left) * (this.target.width / rect.width);
touchData.global.y = (touchEvent.clientY - rect.top) * (this.target.height / rect.height);
+ if(navigator.isCocoonJS) {
+ touchData.global.x = touchEvent.clientX;
+ touchData.global.y = touchEvent.clientY;
+ }
}
var length = this.interactiveItems.length;
@@ -702,6 +723,8 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
{
var rect = this.interactionDOMElement.getBoundingClientRect();
+ if(PIXI.AUTO_PREVENT_DEFULT)event.preventDefault();
+
var changedTouches = event.changedTouches;
for (var i=0; i < changedTouches.length; i++)
{
@@ -715,6 +738,10 @@ PIXI.InteractionManager.prototype.onTouchStart = function(event)
this.touchs[touchEvent.identifier] = touchData;
touchData.global.x = (touchEvent.clientX - rect.left) * (this.target.width / rect.width);
touchData.global.y = (touchEvent.clientY - rect.top) * (this.target.height / rect.height);
+ if(navigator.isCocoonJS) {
+ touchData.global.x = touchEvent.clientX;
+ touchData.global.y = touchEvent.clientY;
+ }
var length = this.interactiveItems.length;
@@ -760,6 +787,10 @@ PIXI.InteractionManager.prototype.onTouchEnd = function(event)
var up = false;
touchData.global.x = (touchEvent.clientX - rect.left) * (this.target.width / rect.width);
touchData.global.y = (touchEvent.clientY - rect.top) * (this.target.height / rect.height);
+ if(navigator.isCocoonJS) {
+ touchData.global.x = touchEvent.clientX;
+ touchData.global.y = touchEvent.clientY;
+ }
var length = this.interactiveItems.length;
for (var j = 0; j < length; j++)
diff --git a/docs/files/src_pixi_Intro.js.html b/docs/files/src_pixi_Intro.js.html
index 6282641..0183481 100644
--- a/docs/files/src_pixi_Intro.js.html
+++ b/docs/files/src_pixi_Intro.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_Outro.js.html b/docs/files/src_pixi_Outro.js.html
index 9edb6cc..d074425 100644
--- a/docs/files/src_pixi_Outro.js.html
+++ b/docs/files/src_pixi_Outro.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_Pixi.js.html b/docs/files/src_pixi_Pixi.js.html
index 99da429..d577110 100644
--- a/docs/files/src_pixi_Pixi.js.html
+++ b/docs/files/src_pixi_Pixi.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -186,6 +192,40 @@ var PIXI = PIXI || {};
PIXI.WEBGL_RENDERER = 0;
PIXI.CANVAS_RENDERER = 1;
+// useful for testing against if your lib is using pixi.
+PIXI.VERSION = "v1.4.4";
+
+// the various blend modes supported by pixi
+PIXI.blendModes = {
+ NORMAL:0,
+ ADD:1,
+ MULTIPLY:2,
+ SCREEN:3,
+ OVERLAY:4,
+ DARKEN:5,
+ LIGHTEN:6,
+ COLOR_DODGE:7,
+ COLOR_BURN:8,
+ HARD_LIGHT:9,
+ SOFT_LIGHT:10,
+ DIFFERENCE:11,
+ EXCLUSION:12,
+ HUE:13,
+ SATURATION:14,
+ COLOR:15,
+ LUMINOSITY:16
+};
+
+// the scale modes
+PIXI.scaleModes = {
+ DEFAULT:0,
+ LINEAR:0,
+ NEAREST:1
+};
+
+// interaction frequancy
+PIXI.INTERACTION_FREQUENCY = 30;
+PIXI.AUTO_PREVENT_DEFULT = true;
diff --git a/docs/files/src_pixi_core_Circle.js.html b/docs/files/src_pixi_core_Circle.js.html
index 8308d16..bd97baf 100644
--- a/docs/files/src_pixi_core_Circle.js.html
+++ b/docs/files/src_pixi_core_Circle.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -179,7 +185,7 @@
*/
/**
- * The Circle object can be used to specify a hit area for displayobjects
+ * The Circle object can be used to specify a hit area for displayObjects
*
* @class Circle
* @constructor
diff --git a/docs/files/src_pixi_core_Ellipse.js.html b/docs/files/src_pixi_core_Ellipse.js.html
index 8422ca2..4d48493 100644
--- a/docs/files/src_pixi_core_Ellipse.js.html
+++ b/docs/files/src_pixi_core_Ellipse.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -179,7 +185,7 @@
*/
/**
- * The Ellipse object can be used to specify a hit area for displayobjects
+ * The Ellipse object can be used to specify a hit area for displayObjects
*
* @class Ellipse
* @constructor
@@ -231,7 +237,7 @@ PIXI.Ellipse.prototype.clone = function()
};
/**
- * Checks if the x, and y coords passed to this function are contained within this ellipse
+ * Checks if the x and y coords passed to this function are contained within this ellipse
*
* @method contains
* @param x {Number} The X coord of the point to test
diff --git a/docs/files/src_pixi_core_Point.js.html b/docs/files/src_pixi_core_Point.js.html
index 5efce98..4ccc094 100644
--- a/docs/files/src_pixi_core_Point.js.html
+++ b/docs/files/src_pixi_core_Point.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -217,6 +223,12 @@ PIXI.Point.prototype.clone = function()
// constructor
PIXI.Point.prototype.constructor = PIXI.Point;
+PIXI.Point.prototype.set = function(x, y)
+{
+ this.x = x || 0;
+ this.y = y || ( (y !== 0) ? this.x : 0 ) ;
+};
+
diff --git a/docs/files/src_pixi_core_Polygon.js.html b/docs/files/src_pixi_core_Polygon.js.html
index cbccb9c..bcbca62 100644
--- a/docs/files/src_pixi_core_Polygon.js.html
+++ b/docs/files/src_pixi_core_Polygon.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -225,7 +231,7 @@ PIXI.Polygon.prototype.clone = function()
};
/**
- * Checks if the x, and y coords passed to this function are contained within this polygon
+ * Checks if the x and y coords passed to this function are contained within this polygon
*
* @method contains
* @param x {Number} The X coord of the point to test
diff --git a/docs/files/src_pixi_core_Rectangle.js.html b/docs/files/src_pixi_core_Rectangle.js.html
index 3c1e837..5f0137a 100644
--- a/docs/files/src_pixi_core_Rectangle.js.html
+++ b/docs/files/src_pixi_core_Rectangle.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -231,7 +237,7 @@ PIXI.Rectangle.prototype.clone = function()
};
/**
- * Checks if the x, and y coords passed to this function are contained within this Rectangle
+ * Checks if the x and y coords passed to this function are contained within this Rectangle
*
* @method contains
* @param x {Number} The X coord of the point to test
diff --git a/docs/files/src_pixi_display_DisplayObject.js.html b/docs/files/src_pixi_display_DisplayObject.js.html
index 4bacb35..9ca98e6 100644
--- a/docs/files/src_pixi_display_DisplayObject.js.html
+++ b/docs/files/src_pixi_display_DisplayObject.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -280,7 +286,7 @@ PIXI.DisplayObject = function()
this.stage = null;
/**
- * [read-only] The multiplied alpha of the displayobject
+ * [read-only] The multiplied alpha of the displayObject
*
* @property worldAlpha
* @type Number
@@ -299,7 +305,7 @@ PIXI.DisplayObject = function()
this._interactive = false;
/**
- * This is the curser that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
+ * This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true
*
* @property defaultCursor
* @type String
@@ -328,7 +334,7 @@ PIXI.DisplayObject = function()
this.localTransform = PIXI.mat3.create(); //mat3.identity();
/**
- * [NYI] Unkown
+ * [NYI] Unknown
*
* @property color
* @type Array<>
@@ -345,7 +351,7 @@ PIXI.DisplayObject = function()
*/
this.dynamic = true;
- // chach that puppy!
+ // cached sin rotation and cos rotation
this._sr = 0;
this._cr = 1;
@@ -353,11 +359,6 @@ PIXI.DisplayObject = function()
this.filterArea = new PIXI.Rectangle(0,0,1,1);
- /**
- *
- *
- *
- */
this._bounds = new PIXI.Rectangle(0, 0, 1, 1);
this._currentBounds = null;
this._mask = null;
@@ -417,7 +418,7 @@ PIXI.DisplayObject = function()
*/
/**
- * A callback that is used when the user touch's over the displayObject
+ * A callback that is used when the user touches over the displayObject
* @method touchstart
* @param interactionData {InteractionData}
*/
@@ -487,7 +488,7 @@ Object.defineProperty(PIXI.DisplayObject.prototype, 'worldVisible', {
if(!item.visible)return false;
item = item.parent;
}
- while(item && item.parent);
+ while(item);
return true;
}
@@ -495,7 +496,7 @@ Object.defineProperty(PIXI.DisplayObject.prototype, 'worldVisible', {
/**
* Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it.
- * In PIXI a regular mask must be a PIXI.Ggraphics object. This allows for much faster masking in canvas as it utilises shape clipping.
+ * In PIXI a regular mask must be a PIXI.Graphics object. This allows for much faster masking in canvas as it utilises shape clipping.
* To remove a mask, set this property to null.
*
* @property mask
@@ -598,8 +599,6 @@ PIXI.DisplayObject.prototype.updateTransform = function()
// because we are using affine transformation, we can optimise the matrix concatenation process.. wooo!
// mat3.multiply(this.localTransform, this.parent.worldTransform, this.worldTransform);
this.worldAlpha = this.alpha * this.parent.worldAlpha;
-
- this.vcount = PIXI.visibleCount;
};
PIXI.DisplayObject.prototype.getBounds = function()
@@ -622,6 +621,11 @@ PIXI.DisplayObject.prototype.getLocalBounds = function()
return bounds;
};
+PIXI.DisplayObject.prototype.setStageReference = function(stage)
+{
+ this.stage = stage;
+ if(this._interactive)this.stage.dirty = true;
+};
PIXI.DisplayObject.prototype._renderWebGL = function(renderSession)
{
@@ -639,7 +643,6 @@ PIXI.DisplayObject.prototype._renderCanvas = function(renderSession)
PIXI.EmptyRectangle = new PIXI.Rectangle(0,0,0,0);
-PIXI.visibleCount = 0;
diff --git a/docs/files/src_pixi_display_DisplayObjectContainer.js.html b/docs/files/src_pixi_display_DisplayObjectContainer.js.html
index 8045f24..3578ff1 100644
--- a/docs/files/src_pixi_display_DisplayObjectContainer.js.html
+++ b/docs/files/src_pixi_display_DisplayObjectContainer.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -206,7 +212,7 @@ PIXI.DisplayObjectContainer.prototype = Object.create( PIXI.DisplayObject.protot
PIXI.DisplayObjectContainer.prototype.constructor = PIXI.DisplayObjectContainer;
/**
- * The width of the displayObjectContainer, setting this will actually modify the scale to acheive the value set
+ * The width of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
*
* @property width
* @type Number
@@ -225,7 +231,7 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'width',
*/
/**
- * The height of the displayObjectContainer, setting this will actually modify the scale to acheive the value set
+ * The height of the displayObjectContainer, setting this will actually modify the scale to achieve the value set
*
* @property height
* @type Number
@@ -251,21 +257,7 @@ Object.defineProperty(PIXI.DisplayObjectContainer.prototype, 'height',
*/
PIXI.DisplayObjectContainer.prototype.addChild = function(child)
{
- if(child.parent && child.parent !== this)
- {
- //// COULD BE THIS???
- child.parent.removeChild(child);
- // return;
- }
-
- child.parent = this;
-
- this.children.push(child);
-
- // update the stage refference..
-
- if(this.stage)this.setStageReference(this.stage);
-
+ this.addChildAt(child, this.children.length);
};
/**
@@ -288,7 +280,7 @@ PIXI.DisplayObjectContainer.prototype.addChildAt = function(child, index)
this.children.splice(index, 0, child);
- if(this.stage)this.setStageReference(this.stage);
+ if(this.stage)child.setStageReference(this.stage);
}
else
{
@@ -323,7 +315,7 @@ PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2)
};
/**
- * Returns the Child at the specified index
+ * Returns the child at the specified index
*
* @method getChildAt
* @param index {Number} The index to get the child from
@@ -352,7 +344,7 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
if ( index !== -1 )
{
// update the stage reference..
- if(this.stage)this.removeStageReference();
+ if(this.stage)child.removeStageReference();
child.parent = undefined;
this.children.splice( index, 1 );
@@ -364,7 +356,7 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child)
};
/*
- * Updates the container's children's transform for rendering
+ * Updates the container's childrens transform for rendering
*
* @method updateTransform
* @private
@@ -425,7 +417,7 @@ PIXI.DisplayObjectContainer.prototype.getBounds = function()
bounds.width = maxX - minX;
bounds.height = maxY - minY;
- // TODO: store a refferance so that if this function gets called again in the render cycle we do not have to recacalculate
+ // TODO: store a reference so that if this function gets called again in the render cycle we do not have to recalculate
//this._currentBounds = bounds;
return bounds;
@@ -434,30 +426,33 @@ PIXI.DisplayObjectContainer.prototype.getBounds = function()
PIXI.DisplayObjectContainer.prototype.setStageReference = function(stage)
{
this.stage = stage;
+ if(this._interactive)this.stage.dirty = true;
for(var i=0,j=this.children.length; i<j; i++)
{
var child = this.children[i];
- if(child.interactive)this.stage.dirty = true;
child.setStageReference(stage);
}
};
PIXI.DisplayObjectContainer.prototype.removeStageReference = function()
{
+
for(var i=0,j=this.children.length; i<j; i++)
{
var child = this.children[i];
child.removeStageReference();
}
+ if(this._interactive)this.stage.dirty = true;
+
this.stage = null;
};
PIXI.DisplayObjectContainer.prototype._renderWebGL = function(renderSession)
{
- if(this.visible === false || this.alpha === 0)return;
-
+ if(!this.visible || this.alpha <= 0)return;
+
var i,j;
if(this._mask || this._filters)
diff --git a/docs/files/src_pixi_display_MovieClip.js.html b/docs/files/src_pixi_display_MovieClip.js.html
index dfa3e8f..6dee340 100644
--- a/docs/files/src_pixi_display_MovieClip.js.html
+++ b/docs/files/src_pixi_display_MovieClip.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -225,7 +231,7 @@ PIXI.MovieClip = function(textures)
this.onComplete = null;
/**
- * [read-only] The index MovieClips current frame (this may not have to be a whole number)
+ * [read-only] The MovieClips current frame index (this may not have to be a whole number)
*
* @property currentFrame
* @type Number
diff --git a/docs/files/src_pixi_display_Sprite.js.html b/docs/files/src_pixi_display_Sprite.js.html
index 7922bf8..428ea32 100644
--- a/docs/files/src_pixi_display_Sprite.js.html
+++ b/docs/files/src_pixi_display_Sprite.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -174,20 +180,12 @@
-/**
- * @author Mat Groves http://matgroves.com/ @Doormat23
- */
-PIXI.blendModes = {};
-PIXI.blendModes.NORMAL = 0;
-PIXI.blendModes.ADD = 1;
-PIXI.blendModes.MULTIPLY = 2;
-PIXI.blendModes.SCREEN = 3;
/**
- * The SPrite object is the base for all textured objects that are rendered to the screen
+ * The Sprite object is the base for all textured objects that are rendered to the screen
*
- * @class Sprite™
+ * @class Sprite
* @extends DisplayObjectContainer
* @constructor
* @param texture {Texture} The texture for this sprite
@@ -271,7 +269,7 @@ PIXI.Sprite.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
PIXI.Sprite.prototype.constructor = PIXI.Sprite;
/**
- * The width of the sprite, setting this will actually modify the scale to acheive the value set
+ * The width of the sprite, setting this will actually modify the scale to achieve the value set
*
* @property width
* @type Number
@@ -287,7 +285,7 @@ Object.defineProperty(PIXI.Sprite.prototype, 'width', {
});
/**
- * The height of the sprite, setting this will actually modify the scale to acheive the value set
+ * The height of the sprite, setting this will actually modify the scale to achieve the value set
*
* @property height
* @type Number
@@ -409,7 +407,7 @@ PIXI.Sprite.prototype.getBounds = function()
bounds.y = minY;
bounds.height = maxY - minY;
- // store a refferance so that if this function gets called again in the render cycle we do not have to recacalculate
+ // store a reference so that if this function gets called again in the render cycle we do not have to recalculate
this._currentBounds = bounds;
return bounds;
@@ -419,7 +417,7 @@ PIXI.Sprite.prototype.getBounds = function()
PIXI.Sprite.prototype._renderWebGL = function(renderSession)
{
// if the sprite is not visible or the alpha is 0 then no need to render this element
- if(this.visible === false || this.alpha === 0)return;
+ if(!this.visible || this.alpha <= 0)return;
var i,j;
@@ -478,14 +476,22 @@ PIXI.Sprite.prototype._renderCanvas = function(renderSession)
// if the sprite is not visible or the alpha is 0 then no need to render this element
if(this.visible === false || this.alpha === 0)return;
+ var frame = this.texture.frame;
+ var context = renderSession.context;
+ var texture = this.texture;
+
+ if(this.blendMode !== renderSession.currentBlendMode)
+ {
+ renderSession.currentBlendMode = this.blendMode;
+ context.globalCompositeOperation = PIXI.blendModesCanvas[renderSession.currentBlendMode];
+ }
+
if(this._mask)
{
renderSession.maskManager.pushMask(this._mask, renderSession.context);
}
- var frame = this.texture.frame;
- var context = renderSession.context;
- var texture = this.texture;
+
//ignore null sources
if(frame && frame.width && frame.height && texture.baseTexture.source)
@@ -494,27 +500,19 @@ PIXI.Sprite.prototype._renderCanvas = function(renderSession)
var transform = this.worldTransform;
- // alow for trimming
+ // allow for trimming
context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]);
-
- // check blend mode
- if(this.blendMode !== renderSession.currentBlendMode)
- {
- renderSession.currentBlendMode = this.blendMode;
- context.globalCompositeOperation = PIXI.blendModesCanvas[renderSession.currentBlendMode];
- }
-
//if smoothingEnabled is supported and we need to change the smoothing property for this texture
- // if(this.smoothProperty && this.scaleMode !== displayObject.texture.baseTexture.scaleMode) {
- // this.scaleMode = displayObject.texture.baseTexture.scaleMode;
- // context[this.smoothProperty] = (this.scaleMode === PIXI.BaseTexture.SCALE_MODE.LINEAR);
- //}
-
+ if(renderSession.smoothProperty && renderSession.scaleMode !== this.texture.baseTexture.scaleMode) {
+ renderSession.scaleMode = this.texture.baseTexture.scaleMode;
+ context[renderSession.smoothProperty] = (renderSession.scaleMode === PIXI.scaleModes.LINEAR);
+ }
if(this.tint !== 0xFFFFFF)
{
+
if(this.cachedTint !== this.tint)
{
// no point tinting an image that has not loaded yet!
@@ -522,7 +520,7 @@ PIXI.Sprite.prototype._renderCanvas = function(renderSession)
this.cachedTint = this.tint;
- //TODO clean up cacheing - how to clean up the caches?
+ //TODO clean up caching - how to clean up the caches?
this.tintedTexture = PIXI.CanvasTinter.getTintedTexture(this, this.tint);
}
diff --git a/docs/files/src_pixi_display_Stage.js.html b/docs/files/src_pixi_display_Stage.js.html
index cf8f266..862ab0a 100644
--- a/docs/files/src_pixi_display_Stage.js.html
+++ b/docs/files/src_pixi_display_Stage.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -226,17 +232,13 @@ PIXI.Stage = function(backgroundColor)
*/
this.dirty = true;
- this.__childrenAdded = [];
- this.__childrenRemoved = [];
-
- //the stage is it's own stage
+ //the stage is its own stage
this.stage = this;
//optimize hit detection a bit
this.stage.hitArea = new PIXI.Rectangle(0,0,100000, 100000);
this.setBackgroundColor(backgroundColor);
- this.worldVisible = true;
};
// constructor
@@ -245,7 +247,7 @@ PIXI.Stage.prototype.constructor = PIXI.Stage;
/**
* Sets another DOM element which can receive mouse/touch interactions instead of the default Canvas element.
- * This is useful for when you have other DOM elements ontop of the Canvas element.
+ * This is useful for when you have other DOM elements on top of the Canvas element.
*
* @method setInteractionDelegate
* @param domElement {DOMElement} This new domElement which will receive mouse/touch events
@@ -264,7 +266,6 @@ PIXI.Stage.prototype.setInteractionDelegate = function(domElement)
PIXI.Stage.prototype.updateTransform = function()
{
this.worldAlpha = 1;
- this.vcount = PIXI.visibleCount;
for(var i=0,j=this.children.length; i<j; i++)
{
diff --git a/docs/files/src_pixi_extras_Rope.js.html b/docs/files/src_pixi_extras_Rope.js.html
index 0399bd9..65271b1 100644
--- a/docs/files/src_pixi_extras_Rope.js.html
+++ b/docs/files/src_pixi_extras_Rope.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_extras_Spine.js.html b/docs/files/src_pixi_extras_Spine.js.html
index 585dcc6..d732ae0 100644
--- a/docs/files/src_pixi_extras_Spine.js.html
+++ b/docs/files/src_pixi_extras_Spine.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_extras_Strip.js.html b/docs/files/src_pixi_extras_Strip.js.html
index a617da9..9559900 100644
--- a/docs/files/src_pixi_extras_Strip.js.html
+++ b/docs/files/src_pixi_extras_Strip.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_extras_TilingSprite.js.html b/docs/files/src_pixi_extras_TilingSprite.js.html
index ca7f707..a6baba8 100644
--- a/docs/files/src_pixi_extras_TilingSprite.js.html
+++ b/docs/files/src_pixi_extras_TilingSprite.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -195,8 +201,6 @@ PIXI.TilingSprite = function(texture, width, height)
this.width = width || 100;
this.height = height || 100;
- texture.baseTexture._powerOf2 = true;
-
/**
* The scaling of the image that is being tiled
*
@@ -205,6 +209,9 @@ PIXI.TilingSprite = function(texture, width, height)
*/
this.tileScale = new PIXI.Point(1,1);
+
+ this.tileScaleOffset = new PIXI.Point(1,1);
+
/**
* The offset position of the image that is being tiled
*
@@ -225,7 +232,7 @@ PIXI.TilingSprite.prototype.constructor = PIXI.TilingSprite;
/**
- * The width of the sprite, setting this will actually modify the scale to acheive the value set
+ * The width of the sprite, setting this will actually modify the scale to achieve the value set
*
* @property width
* @type Number
@@ -241,7 +248,7 @@ Object.defineProperty(PIXI.TilingSprite.prototype, 'width', {
});
/**
- * The height of the TilingSprite, setting this will actually modify the scale to acheive the value set
+ * The height of the TilingSprite, setting this will actually modify the scale to achieve the value set
*
* @property height
* @type Number
@@ -258,9 +265,9 @@ Object.defineProperty(PIXI.TilingSprite.prototype, 'height', {
PIXI.TilingSprite.prototype.onTextureUpdate = function()
{
// so if _width is 0 then width was not set..
- //if(this._width)this.scale.x = this._width / this.texture.frame.width;
- //if(this._height)this.scale.y = this._height / this.texture.frame.height;
- // alert(this._width)
+ //console.log("HI MUM")
+
+
this.updateFrame = true;
};
@@ -276,7 +283,7 @@ PIXI.TilingSprite.prototype._renderWebGL = function(renderSession)
if(this.mask)
{
renderSession.spriteBatch.stop();
- renderSession.maskManager.pushMask(this.mask, renderSession.projection);
+ renderSession.maskManager.pushMask(this.mask, renderSession);
renderSession.spriteBatch.start();
}
@@ -286,8 +293,8 @@ PIXI.TilingSprite.prototype._renderWebGL = function(renderSession)
renderSession.filterManager.pushFilter(this._filterBlock);
}
-
- renderSession.spriteBatch.renderTilingSprite(this);
+ if(!this.tilingTexture)this.generateTilingTexture(true);
+ else renderSession.spriteBatch.renderTilingSprite(this);
// simple render children!
for(i=0,j=this.children.length; i<j; i++)
@@ -298,13 +305,14 @@ PIXI.TilingSprite.prototype._renderWebGL = function(renderSession)
renderSession.spriteBatch.stop();
if(this.filters)renderSession.filterManager.popFilter();
- if(this.mask)renderSession.maskManager.popMask(renderSession.projection);
+ if(this.mask)renderSession.maskManager.popMask(renderSession);
renderSession.spriteBatch.start();
}
else
{
- renderSession.spriteBatch.renderTilingSprite(this);
+ if(!this.tilingTexture)this.generateTilingTexture(true);
+ else renderSession.spriteBatch.renderTilingSprite(this);
// simple render children!
for(i=0,j=this.children.length; i<j; i++)
@@ -314,24 +322,38 @@ PIXI.TilingSprite.prototype._renderWebGL = function(renderSession)
}
};
+
PIXI.TilingSprite.prototype._renderCanvas = function(renderSession)
{
if(this.visible === false || this.alpha === 0)return;
var context = renderSession.context;
+ if(this._mask)
+ {
+ renderSession.maskManager.pushMask(this._mask, context);
+ }
+
context.globalAlpha = this.worldAlpha;
var transform = this.worldTransform;
- // alow for trimming
-
+ // allow for trimming
+
context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]);
-
+
if(!this.__tilePattern)
- this.__tilePattern = context.createPattern(this.texture.baseTexture.source, 'repeat');
+ {
+ this.generateTilingTexture(false);
+
+ if(this.tilingTexture)
+ {
+ this.__tilePattern = context.createPattern(this.tilingTexture.baseTexture.source, 'repeat');
+ }
+
+ }
// check blend mode
if(this.blendMode !== renderSession.currentBlendMode)
@@ -344,7 +366,7 @@ PIXI.TilingSprite.prototype._renderCanvas = function(renderSession)
var tilePosition = this.tilePosition;
var tileScale = this.tileScale;
-
+ // console.log(tileScale.x)
// offset
context.scale(tileScale.x,tileScale.y);
context.translate(tilePosition.x, tilePosition.y);
@@ -356,6 +378,11 @@ PIXI.TilingSprite.prototype._renderCanvas = function(renderSession)
context.translate(-tilePosition.x, -tilePosition.y);
context.closePath();
+
+ if(this._mask)
+ {
+ renderSession.maskManager.popMask(renderSession.context);
+ }
};
PIXI.TilingSprite.prototype.getBounds = function()
@@ -425,11 +452,73 @@ PIXI.TilingSprite.prototype.getBounds = function()
bounds.y = minY;
bounds.height = maxY - minY;
- // store a refferance so that if this function gets called again in the render cycle we do not have to recacalculate
+ // store a reference so that if this function gets called again in the render cycle we do not have to recalculate
this._currentBounds = bounds;
return bounds;
};
+
+
+PIXI.TilingSprite.prototype.generateTilingTexture = function(forcePowerOfTwo)
+{
+ var texture = this.texture;
+
+ if(!texture.baseTexture.hasLoaded)return;
+
+ var baseTexture = texture.baseTexture;
+ var frame = texture.frame;
+
+ var targetWidth, targetHeight;
+
+ // check that the frame is the same size as the base texture.
+
+ var isFrame = frame.width !== baseTexture.width || frame.height !== baseTexture.height;
+
+ this.tilingTexture = texture;
+
+ var newTextureRequired = false;
+
+ if(!forcePowerOfTwo)
+ {
+ if(isFrame)
+ {
+ targetWidth = frame.width;
+ targetHeight = frame.height;
+
+ newTextureRequired = true;
+ }
+ }
+ else
+ {
+ targetWidth = PIXI.getNextPowerOfTwo(texture.frame.width);
+ targetHeight = PIXI.getNextPowerOfTwo(texture.frame.height);
+
+ if(frame.width !== targetWidth && frame.height !== targetHeight)newTextureRequired = true;
+ }
+
+ if(newTextureRequired)
+ {
+ var canvasBuffer = new PIXI.CanvasBuffer(targetWidth, targetHeight);
+
+ canvasBuffer.context.drawImage(texture.baseTexture.source,
+ frame.x,
+ frame.y,
+ frame.width,
+ frame.height,
+ 0,
+ 0,
+ targetWidth,
+ targetHeight);
+
+ this.tilingTexture = PIXI.Texture.fromCanvas(canvasBuffer.canvas);
+
+ this.tileScaleOffset.x = frame.width / targetWidth;
+ this.tileScaleOffset.y = frame.height / targetHeight;
+ }
+
+
+ this.tilingTexture.baseTexture._powerOf2 = true;
+};
diff --git a/docs/files/src_pixi_filters_AbstractFilter.js.html b/docs/files/src_pixi_filters_AbstractFilter.js.html
index 53bebc4..ca6b433 100644
--- a/docs/files/src_pixi_filters_AbstractFilter.js.html
+++ b/docs/files/src_pixi_filters_AbstractFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -179,7 +185,7 @@
*/
/**
- * This is the base class for creating a pixi.js filter. Currently only webGL supports filters.
+ * This is the base class for creating a pixi.js filter. Currently only webGL supports filters.
* If you want to make a custom filter this should be your base class.
* @class AbstractFilter
* @constructor
diff --git a/docs/files/src_pixi_filters_AlphaMaskFilter.js.html b/docs/files/src_pixi_filters_AlphaMaskFilter.js.html
index d34a826..c6bfc9d 100644
--- a/docs/files/src_pixi_filters_AlphaMaskFilter.js.html
+++ b/docs/files/src_pixi_filters_AlphaMaskFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -197,17 +203,15 @@ PIXI.AlphaMaskFilter = function(texture)
// set the uniforms
//console.log()
this.uniforms = {
- displacementMap: {type: 'sampler2D', value:texture},
- scale: {type: '2f', value:{x:30, y:30}},
- offset: {type: '2f', value:{x:0, y:0}},
+ mask: {type: 'sampler2D', value:texture},
mapDimensions: {type: '2f', value:{x:1, y:5112}},
dimensions: {type: '4fv', value:[0,0,0,0]}
};
if(texture.baseTexture.hasLoaded)
{
- this.uniforms.mapDimensions.value.x = texture.width;
- this.uniforms.mapDimensions.value.y = texture.height;
+ this.uniforms.mask.value.x = texture.width;
+ this.uniforms.mask.value.y = texture.height;
}
else
{
@@ -220,30 +224,25 @@ PIXI.AlphaMaskFilter = function(texture)
'precision mediump float;',
'varying vec2 vTextureCoord;',
'varying vec4 vColor;',
- 'uniform sampler2D displacementMap;',
+ 'uniform sampler2D mask;',
'uniform sampler2D uSampler;',
- 'uniform vec2 scale;',
'uniform vec2 offset;',
'uniform vec4 dimensions;',
- 'uniform vec2 mapDimensions;',// = vec2(256.0, 256.0);',
- // 'const vec2 textureDimensions = vec2(750.0, 750.0);',
+ 'uniform vec2 mapDimensions;',
'void main(void) {',
' vec2 mapCords = vTextureCoord.xy;',
- //' mapCords -= ;',
' mapCords += (dimensions.zw + offset)/ dimensions.xy ;',
' mapCords.y *= -1.0;',
' mapCords.y += 1.0;',
- ' vec2 matSample = texture2D(displacementMap, mapCords).xy;',
- ' matSample -= 0.5;',
- ' matSample *= scale;',
- ' matSample /= mapDimensions;',
- ' gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + matSample.x, vTextureCoord.y + matSample.y));',
- ' gl_FragColor.rgb = mix( gl_FragColor.rgb, gl_FragColor.rgb, 1.0);',
- ' vec2 cord = vTextureCoord;',
+ ' mapCords *= dimensions.xy / mapDimensions;',
- //' gl_FragColor = texture2D(displacementMap, cord);',
- // ' gl_FragColor = gl_FragColor;',
+ ' vec4 original = texture2D(uSampler, vTextureCoord);',
+ ' float maskAlpha = texture2D(mask, mapCords).r;',
+ ' original *= maskAlpha;',
+ //' original.rgb *= maskAlpha;',
+ ' gl_FragColor = original;',
+ //' gl_FragColor = gl_FragColor;',
'}'
];
};
@@ -253,10 +252,10 @@ PIXI.AlphaMaskFilter.prototype.constructor = PIXI.AlphaMaskFilter;
PIXI.AlphaMaskFilter.prototype.onTextureLoaded = function()
{
- this.uniforms.mapDimensions.value.x = this.uniforms.displacementMap.value.width;
- this.uniforms.mapDimensions.value.y = this.uniforms.displacementMap.value.height;
+ this.uniforms.mapDimensions.value.x = this.uniforms.mask.value.width;
+ this.uniforms.mapDimensions.value.y = this.uniforms.mask.value.height;
- this.uniforms.displacementMap.value.baseTexture.off('loaded', this.boundLoadedFunction);
+ this.uniforms.mask.value.baseTexture.off('loaded', this.boundLoadedFunction);
};
/**
@@ -267,42 +266,13 @@ PIXI.AlphaMaskFilter.prototype.onTextureLoaded = function()
*/
Object.defineProperty(PIXI.AlphaMaskFilter.prototype, 'map', {
get: function() {
- return this.uniforms.displacementMap.value;
+ return this.uniforms.mask.value;
},
set: function(value) {
- this.uniforms.displacementMap.value = value;
+ this.uniforms.mask.value = value;
}
});
-/**
- * The multiplier used to scale the displacement result from the map calculation.
- *
- * @property scale
- * @type Point
- */
-Object.defineProperty(PIXI.AlphaMaskFilter.prototype, 'scale', {
- get: function() {
- return this.uniforms.scale.value;
- },
- set: function(value) {
- this.uniforms.scale.value = value;
- }
-});
-
-/**
- * The offset used to move the displacement map.
- *
- * @property offset
- * @type Point
- */
-Object.defineProperty(PIXI.AlphaMaskFilter.prototype, 'offset', {
- get: function() {
- return this.uniforms.offset.value;
- },
- set: function(value) {
- this.uniforms.offset.value = value;
- }
-});
diff --git a/docs/files/src_pixi_filters_BlurFilter.js.html b/docs/files/src_pixi_filters_BlurFilter.js.html
index 1aed839..ce9b4f8 100644
--- a/docs/files/src_pixi_filters_BlurFilter.js.html
+++ b/docs/files/src_pixi_filters_BlurFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -211,7 +217,7 @@ Object.defineProperty(PIXI.BlurFilter.prototype, 'blur', {
});
/**
- * Sets the strength of the blurX property simultaneously
+ * Sets the strength of the blurX property
*
* @property blurX
* @type Number the strength of the blurX
@@ -227,7 +233,7 @@ Object.defineProperty(PIXI.BlurFilter.prototype, 'blurX', {
});
/**
- * Sets the strength of the blurX property simultaneously
+ * Sets the strength of the blurX property
*
* @property blurY
* @type Number the strength of the blurY
diff --git a/docs/files/src_pixi_filters_BlurXFilter.js.html b/docs/files/src_pixi_filters_BlurXFilter.js.html
index e054c3d..4539e75 100644
--- a/docs/files/src_pixi_filters_BlurXFilter.js.html
+++ b/docs/files/src_pixi_filters_BlurXFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_filters_BlurYFilter.js.html b/docs/files/src_pixi_filters_BlurYFilter.js.html
index b80f673..cd8e916 100644
--- a/docs/files/src_pixi_filters_BlurYFilter.js.html
+++ b/docs/files/src_pixi_filters_BlurYFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_filters_ColorMatrixFilter.js.html b/docs/files/src_pixi_filters_ColorMatrixFilter.js.html
index 116260c..bcfd872 100644
--- a/docs/files/src_pixi_filters_ColorMatrixFilter.js.html
+++ b/docs/files/src_pixi_filters_ColorMatrixFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_filters_ColorStepFilter.js.html b/docs/files/src_pixi_filters_ColorStepFilter.js.html
index 362cfd7..745adae 100644
--- a/docs/files/src_pixi_filters_ColorStepFilter.js.html
+++ b/docs/files/src_pixi_filters_ColorStepFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -180,7 +186,7 @@
/**
*
- * This turns your displayObjects to black and white.
+ * This lowers the color depth of your image by the given amount, producing an image with a smaller palette.
* @class ColorStepFilter
* @contructor
*/
diff --git a/docs/files/src_pixi_filters_CrossHatchFilter.js.html b/docs/files/src_pixi_filters_CrossHatchFilter.js.html
index 75b3cc2..65451e2 100644
--- a/docs/files/src_pixi_filters_CrossHatchFilter.js.html
+++ b/docs/files/src_pixi_filters_CrossHatchFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_filters_DisplacementFilter.js.html b/docs/files/src_pixi_filters_DisplacementFilter.js.html
index 251aaa0..3169ee5 100644
--- a/docs/files/src_pixi_filters_DisplacementFilter.js.html
+++ b/docs/files/src_pixi_filters_DisplacementFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_filters_DotScreenFilter.js.html b/docs/files/src_pixi_filters_DotScreenFilter.js.html
index 0478cf5..040faab 100644
--- a/docs/files/src_pixi_filters_DotScreenFilter.js.html
+++ b/docs/files/src_pixi_filters_DotScreenFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -181,8 +187,8 @@
/**
*
- * This filter applies a pixlate effect making display objects appear 'blocky'
- * @class PixelateFilter
+ * This filter applies a dotscreen effect making display objects appear to be made out of black and white halftone dots like an old printer
+ * @class DotScreenFilter
* @contructor
*/
PIXI.DotScreenFilter = function()
diff --git a/docs/files/src_pixi_filters_FilterBlock.js.html b/docs/files/src_pixi_filters_FilterBlock.js.html
index 83ea26a..fb79060 100644
--- a/docs/files/src_pixi_filters_FilterBlock.js.html
+++ b/docs/files/src_pixi_filters_FilterBlock.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_filters_GrayFilter.js.html b/docs/files/src_pixi_filters_GrayFilter.js.html
index 905ecbb..2209631 100644
--- a/docs/files/src_pixi_filters_GrayFilter.js.html
+++ b/docs/files/src_pixi_filters_GrayFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_filters_InvertFilter.js.html b/docs/files/src_pixi_filters_InvertFilter.js.html
index 4c13566..1144b9f 100644
--- a/docs/files/src_pixi_filters_InvertFilter.js.html
+++ b/docs/files/src_pixi_filters_InvertFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_filters_PixelateFilter.js.html b/docs/files/src_pixi_filters_PixelateFilter.js.html
index e8e64cc..5e26afd 100644
--- a/docs/files/src_pixi_filters_PixelateFilter.js.html
+++ b/docs/files/src_pixi_filters_PixelateFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -180,7 +186,7 @@
/**
*
- * This filter applies a pixlate effect making display objects appear 'blocky'
+ * This filter applies a pixelate effect making display objects appear 'blocky'
* @class PixelateFilter
* @contructor
*/
diff --git a/docs/files/src_pixi_filters_RGBSplitFilter.js.html b/docs/files/src_pixi_filters_RGBSplitFilter.js.html
index fd8608d..96f4ee6 100644
--- a/docs/files/src_pixi_filters_RGBSplitFilter.js.html
+++ b/docs/files/src_pixi_filters_RGBSplitFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_filters_SepiaFilter.js.html b/docs/files/src_pixi_filters_SepiaFilter.js.html
index 36f2695..02a48c0 100644
--- a/docs/files/src_pixi_filters_SepiaFilter.js.html
+++ b/docs/files/src_pixi_filters_SepiaFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_filters_SmartBlurFilter.js.html b/docs/files/src_pixi_filters_SmartBlurFilter.js.html
index 994a5fb..8b748e4 100644
--- a/docs/files/src_pixi_filters_SmartBlurFilter.js.html
+++ b/docs/files/src_pixi_filters_SmartBlurFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_filters_TwistFilter.js.html b/docs/files/src_pixi_filters_TwistFilter.js.html
index ebf7dfc..aa0cbef 100644
--- a/docs/files/src_pixi_filters_TwistFilter.js.html
+++ b/docs/files/src_pixi_filters_TwistFilter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -180,8 +186,8 @@
/**
*
- * This filter applies a pixlate effect making display objects appear 'blocky'
- * @class PixelateFilter
+ * This filter applies a twist effect making display objects appear twisted in the given direction
+ * @class TwistFilter
* @contructor
*/
PIXI.TwistFilter = function()
diff --git a/docs/files/src_pixi_loaders_AssetLoader.js.html b/docs/files/src_pixi_loaders_AssetLoader.js.html
index b797e4d..0d042d5 100644
--- a/docs/files/src_pixi_loaders_AssetLoader.js.html
+++ b/docs/files/src_pixi_loaders_AssetLoader.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_loaders_AtlasLoader.js.html b/docs/files/src_pixi_loaders_AtlasLoader.js.html
index 01fac98..154fc5d 100644
--- a/docs/files/src_pixi_loaders_AtlasLoader.js.html
+++ b/docs/files/src_pixi_loaders_AtlasLoader.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -179,9 +185,9 @@
*/
/**
- * The atlas file loader is used to load in Atlas data and parsing it
+ * The atlas file loader is used to load in Atlas data and parse it
* When loaded this class will dispatch a 'loaded' event
- * If load failed this class will dispatch a 'error' event
+ * If loading fails this class will dispatch an 'error' event
* @class AtlasLoader
* @extends EventTarget
* @constructor
diff --git a/docs/files/src_pixi_loaders_BitmapFontLoader.js.html b/docs/files/src_pixi_loaders_BitmapFontLoader.js.html
index 3dee5ec..ceb412a 100644
--- a/docs/files/src_pixi_loaders_BitmapFontLoader.js.html
+++ b/docs/files/src_pixi_loaders_BitmapFontLoader.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -267,36 +273,48 @@ PIXI.BitmapFontLoader.prototype.onXMLLoaded = function()
{
if (this.ajaxRequest.status === 200 || window.location.protocol.indexOf('http') === -1)
{
- var textureUrl = this.baseUrl + this.ajaxRequest.responseXML.getElementsByTagName('page')[0].attributes.getNamedItem('file').nodeValue;
+ var responseXML = this.ajaxRequest.responseXML;
+ if(!responseXML || /MSIE 9/i.test(navigator.userAgent) || navigator.isCocoonJS) {
+ if(typeof(window.DOMParser) === 'function') {
+ var domparser = new DOMParser();
+ responseXML = domparser.parseFromString(this.ajaxRequest.responseText, 'text/xml');
+ } else {
+ var div = document.createElement('div');
+ div.innerHTML = this.ajaxRequest.responseText;
+ responseXML = div;
+ }
+ }
+
+ var textureUrl = this.baseUrl + responseXML.getElementsByTagName('page')[0].getAttribute('file');
var image = new PIXI.ImageLoader(textureUrl, this.crossorigin);
this.texture = image.texture.baseTexture;
var data = {};
- var info = this.ajaxRequest.responseXML.getElementsByTagName('info')[0];
- var common = this.ajaxRequest.responseXML.getElementsByTagName('common')[0];
- data.font = info.attributes.getNamedItem('face').nodeValue;
- data.size = parseInt(info.attributes.getNamedItem('size').nodeValue, 10);
- data.lineHeight = parseInt(common.attributes.getNamedItem('lineHeight').nodeValue, 10);
+ var info = responseXML.getElementsByTagName('info')[0];
+ var common = responseXML.getElementsByTagName('common')[0];
+ data.font = info.getAttribute('face');
+ data.size = parseInt(info.getAttribute('size'), 10);
+ data.lineHeight = parseInt(common.getAttribute('lineHeight'), 10);
data.chars = {};
//parse letters
- var letters = this.ajaxRequest.responseXML.getElementsByTagName('char');
+ var letters = responseXML.getElementsByTagName('char');
for (var i = 0; i < letters.length; i++)
{
- var charCode = parseInt(letters[i].attributes.getNamedItem('id').nodeValue, 10);
+ var charCode = parseInt(letters[i].getAttribute('id'), 10);
var textureRect = new PIXI.Rectangle(
- parseInt(letters[i].attributes.getNamedItem('x').nodeValue, 10),
- parseInt(letters[i].attributes.getNamedItem('y').nodeValue, 10),
- parseInt(letters[i].attributes.getNamedItem('width').nodeValue, 10),
- parseInt(letters[i].attributes.getNamedItem('height').nodeValue, 10)
+ parseInt(letters[i].getAttribute('x'), 10),
+ parseInt(letters[i].getAttribute('y'), 10),
+ parseInt(letters[i].getAttribute('width'), 10),
+ parseInt(letters[i].getAttribute('height'), 10)
);
data.chars[charCode] = {
- xOffset: parseInt(letters[i].attributes.getNamedItem('xoffset').nodeValue, 10),
- yOffset: parseInt(letters[i].attributes.getNamedItem('yoffset').nodeValue, 10),
- xAdvance: parseInt(letters[i].attributes.getNamedItem('xadvance').nodeValue, 10),
+ xOffset: parseInt(letters[i].getAttribute('xoffset'), 10),
+ yOffset: parseInt(letters[i].getAttribute('yoffset'), 10),
+ xAdvance: parseInt(letters[i].getAttribute('xadvance'), 10),
kerning: {},
texture: PIXI.TextureCache[charCode] = new PIXI.Texture(this.texture, textureRect)
@@ -304,12 +322,12 @@ PIXI.BitmapFontLoader.prototype.onXMLLoaded = function()
}
//parse kernings
- var kernings = this.ajaxRequest.responseXML.getElementsByTagName('kerning');
+ var kernings = responseXML.getElementsByTagName('kerning');
for (i = 0; i < kernings.length; i++)
{
- var first = parseInt(kernings[i].attributes.getNamedItem('first').nodeValue, 10);
- var second = parseInt(kernings[i].attributes.getNamedItem('second').nodeValue, 10);
- var amount = parseInt(kernings[i].attributes.getNamedItem('amount').nodeValue, 10);
+ var first = parseInt(kernings[i].getAttribute('first'), 10);
+ var second = parseInt(kernings[i].getAttribute('second'), 10);
+ var amount = parseInt(kernings[i].getAttribute('amount'), 10);
data.chars[second].kerning[first] = amount;
diff --git a/docs/files/src_pixi_loaders_ImageLoader.js.html b/docs/files/src_pixi_loaders_ImageLoader.js.html
index a50e9ea..ea82983 100644
--- a/docs/files/src_pixi_loaders_ImageLoader.js.html
+++ b/docs/files/src_pixi_loaders_ImageLoader.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -180,7 +186,7 @@
/**
* The image loader class is responsible for loading images file formats ('jpeg', 'jpg', 'png' and 'gif')
- * Once the image has been loaded it is stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
+ * Once the image has been loaded it is stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFrameId()
* When loaded this class will dispatch a 'loaded' event
*
* @class ImageLoader
@@ -249,7 +255,7 @@ PIXI.ImageLoader.prototype.onLoaded = function()
*
*
* @method loadFramedSpriteSheet
- * @param frameWidth {Number} with of each frame
+ * @param frameWidth {Number} width of each frame
* @param frameHeight {Number} height of each frame
* @param textureName {String} if given, the frames will be cached in <textureName>-<ord> format
*/
diff --git a/docs/files/src_pixi_loaders_JsonLoader.js.html b/docs/files/src_pixi_loaders_JsonLoader.js.html
index b676085..263afd2 100644
--- a/docs/files/src_pixi_loaders_JsonLoader.js.html
+++ b/docs/files/src_pixi_loaders_JsonLoader.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -179,9 +185,9 @@
*/
/**
- * The json file loader is used to load in JSON data and parsing it
+ * The json file loader is used to load in JSON data and parse it
* When loaded this class will dispatch a 'loaded' event
- * If load failed this class will dispatch a 'error' event
+ * If loading fails this class will dispatch an 'error' event
*
* @class JsonLoader
* @uses EventTarget
diff --git a/docs/files/src_pixi_loaders_SpineLoader.js.html b/docs/files/src_pixi_loaders_SpineLoader.js.html
index 4ac3877..ea1c495 100644
--- a/docs/files/src_pixi_loaders_SpineLoader.js.html
+++ b/docs/files/src_pixi_loaders_SpineLoader.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -185,7 +191,7 @@
/**
* The Spine loader is used to load in JSON spine data
- * To generate the data you need to use http://esotericsoftware.com/ and export the "JSON" format
+ * To generate the data you need to use http://esotericsoftware.com/ and export in the "JSON" format
* Due to a clash of names You will need to change the extension of the spine file from *.json to *.anim for it to load
* See example 12 (http://www.goodboydigital.com/pixijs/examples/12/) to see a working example and check out the source
* You will need to generate a sprite sheet to accompany the spine data
@@ -240,26 +246,11 @@ PIXI.SpineLoader.prototype.load = function () {
var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin);
jsonLoader.addEventListener("loaded", function (event) {
scope.json = event.content.json;
- scope.onJSONLoaded();
+ scope.onLoaded();
});
jsonLoader.load();
};
-/**
- * Invoke when JSON file is loaded
- *
- * @method onJSONLoaded
- * @private
- */
-PIXI.SpineLoader.prototype.onJSONLoaded = function () {
- var spineJsonParser = new spine.SkeletonJson();
- var skeletonData = spineJsonParser.readSkeletonData(this.json);
-
- PIXI.AnimCache[this.url] = skeletonData;
-
- this.onLoaded();
-};
-
/**
* Invoke when JSON file is loaded
*
diff --git a/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html b/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html
index 4847072..c8f2a59 100644
--- a/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html
+++ b/docs/files/src_pixi_loaders_SpriteSheetLoader.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -180,11 +186,11 @@
/**
* The sprite sheet loader is used to load in JSON sprite sheet data
- * To generate the data you can use http://www.codeandweb.com/texturepacker and publish the 'JSON' format
+ * To generate the data you can use http://www.codeandweb.com/texturepacker and publish in the 'JSON' format
* There is a free version so thats nice, although the paid version is great value for money.
- * It is highly recommended to use Sprite sheets (also know as texture atlas') as it means sprite's can be batched and drawn together for highly increased rendering speed.
- * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFromeId()
- * This loader will also load the image file that the Spritesheet points to as well as the data.
+ * It is highly recommended to use Sprite sheets (also know as a 'texture atlas') as it means sprites can be batched and drawn together for highly increased rendering speed.
+ * Once the data has been loaded the frames are stored in the PIXI texture cache and can be accessed though PIXI.Texture.fromFrameId() and PIXI.Sprite.fromFrameId()
+ * This loader will load the image file that the Spritesheet points to as well as the data.
* When loaded this class will dispatch a 'loaded' event
*
* @class SpriteSheetLoader
@@ -256,47 +262,9 @@ PIXI.SpriteSheetLoader.prototype.load = function () {
var jsonLoader = new PIXI.JsonLoader(this.url, this.crossorigin);
jsonLoader.addEventListener('loaded', function (event) {
scope.json = event.content.json;
- scope.onJSONLoaded();
- });
- jsonLoader.load();
-};
-
-/**
- * Invoke when JSON file is loaded
- *
- * @method onJSONLoaded
- * @private
- */
-PIXI.SpriteSheetLoader.prototype.onJSONLoaded = function () {
- var scope = this;
- var textureUrl = this.baseUrl + this.json.meta.image;
- var image = new PIXI.ImageLoader(textureUrl, this.crossorigin);
- var frameData = this.json.frames;
-
- this.texture = image.texture.baseTexture;
- image.addEventListener('loaded', function () {
scope.onLoaded();
});
-
- for (var i in frameData) {
- var rect = frameData[i].frame;
- if (rect) {
- PIXI.TextureCache[i] = new PIXI.Texture(this.texture, {
- x: rect.x,
- y: rect.y,
- width: rect.w,
- height: rect.h
- });
- if (frameData[i].trimmed) {
- //var realSize = frameData[i].spriteSourceSize;
- PIXI.TextureCache[i].realSize = frameData[i].spriteSourceSize;
- PIXI.TextureCache[i].trim.x = 0; // (realSize.x / rect.w)
- // calculate the offset!
- }
- }
- }
-
- image.load();
+ jsonLoader.load();
};
/**
diff --git a/docs/files/src_pixi_primitives_Graphics.js.html b/docs/files/src_pixi_primitives_Graphics.js.html
index 94cfdb0..08ceebe 100644
--- a/docs/files/src_pixi_primitives_Graphics.js.html
+++ b/docs/files/src_pixi_primitives_Graphics.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -243,21 +249,44 @@ PIXI.Graphics = function()
this._webGL = [];
this.isMask = false;
+
+ this.bounds = null;
+
+ this.boundsPadding = 10;
};
// constructor
PIXI.Graphics.prototype = Object.create( PIXI.DisplayObjectContainer.prototype );
PIXI.Graphics.prototype.constructor = PIXI.Graphics;
-/*
-* Not yet implemented
-*/
+/**
+ * If cacheAsBitmap is true the graphics object will then be rendered as if it was a sprite.
+ * This is useful if your graphics element does not change often as it will speed up the rendering of the object
+ * It is also usful as the graphics object will always be antialiased because it will be rendered using canvas
+ * Not recommended if you are constanly redrawing the graphics element.
+ *
+ * @property cacheAsBitmap
+ * @default false
+ * @type Boolean
+ * @private
+ */
Object.defineProperty(PIXI.Graphics.prototype, "cacheAsBitmap", {
get: function() {
return this._cacheAsBitmap;
},
set: function(value) {
this._cacheAsBitmap = value;
+
+ if(this._cacheAsBitmap)
+ {
+ this._generateCachedSprite();
+ }
+ else
+ {
+ this.destroyCachedSprite();
+ this.dirty = true;
+ }
+
}
});
@@ -425,34 +454,86 @@ PIXI.Graphics.prototype.clear = function()
this.bounds = null; //new PIXI.Rectangle();
};
+/**
+ * Useful function that returns a texture of the graphics object that can then be used to create sprites
+ * This can be quite useful if your geometry is complicated and needs to be reused multiple times.
+ *
+ * @method generateTexture
+ * @return {Texture} a texture of the graphics object
+ */
+PIXI.Graphics.prototype.generateTexture = function()
+{
+ var bounds = this.getBounds();
+
+ var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height);
+ var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas);
+
+ canvasBuffer.context.translate(-bounds.x,-bounds.y);
+
+ PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context);
+
+ return texture;
+};
PIXI.Graphics.prototype._renderWebGL = function(renderSession)
{
// if the sprite is not visible or the alpha is 0 then no need to render this element
if(this.visible === false || this.alpha === 0 || this.isMask === true)return;
-
- renderSession.spriteBatch.stop();
-
- if(this._mask)renderSession.maskManager.pushMask(this.mask, renderSession);
- if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock);
-
- // check blend mode
- if(this.blendMode !== renderSession.spriteBatch.currentBlendMode)
+ if(this._cacheAsBitmap)
{
- this.spriteBatch.currentBlendMode = this.blendMode;
- var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode];
- this.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]);
- }
-
- PIXI.WebGLGraphics.renderGraphics(this, renderSession);
-
- if(this._filters)renderSession.filterManager.popFilter();
- if(this._mask)renderSession.maskManager.popMask(renderSession);
-
- renderSession.drawCount++;
+
+ if(this.dirty)
+ {
+ this._generateCachedSprite();
+ // we will also need to update the texture on the gpu too!
+ PIXI.updateWebGLTexture(this._cachedSprite.texture.baseTexture, renderSession.gl);
+
+ this.dirty = false;
+ }
- renderSession.spriteBatch.start();
+ PIXI.Sprite.prototype._renderWebGL.call(this._cachedSprite, renderSession);
+
+ return;
+ }
+ else
+ {
+ renderSession.spriteBatch.stop();
+
+ if(this._mask)renderSession.maskManager.pushMask(this.mask, renderSession);
+ if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock);
+
+ // check blend mode
+ if(this.blendMode !== renderSession.spriteBatch.currentBlendMode)
+ {
+ this.spriteBatch.currentBlendMode = this.blendMode;
+ var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode];
+ this.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]);
+ }
+
+ PIXI.WebGLGraphics.renderGraphics(this, renderSession);
+
+ // only render if it has children!
+ if(this.children.length)
+ {
+ renderSession.spriteBatch.start();
+
+ // simple render children!
+ for(var i=0, j=this.children.length; i<j; i++)
+ {
+ this.children[i]._renderWebGL(renderSession);
+ }
+
+ renderSession.spriteBatch.stop();
+ }
+
+ if(this._filters)renderSession.filterManager.popFilter();
+ if(this._mask)renderSession.maskManager.popMask(renderSession);
+
+ renderSession.drawCount++;
+
+ renderSession.spriteBatch.start();
+ }
};
PIXI.Graphics.prototype._renderCanvas = function(renderSession)
@@ -471,6 +552,12 @@ PIXI.Graphics.prototype._renderCanvas = function(renderSession)
context.setTransform(transform[0], transform[3], transform[1], transform[4], transform[2], transform[5]);
PIXI.CanvasGraphics.renderGraphics(this, context);
+
+ // simple render children!
+ for(var i=0, j=this.children.length; i<j; i++)
+ {
+ this.children[i]._renderCanvas(renderSession);
+ }
};
PIXI.Graphics.prototype.getBounds = function()
@@ -601,15 +688,58 @@ PIXI.Graphics.prototype.updateBounds = function()
}
}
- this.bounds = new PIXI.Rectangle(minX, minY, maxX - minX, maxY - minY);
+ var padding = this.boundsPadding;
+ this.bounds = new PIXI.Rectangle(minX - padding, minY - padding, (maxX - minX) + padding * 2, (maxY - minY) + padding * 2);
};
+PIXI.Graphics.prototype._generateCachedSprite = function()
+{
+ var bounds = this.getBounds();
+
+ if(!this._cachedSprite)
+ {
+ var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height);
+ var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas);
+
+ this._cachedSprite = new PIXI.Sprite(texture);
+ this._cachedSprite.buffer = canvasBuffer;
+
+ this._cachedSprite.worldTransform = this.worldTransform;
+ }
+ else
+ {
+ this._cachedSprite.buffer.resize(bounds.width, bounds.height);
+ }
+
+ // leverage the anchor to account for the offset of the element
+ this._cachedSprite.anchor.x = -( bounds.x / bounds.width );
+ this._cachedSprite.anchor.y = -( bounds.y / bounds.height );
+
+ // this._cachedSprite.buffer.context.save();
+ this._cachedSprite.buffer.context.translate(-bounds.x,-bounds.y);
+
+ PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context);
+ // this._cachedSprite.buffer.context.restore();
+};
+
+PIXI.Graphics.prototype.destroyCachedSprite = function()
+{
+ this._cachedSprite.texture.destroy(true);
+
+ // let the gc collect the unused sprite
+ // TODO could be object pooled!
+ this._cachedSprite = null;
+};
+
+
// SOME TYPES:
PIXI.Graphics.POLY = 0;
PIXI.Graphics.RECT = 1;
PIXI.Graphics.CIRC = 2;
PIXI.Graphics.ELIP = 3;
+PIXI.tempMatrix = PIXI.mat3.create();
+
diff --git a/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html b/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html
index cb54464..86d43e3 100644
--- a/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html
+++ b/docs/files/src_pixi_renderers_canvas_CanvasGraphics.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html b/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html
index 1e60cf4..bfba47f 100644
--- a/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html
+++ b/docs/files/src_pixi_renderers_canvas_CanvasRenderer.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -195,7 +201,7 @@ PIXI.CanvasRenderer = function(width, height, view, transparent)
this.type = PIXI.CANVAS_RENDERER;
- this.transparent = transparent;
+ this.transparent = !!transparent;
if(!PIXI.blendModesCanvas)
{
@@ -207,6 +213,19 @@ PIXI.CanvasRenderer = function(width, height, view, transparent)
PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK???
PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "multiply";
PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "screen";
+ PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "overlay";
+ PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "darken";
+ PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "lighten";
+ PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "color-dodge";
+ PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "color-burn";
+ PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "hard-light";
+ PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "soft-light";
+ PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "difference";
+ PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "exclusion";
+ PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "hue";
+ PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "saturation";
+ PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "color";
+ PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "luminosity";
}
else
{
@@ -215,6 +234,19 @@ PIXI.CanvasRenderer = function(width, height, view, transparent)
PIXI.blendModesCanvas[PIXI.blendModes.ADD] = "lighter"; //IS THIS OK???
PIXI.blendModesCanvas[PIXI.blendModes.MULTIPLY] = "source-over";
PIXI.blendModesCanvas[PIXI.blendModes.SCREEN] = "source-over";
+ PIXI.blendModesCanvas[PIXI.blendModes.OVERLAY] = "source-over";
+ PIXI.blendModesCanvas[PIXI.blendModes.DARKEN] = "source-over";
+ PIXI.blendModesCanvas[PIXI.blendModes.LIGHTEN] = "source-over";
+ PIXI.blendModesCanvas[PIXI.blendModes.COLOR_DODGE] = "source-over";
+ PIXI.blendModesCanvas[PIXI.blendModes.COLOR_BURN] = "source-over";
+ PIXI.blendModesCanvas[PIXI.blendModes.HARD_LIGHT] = "source-over";
+ PIXI.blendModesCanvas[PIXI.blendModes.SOFT_LIGHT] = "source-over";
+ PIXI.blendModesCanvas[PIXI.blendModes.DIFFERENCE] = "source-over";
+ PIXI.blendModesCanvas[PIXI.blendModes.EXCLUSION] = "source-over";
+ PIXI.blendModesCanvas[PIXI.blendModes.HUE] = "source-over";
+ PIXI.blendModesCanvas[PIXI.blendModes.SATURATION] = "source-over";
+ PIXI.blendModesCanvas[PIXI.blendModes.COLOR] = "source-over";
+ PIXI.blendModesCanvas[PIXI.blendModes.LUMINOSITY] = "source-over";
}
}
@@ -249,21 +281,7 @@ PIXI.CanvasRenderer = function(width, height, view, transparent)
* @property context
* @type Canvas 2d Context
*/
- this.context = this.view.getContext( "2d" );
-
- //some filter variables
- this.smoothProperty = null;
-
- if("imageSmoothingEnabled" in this.context)
- this.smoothProperty = "imageSmoothingEnabled";
- else if("webkitImageSmoothingEnabled" in this.context)
- this.smoothProperty = "webkitImageSmoothingEnabled";
- else if("mozImageSmoothingEnabled" in this.context)
- this.smoothProperty = "mozImageSmoothingEnabled";
- else if("oImageSmoothingEnabled" in this.context)
- this.smoothProperty = "oImageSmoothingEnabled";
-
- this.scaleMode = null;
+ this.context = this.view.getContext( "2d", { alpha: this.transparent } );
this.refresh = true;
// hack to enable some hardware acceleration!
@@ -275,10 +293,21 @@ PIXI.CanvasRenderer = function(width, height, view, transparent)
this.maskManager = new PIXI.CanvasMaskManager();
- this.renderSession = {};
- this.renderSession.context = this.context;
- this.renderSession.maskManager = this.maskManager;
-
+ this.renderSession = {
+ context: this.context,
+ maskManager: this.maskManager,
+ scaleMode: null,
+ smoothProperty: null
+ };
+
+ if("imageSmoothingEnabled" in this.context)
+ this.renderSession.smoothProperty = "imageSmoothingEnabled";
+ else if("webkitImageSmoothingEnabled" in this.context)
+ this.renderSession.smoothProperty = "webkitImageSmoothingEnabled";
+ else if("mozImageSmoothingEnabled" in this.context)
+ this.renderSession.smoothProperty = "mozImageSmoothingEnabled";
+ else if("oImageSmoothingEnabled" in this.context)
+ this.renderSession.smoothProperty = "oImageSmoothingEnabled";
};
// constructor
@@ -296,20 +325,33 @@ PIXI.CanvasRenderer.prototype.render = function(stage)
//stage.__childrenRemoved = [];
// update textures if need be
- PIXI.texturesToUpdate = [];
- PIXI.texturesToDestroy = [];
+ PIXI.texturesToUpdate.length = 0;
+ PIXI.texturesToDestroy.length = 0;
- PIXI.visibleCount++;
stage.updateTransform();
// update the background color
- if(this.view.style.backgroundColor !== stage.backgroundColorString && !this.transparent)
- this.view.style.backgroundColor = stage.backgroundColorString;
+ /* if(this.view.style.backgroundColor !== stage.backgroundColorString && !this.transparent)
+ this.view.style.backgroundColor = stage.backgroundColorString; */
this.context.setTransform(1,0,0,1,0,0);
- this.context.clearRect(0, 0, this.width, this.height);
+
+ if(this.view.style.backgroundColor !== stage.backgroundColorString )
+ {
+ if(!this.transparent)
+ {
+ this.context.fillStyle = stage.backgroundColorString;
+ this.context.fillRect(0, 0, this.width, this.height);
+ }
+ else
+ {
+ this.context.clearRect(0, 0, this.width, this.height);
+ }
+ }
+
+ //console.log(this.view.style.backgroundColor)
+
this.renderDisplayObject(stage);
- //as
// run interaction!
if(stage.interactive)
@@ -325,7 +367,7 @@ PIXI.CanvasRenderer.prototype.render = function(stage)
// remove frame updates..
if(PIXI.Texture.frameUpdates.length > 0)
{
- PIXI.Texture.frameUpdates = [];
+ PIXI.Texture.frameUpdates.length = 0;
}
};
@@ -354,7 +396,7 @@ PIXI.CanvasRenderer.prototype.resize = function(width, height)
*/
PIXI.CanvasRenderer.prototype.renderDisplayObject = function(displayObject, context)
{
- // no loger recurrsive!
+ // no longer recurrsive!
//var transform;
//var context = this.context;
@@ -460,7 +502,6 @@ PIXI.CanvasBuffer = function(width, height)
this.canvas = document.createElement( "canvas" );
this.context = this.canvas.getContext( "2d" );
-// this.context.f
this.canvas.width = width;
this.canvas.height = height;
};
diff --git a/docs/files/src_pixi_renderers_canvas_utils_CanvasMaskManager.js.html b/docs/files/src_pixi_renderers_canvas_utils_CanvasMaskManager.js.html
index 4f57f1a..e660e2a 100644
--- a/docs/files/src_pixi_renderers_canvas_utils_CanvasMaskManager.js.html
+++ b/docs/files/src_pixi_renderers_canvas_utils_CanvasMaskManager.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_renderers_canvas_utils_CanvasTinter.js.html b/docs/files/src_pixi_renderers_canvas_utils_CanvasTinter.js.html
index 51b51d5..f8a5705 100644
--- a/docs/files/src_pixi_renderers_canvas_utils_CanvasTinter.js.html
+++ b/docs/files/src_pixi_renderers_canvas_utils_CanvasTinter.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -192,8 +198,8 @@ PIXI.CanvasTinter = function()
PIXI.CanvasTinter.getTintedTexture = function(sprite, color)
{
//
- // cach on sprite
- // cach on texture
+ // cache on sprite
+ // cache on texture
// no cache
var texture = sprite.texture;
@@ -226,7 +232,7 @@ PIXI.CanvasTinter.getTintedTexture = function(sprite, color)
{
texture.tintCache[stringColor] = canvas;
- // if we are not converting the texture to an image then we need to lose the refferance to the canvas
+ // if we are not converting the texture to an image then we need to lose the reference to the canvas
PIXI.CanvasTinter.canvas = null;
}
@@ -347,9 +353,9 @@ PIXI.CanvasTinter.roundColor = function(color)
var rgbValues = PIXI.hex2rgb(color);
- rgbValues[0] = Math.round(rgbValues[0] * step) / step;
- rgbValues[1] = Math.round(rgbValues[1] * step) / step;
- rgbValues[2] = Math.round(rgbValues[2] * step) / step;
+ rgbValues[0] = Math.min(255, (rgbValues[0] / step) * step);
+ rgbValues[1] = Math.min(255, (rgbValues[1] / step) * step);
+ rgbValues[2] = Math.min(255, (rgbValues[2] / step) * step);
return PIXI.rgb2hex(rgbValues);
};
diff --git a/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html b/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html
index 3f4f9df..4fa86f9 100644
--- a/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html
+++ b/docs/files/src_pixi_renderers_webgl_WebGLRenderer.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -178,17 +184,11 @@
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
-PIXI._defaultFrame = new PIXI.Rectangle(0,0,1,1);
-
-// an instance of the gl context..
-// only one at the moment :/
-PIXI.gl = null;
-
-
+PIXI.glContexts = []; // this is where we store the webGL contexts for easy access.
/**
- * the WebGLRenderer is draws the stage and all its content onto a webGL enabled canvas. This renderer
- * should be used for browsers support webGL. This Render works by automatically managing webGLBatchs.
+ * the WebGLRenderer draws the stage and all its content onto a webGL enabled canvas. This renderer
+ * should be used for browsers that support webGL. This Render works by automatically managing webGLBatch's.
* So no need for Sprite Batch's or Sprite Cloud's
* Dont forget to add the view to your DOM or you will not see anything :)
*
@@ -197,7 +197,7 @@ PIXI.gl = null;
* @param width=0 {Number} the width of the canvas view
* @param height=0 {Number} the height of the canvas view
* @param view {Canvas} the canvas to use as a view, optional
- * @param transparent=false {Boolean} the transparency of the render view, default false
+ * @param transparent=false {Boolean} If the render view is transparent, default false
* @param antialias=false {Boolean} sets antialias (only applicable in chrome at the moment)
*
*/
@@ -218,16 +218,17 @@ PIXI.WebGLRenderer = function(width, height, view, transparent, antialias)
this.view.height = this.height;
// deal with losing context..
- var scope = this;
- this.view.addEventListener('webglcontextlost', function(event) { scope.handleContextLost(event); }, false);
- this.view.addEventListener('webglcontextrestored', function(event) { scope.handleContextRestored(event); }, false);
- this.batchs = [];
+ this.contextLost = this.handleContextLost.bind(this);
+ this.contextRestoredLost = this.handleContextRestored.bind(this);
+ // console.log(this.handleContextRestored)
+ this.view.addEventListener('webglcontextlost', this.contextLost, false);
+ this.view.addEventListener('webglcontextrestored', this.contextRestoredLost, false);
this.options = {
alpha: this.transparent,
antialias:!!antialias, // SPEED UP??
- premultipliedAlpha:false,
+ premultipliedAlpha:!!transparent,
stencil:true
};
@@ -247,14 +248,29 @@ PIXI.WebGLRenderer = function(width, height, view, transparent, antialias)
var gl = this.gl;
this.glContextId = gl.id = PIXI.WebGLRenderer.glContextId ++;
+ PIXI.glContexts[this.glContextId] = gl;
+
if(!PIXI.blendModesWebGL)
{
PIXI.blendModesWebGL = [];
- PIXI.blendModesWebGL[PIXI.blendModes.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
- PIXI.blendModesWebGL[PIXI.blendModes.ADD] = [gl.SRC_ALPHA, gl.DST_ALPHA];
- PIXI.blendModesWebGL[PIXI.blendModes.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA];
- PIXI.blendModesWebGL[PIXI.blendModes.SCREEN] = [gl.SRC_ALPHA, gl.ONE];
+ PIXI.blendModesWebGL[PIXI.blendModes.NORMAL] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
+ PIXI.blendModesWebGL[PIXI.blendModes.ADD] = [gl.SRC_ALPHA, gl.DST_ALPHA];
+ PIXI.blendModesWebGL[PIXI.blendModes.MULTIPLY] = [gl.DST_COLOR, gl.ONE_MINUS_SRC_ALPHA];
+ PIXI.blendModesWebGL[PIXI.blendModes.SCREEN] = [gl.SRC_ALPHA, gl.ONE];
+ PIXI.blendModesWebGL[PIXI.blendModes.OVERLAY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
+ PIXI.blendModesWebGL[PIXI.blendModes.DARKEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
+ PIXI.blendModesWebGL[PIXI.blendModes.LIGHTEN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
+ PIXI.blendModesWebGL[PIXI.blendModes.COLOR_DODGE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
+ PIXI.blendModesWebGL[PIXI.blendModes.COLOR_BURN] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
+ PIXI.blendModesWebGL[PIXI.blendModes.HARD_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
+ PIXI.blendModesWebGL[PIXI.blendModes.SOFT_LIGHT] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
+ PIXI.blendModesWebGL[PIXI.blendModes.DIFFERENCE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
+ PIXI.blendModesWebGL[PIXI.blendModes.EXCLUSION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
+ PIXI.blendModesWebGL[PIXI.blendModes.HUE] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
+ PIXI.blendModesWebGL[PIXI.blendModes.SATURATION] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
+ PIXI.blendModesWebGL[PIXI.blendModes.COLOR] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
+ PIXI.blendModesWebGL[PIXI.blendModes.LUMINOSITY] = [gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
}
@@ -287,8 +303,6 @@ PIXI.WebGLRenderer = function(width, height, view, transparent, antialias)
gl.useProgram(this.shaderManager.defaultShader.program);
- PIXI.WebGLRenderer.gl = gl;
-
gl.disable(gl.DEPTH_TEST);
gl.disable(gl.CULL_FACE);
@@ -310,7 +324,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
if(this.contextLost)return;
- // if rendering a new stage clear the batchs..
+ // if rendering a new stage clear the batches..
if(this.__stage !== stage)
{
// TODO make this work
@@ -327,13 +341,22 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
var gl = this.gl;
// -- Does this need to be set every frame? -- //
- gl.colorMask(true, true, true, this.transparent);
+ //gl.colorMask(true, true, true, this.transparent);
gl.viewport(0, 0, this.width, this.height);
// make sure we are bound to the main frame buffer
gl.bindFramebuffer(gl.FRAMEBUFFER, null);
- gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], !this.transparent);
+ if(this.transparent)
+ {
+ gl.clearColor(0, 0, 0, 0);
+ }
+ else
+ {
+ gl.clearColor(stage.backgroundColorSplit[0],stage.backgroundColorSplit[1],stage.backgroundColorSplit[2], 1);
+ }
+
+
gl.clear(gl.COLOR_BUFFER_BIT);
// this.projection.x = this.width/2;
@@ -374,7 +397,7 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
*/
};
-PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection)
+PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, projection, buffer)
{
// reset the render session data..
this.renderSession.drawCount = 0;
@@ -387,7 +410,7 @@ PIXI.WebGLRenderer.prototype.renderDisplayObject = function(displayObject, proje
this.spriteBatch.begin(this.renderSession);
// start the filter manager
- this.filterManager.begin(this.renderSession, null);
+ this.filterManager.begin(this.renderSession, buffer);
// render the scene!
displayObject._renderWebGL(this.renderSession);
@@ -418,58 +441,11 @@ PIXI.WebGLRenderer.updateTextures = function()
for (i = 0; i < PIXI.texturesToDestroy.length; i++)
PIXI.WebGLRenderer.destroyTexture(PIXI.texturesToDestroy[i]);
- PIXI.texturesToUpdate = [];
- PIXI.texturesToDestroy = [];
- PIXI.Texture.frameUpdates = [];
+ PIXI.texturesToUpdate.length = 0;
+ PIXI.texturesToDestroy.length = 0;
+ PIXI.Texture.frameUpdates.length = 0;
};
-/**
- * Updates a loaded webgl texture
- *
- * @static
- * @method updateTexture
- * @param texture {Texture} The texture to update
- * @private
- */
-
- /*
-PIXI.WebGLRenderer.updateTexture = function(texture)
-{
- //TODO break this out into a texture manager...
- var gl = this.gl;
-
- if(!texture._glTexture)
- {
- texture._glTexture = gl.createTexture();
- }
-
- if(texture.hasLoaded)
- {
- gl.bindTexture(gl.TEXTURE_2D, texture._glTexture);
- gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
-
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.BaseTexture.SCALE_MODE.LINEAR ? gl.LINEAR : gl.NEAREST);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.BaseTexture.SCALE_MODE.LINEAR ? gl.LINEAR : gl.NEAREST);
-
- // reguler...
-
- if(!texture._powerOf2)
- {
- 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);
- }
- else
- {
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
- }
-
- gl.bindTexture(gl.TEXTURE_2D, null);
- }
-};
-*/
-
/**
* Destroys a loaded webgl texture
*
@@ -480,13 +456,19 @@ PIXI.WebGLRenderer.updateTexture = function(texture)
PIXI.WebGLRenderer.destroyTexture = function(texture)
{
//TODO break this out into a texture manager...
- var gl = PIXI.gl;
- if(texture._glTexture)
+ for (var i = texture._glTextures.length - 1; i >= 0; i--)
{
- texture._glTexture = gl.createTexture();
- gl.deleteTexture(gl.TEXTURE_2D, texture._glTexture);
+ var glTexture = texture._glTextures[i];
+ var gl = PIXI.glContexts[i];
+
+ if(gl && glTexture)
+ {
+ gl.deleteTexture(glTexture);
+ }
}
+
+ texture._glTextures.length = 0;
};
PIXI.WebGLRenderer.updateTextureFrame = function(texture)
@@ -531,8 +513,8 @@ PIXI.createWebGLTexture = function(texture, gl)
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.BaseTexture.SCALE_MODE.LINEAR ? gl.LINEAR : gl.NEAREST);
- gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.BaseTexture.SCALE_MODE.LINEAR ? gl.LINEAR : gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
// reguler...
@@ -549,6 +531,37 @@ PIXI.createWebGLTexture = function(texture, gl)
gl.bindTexture(gl.TEXTURE_2D, null);
}
+
+ return texture._glTextures[gl.id];
+};
+
+PIXI.updateWebGLTexture = function(texture, gl)
+{
+ if( texture._glTextures[gl.id] )
+ {
+ gl.bindTexture(gl.TEXTURE_2D, texture._glTextures[gl.id]);
+ gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);
+
+ gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, texture.scaleMode === PIXI.scaleModes.LINEAR ? gl.LINEAR : gl.NEAREST);
+
+ // reguler...
+
+ if(!texture._powerOf2)
+ {
+ 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);
+ }
+ else
+ {
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);
+ }
+
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ }
+
};
/**
@@ -619,6 +632,37 @@ PIXI.WebGLRenderer.prototype.handleContextRestored = function()
};
+PIXI.WebGLRenderer.prototype.destroy = function()
+{
+
+ // deal with losing context..
+
+ // remove listeners
+ this.view.removeEventListener('webglcontextlost', this.contextLost);
+ this.view.removeEventListener('webglcontextrestored', this.contextRestoredLost);
+
+ PIXI.glContexts[this.glContextId] = null;
+
+ this.projection = null;
+ this.offset = null;
+
+ // time to create the render managers! each one focuses on managine a state in webGL
+ this.shaderManager.destroy();
+ this.spriteBatch.destroy();
+ this.maskManager.destroy();
+ this.filterManager.destroy();
+
+ this.shaderManager = null;
+ this.spriteBatch = null;
+ this.maskManager = null;
+ this.filterManager = null;
+
+ this.gl = null;
+ //
+ this.renderSession = null;
+};
+
+
PIXI.WebGLRenderer.glContextId = 0;
diff --git a/docs/files/src_pixi_renderers_webgl_shaders_PixiFastShader.js.html b/docs/files/src_pixi_renderers_webgl_shaders_PixiFastShader.js.html
new file mode 100644
index 0000000..01c2641
--- /dev/null
+++ b/docs/files/src_pixi_renderers_webgl_shaders_PixiFastShader.js.html
@@ -0,0 +1,332 @@
+
+
+
+
+
src/pixi/renderers/webgl/shaders/PixiFastShader.js - pixi.js
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Show:
+
+
+ Inherited
+
+
+
+
+ Protected
+
+
+
+
+ Private
+
+
+
+ Deprecated
+
+
+
+
+
+
+
+
+
File: src/pixi/renderers/webgl/shaders/PixiFastShader.js
+
+
+
+/**
+ * @author Mat Groves http://matgroves.com/ @Doormat23
+ * @author Richard Davey http://www.photonstorm.com @photonstorm
+ */
+
+/**
+* @class PIXI.PixiFastShader
+* @constructor
+*/
+PIXI.PixiFastShader = function(gl)
+{
+ this.gl = gl;
+
+ /**
+ * @property {any} program - The WebGL program.
+ */
+ this.program = null;
+
+ /**
+ * @property {array} fragmentSrc - The fragment shader.
+ */
+ this.fragmentSrc = [
+ 'precision lowp float;',
+ 'varying vec2 vTextureCoord;',
+ 'varying float vColor;',
+ 'uniform sampler2D uSampler;',
+ 'void main(void) {',
+ ' gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;',
+ '}'
+ ];
+
+ this.vertexSrc = [
+ 'attribute vec2 aVertexPosition;',
+ 'attribute vec2 aPositionCoord;',
+ 'attribute vec2 aScale;',
+ 'attribute float aRotation;',
+ 'attribute vec2 aTextureCoord;',
+ 'attribute float aColor;',
+
+ 'uniform vec2 projectionVector;',
+ 'uniform vec2 offsetVector;',
+ 'uniform mat3 uMatrix;',
+
+ 'varying vec2 vTextureCoord;',
+ 'varying float vColor;',
+
+ 'const vec2 center = vec2(-1.0, 1.0);',
+
+ 'void main(void) {',
+ ' vec2 v;',
+ ' vec2 sv = aVertexPosition * aScale;',
+ ' v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);',
+ ' v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);',
+ ' v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;',
+ ' gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);',
+ ' vTextureCoord = aTextureCoord;',
+ // ' vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;',
+ ' vColor = aColor;',
+ '}'
+ ];
+
+
+ /**
+ * @property {number} textureCount - A local texture counter for multi-texture shaders.
+ */
+ this.textureCount = 0;
+
+
+ this.init();
+};
+
+/**
+* @method PIXI.PixiFastShader#init
+*/
+PIXI.PixiFastShader.prototype.init = function()
+{
+
+ var gl = this.gl;
+
+ var program = PIXI.compileProgram(gl, this.vertexSrc, this.fragmentSrc);
+
+ gl.useProgram(program);
+
+ // get and store the uniforms for the shader
+ this.uSampler = gl.getUniformLocation(program, 'uSampler');
+
+ this.projectionVector = gl.getUniformLocation(program, 'projectionVector');
+ this.offsetVector = gl.getUniformLocation(program, 'offsetVector');
+ this.dimensions = gl.getUniformLocation(program, 'dimensions');
+ this.uMatrix = gl.getUniformLocation(program, 'uMatrix');
+
+ // get and store the attributes
+ this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
+ this.aPositionCoord = gl.getAttribLocation(program, 'aPositionCoord');
+
+ this.aScale = gl.getAttribLocation(program, 'aScale');
+ this.aRotation = gl.getAttribLocation(program, 'aRotation');
+
+ this.aTextureCoord = gl.getAttribLocation(program, 'aTextureCoord');
+ this.colorAttribute = gl.getAttribLocation(program, 'aColor');
+
+
+
+ // Begin worst hack eva //
+
+ // WHY??? ONLY on my chrome pixel the line above returns -1 when using filters?
+ // maybe its somthing to do with the current state of the gl context.
+ // Im convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel
+ // If theres any webGL people that know why could happen please help :)
+ if(this.colorAttribute === -1)
+ {
+ this.colorAttribute = 2;
+ }
+
+ this.attributes = [this.aVertexPosition, this.aPositionCoord, this.aScale, this.aRotation, this.aTextureCoord, this.colorAttribute];
+
+ // End worst hack eva //
+
+
+ this.program = program;
+};
+
+PIXI.PixiFastShader.prototype.destroy = function()
+{
+ this.gl.deleteProgram( this.program );
+ this.uniforms = null;
+ this.gl = null;
+
+ this.attributes = null;
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/files/src_pixi_renderers_webgl_shaders_PixiShader.js.html b/docs/files/src_pixi_renderers_webgl_shaders_PixiShader.js.html
index 8ccc2ac..5b75912 100644
--- a/docs/files/src_pixi_renderers_webgl_shaders_PixiShader.js.html
+++ b/docs/files/src_pixi_renderers_webgl_shaders_PixiShader.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -211,6 +217,7 @@ PIXI.PixiShader = function(gl)
*/
this.textureCount = 0;
+ this.attributes = [];
this.init();
};
@@ -242,7 +249,7 @@ PIXI.PixiShader.prototype.init = function()
// Begin worst hack eva //
// WHY??? ONLY on my chrome pixel the line above returns -1 when using filters?
- // maybe its somthing to do with the current state of the gl context.
+ // maybe its something to do with the current state of the gl context.
// Im convinced this is a bug in the chrome browser as there is NO reason why this should be returning -1 especially as it only manifests on my chrome pixel
// If theres any webGL people that know why could happen please help :)
if(this.colorAttribute === -1)
@@ -250,6 +257,8 @@ PIXI.PixiShader.prototype.init = function()
this.colorAttribute = 2;
}
+ this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
+
// End worst hack eva //
// add those custom shaders!
@@ -338,7 +347,7 @@ PIXI.PixiShader.prototype.initUniforms = function()
};
/**
-* Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture is has loaded)
+* Initialises a Sampler2D uniform (which may only be available later on after initUniforms once the texture has loaded)
*
* @method PIXI.PixiShader#initSampler2D
*/
@@ -470,6 +479,15 @@ PIXI.PixiShader.prototype.syncUniforms = function()
};
+PIXI.PixiShader.prototype.destroy = function()
+{
+ this.gl.deleteProgram( this.program );
+ this.uniforms = null;
+ this.gl = null;
+
+ this.attributes = null;
+};
+
PIXI.PixiShader.defaultVertexSrc = [
'attribute vec2 aVertexPosition;',
'attribute vec2 aTextureCoord;',
@@ -493,6 +511,8 @@ PIXI.PixiShader.defaultVertexSrc = [
+
+
diff --git a/docs/files/src_pixi_renderers_webgl_shaders_PrimitiveShader.js.html b/docs/files/src_pixi_renderers_webgl_shaders_PrimitiveShader.js.html
index 67326be..43d5e47 100644
--- a/docs/files/src_pixi_renderers_webgl_shaders_PrimitiveShader.js.html
+++ b/docs/files/src_pixi_renderers_webgl_shaders_PrimitiveShader.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -234,12 +240,23 @@ PIXI.PrimitiveShader.prototype.init = function()
this.aVertexPosition = gl.getAttribLocation(program, 'aVertexPosition');
this.colorAttribute = gl.getAttribLocation(program, 'aColor');
+ this.attributes = [this.aVertexPosition, this.colorAttribute];
+
this.translationMatrix = gl.getUniformLocation(program, 'translationMatrix');
this.alpha = gl.getUniformLocation(program, 'alpha');
this.program = program;
};
+PIXI.PrimitiveShader.prototype.destroy = function()
+{
+ this.gl.deleteProgram( this.program );
+ this.uniforms = null;
+ this.gl = null;
+
+ this.attribute = null;
+};
+
diff --git a/docs/files/src_pixi_renderers_webgl_shaders_StripShader.js.html b/docs/files/src_pixi_renderers_webgl_shaders_StripShader.js.html
index f59c649..0cd6659 100644
--- a/docs/files/src_pixi_renderers_webgl_shaders_StripShader.js.html
+++ b/docs/files/src_pixi_renderers_webgl_shaders_StripShader.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_renderers_webgl_utils_WebGLFastSpriteBatch.js.html b/docs/files/src_pixi_renderers_webgl_utils_WebGLFastSpriteBatch.js.html
new file mode 100644
index 0000000..3044851
--- /dev/null
+++ b/docs/files/src_pixi_renderers_webgl_utils_WebGLFastSpriteBatch.js.html
@@ -0,0 +1,552 @@
+
+
+
+
+
src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js - pixi.js
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Show:
+
+
+ Inherited
+
+
+
+
+ Protected
+
+
+
+
+ Private
+
+
+
+ Deprecated
+
+
+
+
+
+
+
+
+
File: src/pixi/renderers/webgl/utils/WebGLFastSpriteBatch.js
+
+
+
+/**
+ * @author Mat Groves
+ *
+ * Big thanks to the very clever Matt DesLauriers <mattdesl> https://github.com/mattdesl/
+ * for creating the original pixi version!
+ *
+ * Heavily inspired by LibGDX's WebGLSpriteBatch:
+ * https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/WebGLSpriteBatch.java
+ */
+
+PIXI.WebGLFastSpriteBatch = function(gl)
+{
+
+
+ this.vertSize = 10;
+ this.maxSize = 6000;//Math.pow(2, 16) / this.vertSize;
+ this.size = this.maxSize;
+
+ // console.log(this.size);
+ //the total number of floats in our batch
+ var numVerts = this.size * 4 * this.vertSize;
+ //the total number of indices in our batch
+ var numIndices = this.maxSize * 6;
+
+ //vertex data
+ this.vertices = new Float32Array(numVerts);
+ //index data
+ this.indices = new Uint16Array(numIndices);
+
+ this.vertexBuffer = null;
+ this.indexBuffer = null;
+
+ this.lastIndexCount = 0;
+
+ for (var i=0, j=0; i < numIndices; i += 6, j += 4)
+ {
+ this.indices[i + 0] = j + 0;
+ this.indices[i + 1] = j + 1;
+ this.indices[i + 2] = j + 2;
+ this.indices[i + 3] = j + 0;
+ this.indices[i + 4] = j + 2;
+ this.indices[i + 5] = j + 3;
+ }
+
+ this.drawing = false;
+ this.currentBatchSize = 0;
+ this.currentBaseTexture = null;
+
+ this.currentBlendMode = 0;
+ this.renderSession = null;
+
+
+ this.shader = null;
+
+ this.tempMatrix = PIXI.mat3.create();
+
+ this.setContext(gl);
+};
+
+PIXI.WebGLFastSpriteBatch.prototype.setContext = function(gl)
+{
+ this.gl = gl;
+
+ // create a couple of buffers
+ this.vertexBuffer = gl.createBuffer();
+ this.indexBuffer = gl.createBuffer();
+
+ // 65535 is max index, so 65535 / 6 = 10922.
+
+
+ //upload the index data
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
+ gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
+ gl.bufferData(gl.ARRAY_BUFFER, this.vertices, gl.DYNAMIC_DRAW);
+
+ this.currentBlendMode = 99999;
+};
+
+PIXI.WebGLFastSpriteBatch.prototype.begin = function(spriteBatch, renderSession)
+{
+ this.renderSession = renderSession;
+ this.shader = this.renderSession.shaderManager.fastShader;
+
+ PIXI.mat3.transpose(spriteBatch.worldTransform, this.tempMatrix);
+
+ // console.log(this.tempMatrix)
+ this.start();
+};
+
+PIXI.WebGLFastSpriteBatch.prototype.end = function()
+{
+ this.flush();
+};
+
+
+PIXI.WebGLFastSpriteBatch.prototype.render = function(spriteBatch)
+{
+
+ var children = spriteBatch.children;
+ var sprite = children[0];
+
+ // if the uvs have not updated then no point rendering just yet!
+
+ // check texture.
+ if(!sprite.texture._uvs)return;
+
+ this.currentBaseTexture = sprite.texture.baseTexture;
+ // check blend mode
+ if(sprite.blendMode !== this.currentBlendMode)
+ {
+ this.setBlendMode(sprite.blendMode);
+ }
+
+ for(var i=0,j= children.length; i<j; i++)
+ {
+ this.renderSprite(children[i]);
+ }
+
+ this.flush();
+};
+
+PIXI.WebGLFastSpriteBatch.prototype.renderSprite = function(sprite)
+{
+ //sprite = children[i];
+
+ // TODO trim??
+ if(sprite.texture.baseTexture !== this.currentBaseTexture)
+ {
+ this.currentBaseTexture = sprite.texture.baseTexture;
+ this.flush();
+
+ if(!sprite.texture._uvs)return;
+ }
+
+ var uvs, verticies = this.vertices, width, height, w0, w1, h0, h1, index;
+
+ uvs = sprite.texture._uvs;
+
+
+ width = sprite.texture.frame.width;
+ height = sprite.texture.frame.height;
+
+ if (sprite.texture.trimmed)
+ {
+ // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords..
+ var trim = sprite.texture.trim;
+
+ w1 = trim.x - sprite.anchor.x * trim.realWidth;
+ w0 = w1 + sprite.texture.frame.width;
+
+ h1 = trim.y - sprite.anchor.y * trim.realHeight;
+ h0 = h1 + sprite.texture.frame.height;
+ }
+ else
+ {
+ w0 = (sprite.texture.frame.width ) * (1-sprite.anchor.x);
+ w1 = (sprite.texture.frame.width ) * -sprite.anchor.x;
+
+ h0 = sprite.texture.frame.height * (1-sprite.anchor.y);
+ h1 = sprite.texture.frame.height * -sprite.anchor.y;
+ }
+
+ index = this.currentBatchSize * 4 * this.vertSize;
+
+ // xy
+ verticies[index++] = w1;
+ verticies[index++] = h1;
+
+ verticies[index++] = sprite.position.x;
+ verticies[index++] = sprite.position.y;
+
+ //scale
+ verticies[index++] = sprite.scale.x;
+ verticies[index++] = sprite.scale.y;
+
+ //rotation
+ verticies[index++] = sprite.rotation;
+
+ // uv
+ verticies[index++] = uvs[0];
+ verticies[index++] = uvs[1];
+ // color
+ verticies[index++] = sprite.alpha;
+
+
+ // xy
+ verticies[index++] = w0;
+ verticies[index++] = h1;
+
+ verticies[index++] = sprite.position.x;
+ verticies[index++] = sprite.position.y;
+
+ //scale
+ verticies[index++] = sprite.scale.x;
+ verticies[index++] = sprite.scale.y;
+
+ //rotation
+ verticies[index++] = sprite.rotation;
+
+ // uv
+ verticies[index++] = uvs[2];
+ verticies[index++] = uvs[3];
+ // color
+ verticies[index++] = sprite.alpha;
+
+
+ // xy
+ verticies[index++] = w0;
+ verticies[index++] = h0;
+
+ verticies[index++] = sprite.position.x;
+ verticies[index++] = sprite.position.y;
+
+ //scale
+ verticies[index++] = sprite.scale.x;
+ verticies[index++] = sprite.scale.y;
+
+ //rotation
+ verticies[index++] = sprite.rotation;
+
+ // uv
+ verticies[index++] = uvs[4];
+ verticies[index++] = uvs[5];
+ // color
+ verticies[index++] = sprite.alpha;
+
+
+
+
+ // xy
+ verticies[index++] = w1;
+ verticies[index++] = h0;
+
+ verticies[index++] = sprite.position.x;
+ verticies[index++] = sprite.position.y;
+
+ //scale
+ verticies[index++] = sprite.scale.x;
+ verticies[index++] = sprite.scale.y;
+
+ //rotation
+ verticies[index++] = sprite.rotation;
+
+ // uv
+ verticies[index++] = uvs[6];
+ verticies[index++] = uvs[7];
+ // color
+ verticies[index++] = sprite.alpha;
+
+ // increment the batchs
+ this.currentBatchSize++;
+
+ if(this.currentBatchSize >= this.size)
+ {
+ this.flush();
+ }
+};
+
+PIXI.WebGLFastSpriteBatch.prototype.flush = function()
+{
+ // If the batch is length 0 then return as there is nothing to draw
+ if (this.currentBatchSize===0)return;
+
+ var gl = this.gl;
+
+ // bind the current texture
+
+ if(!this.currentBaseTexture._glTextures[gl.id])PIXI.createWebGLTexture(this.currentBaseTexture, gl);
+
+ gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id]);// || PIXI.createWebGLTexture(this.currentBaseTexture, gl));
+
+ // upload the verts to the buffer
+
+
+ if(this.currentBatchSize > ( this.size * 0.5 ) )
+ {
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices);
+ }
+ else
+ {
+ var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize);
+
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, view);
+ }
+
+
+ // now draw those suckas!
+ gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0);
+
+ // then reset the batch!
+ this.currentBatchSize = 0;
+
+ // increment the draw count
+ this.renderSession.drawCount++;
+};
+
+
+PIXI.WebGLFastSpriteBatch.prototype.stop = function()
+{
+ this.flush();
+};
+
+PIXI.WebGLFastSpriteBatch.prototype.start = function()
+{
+ var gl = this.gl;
+
+ // bind the main texture
+ gl.activeTexture(gl.TEXTURE0);
+
+ // bind the buffers
+ gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
+
+ // set the projection
+ var projection = this.renderSession.projection;
+ gl.uniform2f(this.shader.projectionVector, projection.x, projection.y);
+
+ // set the matrix
+ gl.uniformMatrix3fv(this.shader.uMatrix, false, this.tempMatrix);
+
+ // set the pointers
+ var stride = this.vertSize * 4;
+
+ gl.vertexAttribPointer(this.shader.aVertexPosition, 2, gl.FLOAT, false, stride, 0);
+ gl.vertexAttribPointer(this.shader.aPositionCoord, 2, gl.FLOAT, false, stride, 2 * 4);
+ gl.vertexAttribPointer(this.shader.aScale, 2, gl.FLOAT, false, stride, 4 * 4);
+ gl.vertexAttribPointer(this.shader.aRotation, 1, gl.FLOAT, false, stride, 6 * 4);
+ gl.vertexAttribPointer(this.shader.aTextureCoord, 2, gl.FLOAT, false, stride, 7 * 4);
+ gl.vertexAttribPointer(this.shader.colorAttribute, 1, gl.FLOAT, false, stride, 9 * 4);
+
+ // set the blend mode..
+ if(this.currentBlendMode !== PIXI.blendModes.NORMAL)
+ {
+ this.setBlendMode(PIXI.blendModes.NORMAL);
+ }
+};
+
+PIXI.WebGLFastSpriteBatch.prototype.setBlendMode = function(blendMode)
+{
+ this.flush();
+
+ this.currentBlendMode = blendMode;
+
+ var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode];
+ this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]);
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/files/src_pixi_renderers_webgl_utils_WebGLFilterManager.js.html b/docs/files/src_pixi_renderers_webgl_utils_WebGLFilterManager.js.html
index 21e7a95..ed44103 100644
--- a/docs/files/src_pixi_renderers_webgl_utils_WebGLFilterManager.js.html
+++ b/docs/files/src_pixi_renderers_webgl_utils_WebGLFilterManager.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -324,7 +330,7 @@ PIXI.WebGLFilterManager.prototype.popFilter = function()
gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertexArray);
gl.bindBuffer(gl.ARRAY_BUFFER, this.uvBuffer);
- // nnow set the uvs..
+ // now set the uvs..
this.uvArray[2] = filterArea.width/this.width;
this.uvArray[5] = filterArea.height/this.height;
this.uvArray[6] = filterArea.width/this.width;
@@ -336,7 +342,7 @@ PIXI.WebGLFilterManager.prototype.popFilter = function()
var outputTexture = this.texturePool.pop();
if(!outputTexture)outputTexture = new PIXI.FilterTexture(this.gl, this.width, this.height);
- // need to clear this FBO as it may have some left over elements from a prvious filter.
+ // need to clear this FBO as it may have some left over elements from a previous filter.
gl.bindFramebuffer(gl.FRAMEBUFFER, outputTexture.frameBuffer );
gl.clear(gl.COLOR_BUFFER_BIT);
@@ -531,7 +537,7 @@ PIXI.WebGLFilterManager.prototype.initShaderBuffers = function()
// bind and upload the vertexs..
- // keep a refferance to the vertexFloatData..
+ // keep a reference to the vertexFloatData..
this.vertexArray = new Float32Array([0.0, 0.0,
1.0, 0.0,
0.0, 1.0,
@@ -575,6 +581,29 @@ PIXI.WebGLFilterManager.prototype.initShaderBuffers = function()
gl.STATIC_DRAW);
};
+PIXI.WebGLFilterManager.prototype.destroy = function()
+{
+ var gl = this.gl;
+
+ this.filterStack = null;
+
+ this.offsetX = 0;
+ this.offsetY = 0;
+
+ // destroy textures
+ for (var i = 0; i < this.texturePool.length; i++) {
+ this.texturePool.destroy();
+ }
+
+ this.texturePool = null;
+
+ //destroy buffers..
+ gl.deleteBuffer(this.vertexBuffer);
+ gl.deleteBuffer(this.uvBuffer);
+ gl.deleteBuffer(this.colorBuffer);
+ gl.deleteBuffer(this.indexBuffer);
+};
+
PIXI.FilterTexture = function(gl, width, height)
{
this.gl = gl;
@@ -618,6 +647,17 @@ PIXI.FilterTexture.prototype.resize = function(width, height)
};
+PIXI.FilterTexture.prototype.destroy = function()
+{
+ var gl = this.gl;
+ gl.deleteFramebuffer( this.frameBuffer );
+ gl.deleteTexture( this.texture );
+
+ this.frameBuffer = null;
+ this.texture = null;
+};
+
+
diff --git a/docs/files/src_pixi_renderers_webgl_utils_WebGLGraphics.js.html b/docs/files/src_pixi_renderers_webgl_utils_WebGLGraphics.js.html
index 8048df0..b6a8ced 100644
--- a/docs/files/src_pixi_renderers_webgl_utils_WebGLGraphics.js.html
+++ b/docs/files/src_pixi_renderers_webgl_utils_WebGLGraphics.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -229,15 +235,15 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, renderSession)//projectio
renderSession.shaderManager.activatePrimitiveShader();
- // This could be speeded up fo sure!
- var m = PIXI.mat3.clone(graphics.worldTransform);
+ // This could be speeded up for sure!
+ // var m = PIXI.mat3.clone(graphics.worldTransform);
- PIXI.mat3.transpose(m);
+ PIXI.mat3.transpose(graphics.worldTransform, PIXI.tempMatrix);
- // set the matrix transform for the
+ // set the matrix transform
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
- gl.uniformMatrix3fv(shader.translationMatrix, false, m);
+ gl.uniformMatrix3fv(shader.translationMatrix, false, PIXI.tempMatrix);
gl.uniform2f(shader.projectionVector, projection.x, -projection.y);
gl.uniform2f(shader.offsetVector, -offset.x, -offset.y);
@@ -369,13 +375,18 @@ PIXI.WebGLGraphics.buildRectangle = function(graphicsData, webGLData)
if(graphicsData.lineWidth)
{
+ var tempPoints = graphicsData.points;
+
graphicsData.points = [x, y,
x + width, y,
x + width, y + height,
x, y + height,
x, y];
+
PIXI.WebGLGraphics.buildLine(graphicsData, webGLData);
+
+ graphicsData.points = tempPoints;
}
};
@@ -436,6 +447,8 @@ PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData)
if(graphicsData.lineWidth)
{
+ var tempPoints = graphicsData.points;
+
graphicsData.points = [];
for (i = 0; i < totalSegs + 1; i++)
@@ -445,6 +458,8 @@ PIXI.WebGLGraphics.buildCircle = function(graphicsData, webGLData)
}
PIXI.WebGLGraphics.buildLine(graphicsData, webGLData);
+
+ graphicsData.points = tempPoints;
}
};
@@ -477,7 +492,7 @@ PIXI.WebGLGraphics.buildLine = function(graphicsData, webGLData)
var firstPoint = new PIXI.Point( points[0], points[1] );
var lastPoint = new PIXI.Point( points[points.length - 2], points[points.length - 1] );
- // if the first point is the last point - goona have issues :)
+ // if the first point is the last point - gonna have issues :)
if(firstPoint.x === lastPoint.x && firstPoint.y === lastPoint.y)
{
points.pop();
diff --git a/docs/files/src_pixi_renderers_webgl_utils_WebGLMaskManager.js.html b/docs/files/src_pixi_renderers_webgl_utils_WebGLMaskManager.js.html
index 6c71672..f14e2c9 100644
--- a/docs/files/src_pixi_renderers_webgl_utils_WebGLMaskManager.js.html
+++ b/docs/files/src_pixi_renderers_webgl_utils_WebGLMaskManager.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -205,7 +211,7 @@ PIXI.WebGLMaskManager.prototype.pushMask = function(maskData, renderSession)
this.maskStack.push(maskData);
- gl.colorMask(false, false, false, false);
+ gl.colorMask(false, false, false, true);
gl.stencilOp(gl.KEEP,gl.KEEP,gl.INCR);
PIXI.WebGLGraphics.renderGraphics(maskData, renderSession);
@@ -237,6 +243,12 @@ PIXI.WebGLMaskManager.prototype.popMask = function(renderSession)
if(this.maskStack.length === 0)gl.disable(gl.STENCIL_TEST);
};
+
+PIXI.WebGLMaskManager.prototype.destroy = function()
+{
+ this.maskStack = null;
+ this.gl = null;
+};
diff --git a/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderManager.js.html b/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderManager.js.html
index 7831eaf..b3eca8c 100644
--- a/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderManager.js.html
+++ b/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderManager.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -180,8 +186,16 @@
PIXI.WebGLShaderManager = function(gl)
{
- this.setContext(gl);
+ this.maxAttibs = 10;
+ this.attribState = [];
+ this.tempAttribState = [];
+
+ for (var i = 0; i < this.maxAttibs; i++) {
+ this.attribState[i] = false;
+ }
+
+ this.setContext(gl);
// the final one is used for the rendering strips
//this.stripShader = new PIXI.StripShader(gl);
};
@@ -196,15 +210,66 @@ PIXI.WebGLShaderManager.prototype.setContext = function(gl)
// this shader is used for the default sprite rendering
this.defaultShader = new PIXI.PixiShader(gl);
- var shaderProgram = this.defaultShader.program;
+ // this shader is used for the fast sprite rendering
+ this.fastShader = new PIXI.PixiFastShader(gl);
- gl.useProgram(shaderProgram);
- gl.enableVertexAttribArray(this.defaultShader.aVertexPosition);
- gl.enableVertexAttribArray(this.defaultShader.colorAttribute);
- gl.enableVertexAttribArray(this.defaultShader.aTextureCoord);
+ this.activateShader(this.defaultShader);
+};
-
+
+PIXI.WebGLShaderManager.prototype.setAttribs = function(attribs)
+{
+ // reset temp state
+
+ var i;
+
+ for (i = 0; i < this.tempAttribState.length; i++)
+ {
+ this.tempAttribState[i] = false;
+ }
+
+ // set the new attribs
+ for (i = 0; i < attribs.length; i++)
+ {
+ var attribId = attribs[i];
+ this.tempAttribState[attribId] = true;
+ }
+
+ var gl = this.gl;
+
+ for (i = 0; i < this.attribState.length; i++)
+ {
+
+ if(this.attribState[i] !== this.tempAttribState[i])
+ {
+ this.attribState[i] = this.tempAttribState[i];
+
+ if(this.tempAttribState[i])
+ {
+ gl.enableVertexAttribArray(i);
+ }
+ else
+ {
+ gl.disableVertexAttribArray(i);
+ }
+ }
+ }
+
+ // console.log(this.tempAttribState)
+};
+
+PIXI.WebGLShaderManager.prototype.activateShader = function(shader)
+{
+ //if(this.currentShader == shader)return;
+
+ this.currentShader = shader;
+ // console.log(shader.program)
+ this.gl.useProgram(shader.program);
+ this.setAttribs(shader.attributes);
+
+ // console.log(shader.attributes)
+
};
PIXI.WebGLShaderManager.prototype.activatePrimitiveShader = function()
@@ -213,12 +278,8 @@ PIXI.WebGLShaderManager.prototype.activatePrimitiveShader = function()
gl.useProgram(this.primitiveShader.program);
- gl.disableVertexAttribArray(this.defaultShader.aVertexPosition);
- gl.disableVertexAttribArray(this.defaultShader.colorAttribute);
- gl.disableVertexAttribArray(this.defaultShader.aTextureCoord);
-
- gl.enableVertexAttribArray(this.primitiveShader.aVertexPosition);
- gl.enableVertexAttribArray(this.primitiveShader.colorAttribute);
+ this.setAttribs(this.primitiveShader.attributes);
+
};
PIXI.WebGLShaderManager.prototype.deactivatePrimitiveShader = function()
@@ -227,13 +288,25 @@ PIXI.WebGLShaderManager.prototype.deactivatePrimitiveShader = function()
gl.useProgram(this.defaultShader.program);
- gl.disableVertexAttribArray(this.primitiveShader.aVertexPosition);
- gl.disableVertexAttribArray(this.primitiveShader.colorAttribute);
-
- gl.enableVertexAttribArray(this.defaultShader.aVertexPosition);
- gl.enableVertexAttribArray(this.defaultShader.colorAttribute);
- gl.enableVertexAttribArray(this.defaultShader.aTextureCoord);
+ this.setAttribs(this.defaultShader.attributes);
};
+
+PIXI.WebGLShaderManager.prototype.destroy = function()
+{
+ this.attribState = null;
+
+ this.tempAttribState = null;
+
+ this.primitiveShader.destroy();
+
+ this.defaultShader.destroy();
+
+ this.fastShader.destroy();
+
+ this.gl = null;
+};
+
+
diff --git a/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderUtils.js.html b/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderUtils.js.html
index 632a520..2eaab20 100644
--- a/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderUtils.js.html
+++ b/docs/files/src_pixi_renderers_webgl_utils_WebGLShaderUtils.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_renderers_webgl_utils_WebGLSpriteBatch.js.html b/docs/files/src_pixi_renderers_webgl_utils_WebGLSpriteBatch.js.html
index b4bbd80..ce871ce 100644
--- a/docs/files/src_pixi_renderers_webgl_utils_WebGLSpriteBatch.js.html
+++ b/docs/files/src_pixi_renderers_webgl_utils_WebGLSpriteBatch.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -188,9 +194,10 @@ PIXI.WebGLSpriteBatch = function(gl)
{
- this.size = 2000;
this.vertSize = 6;
+ this.size = 10000;//Math.pow(2, 16) / this.vertSize;
+ // console.log(this.size);
//the total number of floats in our batch
var numVerts = this.size * 4 * this.vertSize;
//the total number of indices in our batch
@@ -363,7 +370,7 @@ PIXI.WebGLSpriteBatch.prototype.render = function(sprite)
verticies[index++] = alpha;
verticies[index++] = tint;
- // increment the batchs
+ // increment the batchsize
this.currentBatchSize++;
@@ -371,7 +378,7 @@ PIXI.WebGLSpriteBatch.prototype.render = function(sprite)
PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite)
{
- var texture = tilingSprite.texture;
+ var texture = tilingSprite.tilingTexture;
if(texture.baseTexture !== this.currentBaseTexture || this.currentBatchSize >= this.size)
{
@@ -386,7 +393,7 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite)
}
// set the textures uvs temporarily
- // TODO create a seperate texture so that we can tile part of a texture
+ // TODO create a separate texture so that we can tile part of a texture
if(!tilingSprite._uvs)tilingSprite._uvs = new Float32Array(8);
@@ -395,8 +402,8 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite)
var offsetX = tilingSprite.tilePosition.x/texture.baseTexture.width;
var offsetY = tilingSprite.tilePosition.y/texture.baseTexture.height;
- var scaleX = (tilingSprite.width / texture.baseTexture.width) / tilingSprite.tileScale.x;
- var scaleY = (tilingSprite.height / texture.baseTexture.height) / tilingSprite.tileScale.y;
+ var scaleX = (tilingSprite.width / texture.baseTexture.width) / (tilingSprite.tileScale.x * tilingSprite.tileScaleOffset.x);
+ var scaleY = (tilingSprite.height / texture.baseTexture.height) / (tilingSprite.tileScale.y * tilingSprite.tileScaleOffset.y);
uvs[0] = 0 - offsetX;
uvs[1] = 0 - offsetY;
@@ -495,8 +502,20 @@ PIXI.WebGLSpriteBatch.prototype.flush = function()
gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id] || PIXI.createWebGLTexture(this.currentBaseTexture, gl));
// upload the verts to the buffer
- var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize);
- gl.bufferSubData(gl.ARRAY_BUFFER, 0, view);
+
+ if(this.currentBatchSize > ( this.size * 0.5 ) )
+ {
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices);
+ }
+ else
+ {
+ var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize);
+
+ gl.bufferSubData(gl.ARRAY_BUFFER, 0, view);
+ }
+
+ // var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize);
+ //gl.bufferSubData(gl.ARRAY_BUFFER, 0, view);
// now draw those suckas!
gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0);
@@ -552,6 +571,19 @@ PIXI.WebGLSpriteBatch.prototype.setBlendMode = function(blendMode)
this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]);
};
+PIXI.WebGLSpriteBatch.prototype.destroy = function()
+{
+
+ this.vertices = null;
+ this.indices = null;
+
+ this.gl.deleteBuffer( this.vertexBuffer );
+ this.gl.deleteBuffer( this.indexBuffer );
+
+ this.currentBaseTexture = null;
+
+ this.gl = null;
+};
diff --git a/docs/files/src_pixi_text_BitmapText.js.html b/docs/files/src_pixi_text_BitmapText.js.html
index fba5af9..b0ccd71 100644
--- a/docs/files/src_pixi_text_BitmapText.js.html
+++ b/docs/files/src_pixi_text_BitmapText.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -190,7 +196,7 @@
* @param text {String} The copy that you would like the text to display
* @param style {Object} The style parameters
* @param style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)
- * @param [style.align='left'] {String} An alignment of the multiline text ('left', 'center' or 'right')
+ * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
*/
PIXI.BitmapText = function(text, style)
{
@@ -224,7 +230,7 @@ PIXI.BitmapText.prototype.setText = function(text)
* @method setStyle
* @param style {Object} The style parameters
* @param style.font {String} The size (optional) and bitmap font id (required) eq 'Arial' or '20px Arial' (must have loaded previously)
- * @param [style.align='left'] {String} An alignment of the multiline text ('left', 'center' or 'right')
+ * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
*/
PIXI.BitmapText.prototype.setStyle = function(style)
{
@@ -315,7 +321,7 @@ PIXI.BitmapText.prototype.updateText = function()
};
/**
- * Updates the transfor of this object
+ * Updates the transform of this object
*
* @method updateTransform
* @private
diff --git a/docs/files/src_pixi_text_Text.js.html b/docs/files/src_pixi_text_Text.js.html
index 859d6fe..b6e758b 100644
--- a/docs/files/src_pixi_text_Text.js.html
+++ b/docs/files/src_pixi_text_Text.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -179,7 +185,7 @@
*/
/**
- * A Text Object will create a line(s) of text to split a line you can use '\n'
+ * A Text Object will create a line(s) of text. To split a line you can use '\n'
*
* @class Text
* @extends Sprite
@@ -188,7 +194,7 @@
* @param [style] {Object} The style parameters
* @param [style.font] {String} default 'bold 20pt Arial' The style and size of the font
* @param [style.fill='black'] {Object} A canvas fillstyle that will be used on the text eg 'red', '#00FF00'
- * @param [style.align='left'] {String} An alignment of the multiline text ('left', 'center' or 'right')
+ * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
* @param [style.stroke] {String} A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00'
* @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke)
* @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used
@@ -218,7 +224,7 @@ PIXI.Text.prototype.constructor = PIXI.Text;
* @param [style] {Object} The style parameters
* @param [style.font='bold 20pt Arial'] {String} The style and size of the font
* @param [style.fill='black'] {Object} A canvas fillstyle that will be used on the text eg 'red', '#00FF00'
- * @param [style.align='left'] {String} An alignment of the multiline text ('left', 'center' or 'right')
+ * @param [style.align='left'] {String} Alignment for multiline text ('left', 'center' or 'right'), does not affect single line text
* @param [style.stroke='black'] {String} A canvas fillstyle that will be used on the text stroke eg 'blue', '#FCFF00'
* @param [style.strokeThickness=0] {Number} A number that represents the thickness of the stroke. Default is 0 (no stroke)
* @param [style.wordWrap=false] {Boolean} Indicates if word wrap should be used
@@ -248,6 +254,7 @@ PIXI.Text.prototype.setText = function(text)
{
this.text = text.toString() || ' ';
this.dirty = true;
+
};
/**
@@ -284,6 +291,8 @@ PIXI.Text.prototype.updateText = function()
var lineHeight = this.determineFontHeight('font: ' + this.style.font + ';') + this.style.strokeThickness;
this.canvas.height = lineHeight * lines.length;
+ if(navigator.isCocoonJS) this.context.clearRect(0,0,this.canvas.width,this.canvas.height);
+
//set canvas text styles
this.context.fillStyle = this.style.fill;
this.context.font = this.style.font;
@@ -337,11 +346,22 @@ PIXI.Text.prototype.updateTexture = function()
this._width = this.canvas.width;
this._height = this.canvas.height;
- PIXI.texturesToUpdate.push(this.texture.baseTexture);
+ this.requiresUpdate = true;
+};
+
+PIXI.Text.prototype._renderWebGL = function(renderSession)
+{
+ if(this.requiresUpdate)
+ {
+ this.requiresUpdate = false;
+ PIXI.updateWebGLTexture(this.texture.baseTexture, renderSession.gl);
+ }
+
+ PIXI.Sprite.prototype._renderWebGL.call(this, renderSession);
};
/**
- * Updates the transfor of this object
+ * Updates the transform of this object
*
* @method updateTransform
* @private
diff --git a/docs/files/src_pixi_textures_BaseTexture.js.html b/docs/files/src_pixi_textures_BaseTexture.js.html
index 94ef18d..7204049 100644
--- a/docs/files/src_pixi_textures_BaseTexture.js.html
+++ b/docs/files/src_pixi_textures_BaseTexture.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -182,6 +188,8 @@ PIXI.BaseTextureCache = {};
PIXI.texturesToUpdate = [];
PIXI.texturesToDestroy = [];
+PIXI.BaseTextureCacheIdGenerator = 0;
+
/**
* A texture stores the information that represents an image. All textures have a base texture
*
@@ -215,10 +223,10 @@ PIXI.BaseTexture = function(source, scaleMode)
/**
* The scale mode to apply when scaling this texture
* @property scaleMode
- * @type PIXI.BaseTexture.SCALE_MODE
- * @default PIXI.BaseTexture.SCALE_MODE.LINEAR
+ * @type PIXI.scaleModes
+ * @default PIXI.scaleModes.LINEAR
*/
- this.scaleMode = scaleMode || PIXI.BaseTexture.SCALE_MODE.DEFAULT;
+ this.scaleMode = scaleMode || PIXI.scaleModes.DEFAULT;
/**
* [read-only] Describes if the base texture has loaded or not
@@ -278,6 +286,8 @@ PIXI.BaseTexture = function(source, scaleMode)
this.imageUrl = null;
this._powerOf2 = false;
+ //TODO will be used for futer pixi 1.5...
+ this.id = PIXI.BaseTextureCacheIdGenerator++;
// used for webGL
this._glTextures = [];
@@ -319,7 +329,7 @@ PIXI.BaseTexture.prototype.updateSourceImage = function(newSrc)
/**
* Helper function that returns a base texture based on an image url
- * If the image is not in the base texture cache it will be created and loaded
+ * If the image is not in the base texture cache it will be created and loaded
*
* @static
* @method fromImage
@@ -329,6 +339,8 @@ PIXI.BaseTexture.prototype.updateSourceImage = function(newSrc)
PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode)
{
var baseTexture = PIXI.BaseTextureCache[imageUrl];
+ crossorigin = !crossorigin;
+
if(!baseTexture)
{
// new Image() breaks tex loading in some versions of Chrome.
@@ -347,11 +359,26 @@ PIXI.BaseTexture.fromImage = function(imageUrl, crossorigin, scaleMode)
return baseTexture;
};
-PIXI.BaseTexture.SCALE_MODE = {
- DEFAULT: 0, //default to LINEAR
- LINEAR: 0,
- NEAREST: 1
+PIXI.BaseTexture.fromCanvas = function(canvas, scaleMode)
+{
+ if(!canvas._pixiId)
+ {
+ canvas._pixiId = 'canvas_' + PIXI.TextureCacheIdGenerator++;
+ }
+
+ var baseTexture = PIXI.BaseTextureCache[canvas._pixiId];
+
+ if(!baseTexture)
+ {
+ baseTexture = new PIXI.BaseTexture(canvas, scaleMode);
+ PIXI.BaseTextureCache[canvas._pixiId] = baseTexture;
+ }
+
+ return baseTexture;
};
+
+
+
diff --git a/docs/files/src_pixi_textures_RenderTexture.js.html b/docs/files/src_pixi_textures_RenderTexture.js.html
index a93d444..6da9b33 100644
--- a/docs/files/src_pixi_textures_RenderTexture.js.html
+++ b/docs/files/src_pixi_textures_RenderTexture.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -181,7 +187,7 @@
/**
A RenderTexture is a special texture that allows any pixi displayObject to be rendered to it.
- __Hint__: All DisplayObjects (exmpl. Sprites) that renders on RenderTexture should be preloaded.
+ __Hint__: All DisplayObjects (exmpl. Sprites) that render on RenderTexture should be preloaded.
Otherwise black rectangles will be drawn instead.
RenderTexture takes snapshot of DisplayObject passed to render method. If DisplayObject is passed to render method, position and rotation of it will be ignored. For example:
@@ -213,7 +219,7 @@ PIXI.RenderTexture = function(width, height, renderer)
this.width = width || 100;
this.height = height || 100;
- this.indetityMatrix = PIXI.mat3.create();
+ this.identityMatrix = PIXI.mat3.create();
this.frame = new PIXI.Rectangle(0, 0, this.width, this.height);
@@ -300,7 +306,7 @@ PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, position, cle
//TODO -? create a new one??? dont think so!
var originalWorldTransform = displayObject.worldTransform;
- displayObject.worldTransform = PIXI.mat3.create();//sthis.indetityMatrix;
+ displayObject.worldTransform = PIXI.mat3.create();//this.identityMatrix;
// modify to flip...
displayObject.worldTransform[4] = -1;
displayObject.worldTransform[5] = this.projection.y * -2;
@@ -311,17 +317,16 @@ PIXI.RenderTexture.prototype.renderWebGL = function(displayObject, position, cle
displayObject.worldTransform[5] -= position.y;
}
- PIXI.visibleCount++;
- displayObject.vcount = PIXI.visibleCount;
-
for(var i=0,j=children.length; i<j; i++)
{
children[i].updateTransform();
}
+ // update the textures!
+ PIXI.WebGLRenderer.updateTextures();
//
- this.renderer.renderDisplayObject(displayObject, this.projection);
+ this.renderer.renderDisplayObject(displayObject, this.projection, this.textureBuffer.frameBuffer);
displayObject.worldTransform = originalWorldTransform;
};
diff --git a/docs/files/src_pixi_textures_Texture.js.html b/docs/files/src_pixi_textures_Texture.js.html
index f85adf6..d97114b 100644
--- a/docs/files/src_pixi_textures_Texture.js.html
+++ b/docs/files/src_pixi_textures_Texture.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -181,6 +187,8 @@
PIXI.TextureCache = {};
PIXI.FrameCache = {};
+PIXI.TextureCacheIdGenerator = 0;
+
/**
* A texture stores the information that represents an image or part of an image. It cannot be added
* to the display list directly. To do this use PIXI.Sprite. If no frame is provided then the whole image is used
@@ -295,6 +303,8 @@ PIXI.Texture.prototype.setFrame = function(frame)
this.updateFrame = true;
PIXI.Texture.frameUpdates.push(this);
+
+
//this.dispatchEvent( { type: 'update', content: this } );
};
@@ -354,7 +364,7 @@ PIXI.Texture.fromImage = function(imageUrl, crossorigin, scaleMode)
PIXI.Texture.fromFrame = function(frameId)
{
var texture = PIXI.TextureCache[frameId];
- if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache ' + this);
+ if(!texture) throw new Error('The frameId "' + frameId + '" does not exist in the texture cache ');
return texture;
};
@@ -369,8 +379,10 @@ PIXI.Texture.fromFrame = function(frameId)
*/
PIXI.Texture.fromCanvas = function(canvas, scaleMode)
{
- var baseTexture = new PIXI.BaseTexture(canvas, scaleMode);
- return new PIXI.Texture(baseTexture);
+ var baseTexture = PIXI.BaseTexture.fromCanvas(canvas, scaleMode);
+
+ return new PIXI.Texture( baseTexture );
+
};
@@ -405,8 +417,6 @@ PIXI.Texture.removeTextureFromCache = function(id)
// this is more for webGL.. it contains updated frames..
PIXI.Texture.frameUpdates = [];
-PIXI.Texture.SCALE_MODE = PIXI.BaseTexture.SCALE_MODE;
-
diff --git a/docs/files/src_pixi_utils_Detector.js.html b/docs/files/src_pixi_utils_Detector.js.html
index f914f37..5fb73cd 100644
--- a/docs/files/src_pixi_utils_Detector.js.html
+++ b/docs/files/src_pixi_utils_Detector.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -180,7 +186,7 @@
/**
* This helper function will automatically detect which renderer you should be using.
- * WebGL is the preferred renderer as it is a lot fastest. If webGL is not supported by
+ * WebGL is the preferred renderer as it is a lot faster. If webGL is not supported by
* the browser then this function will return a canvas renderer
*
* @method autoDetectRenderer
@@ -207,13 +213,15 @@ PIXI.autoDetectRenderer = function(width, height, view, transparent, antialias)
}
} )();
- if(webgl)
+ // used to detect ie 11 - no longer required
+ /* if(webgl)
{
var ie = (navigator.userAgent.toLowerCase().indexOf('trident') !== -1);
webgl = !ie;
}
+ */
+
- //console.log(webgl);
if( webgl )
{
return new PIXI.WebGLRenderer(width, height, view, transparent, antialias);
diff --git a/docs/files/src_pixi_utils_EventTarget.js.html b/docs/files/src_pixi_utils_EventTarget.js.html
index a26bd08..72b83ae 100644
--- a/docs/files/src_pixi_utils_EventTarget.js.html
+++ b/docs/files/src_pixi_utils_EventTarget.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_utils_Polyk.js.html b/docs/files/src_pixi_utils_Polyk.js.html
index 3eb6627..727d576 100644
--- a/docs/files/src_pixi_utils_Polyk.js.html
+++ b/docs/files/src_pixi_utils_Polyk.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/files/src_pixi_utils_Utils.js.html b/docs/files/src_pixi_utils_Utils.js.html
index cbc58db..10b80e3 100644
--- a/docs/files/src_pixi_utils_Utils.js.html
+++ b/docs/files/src_pixi_utils_Utils.js.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/index.html b/docs/index.html
index 9a3761f..a6e62c7 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
diff --git a/docs/modules/PIXI.html b/docs/modules/PIXI.html
index 78eec29..53fca64 100644
--- a/docs/modules/PIXI.html
+++ b/docs/modules/PIXI.html
@@ -19,7 +19,7 @@
- API Docs for: 1.4.0
+ API Docs for: 1.4.3
@@ -73,6 +73,8 @@
DisplayObjectContainer
+
DotScreenFilter
+
Ellipse
EventTarget
@@ -91,6 +93,8 @@
PixelateFilter
+
PIXI.PixiFastShader
+
PIXI.PixiShader
Point
@@ -115,9 +119,9 @@
Spine
-
SpriteSheetLoader
+
Sprite
-
Sprite™
+
SpriteSheetLoader
Stage
@@ -127,6 +131,8 @@
TilingSprite
+
TwistFilter
+
WebGLRenderer
@@ -178,7 +184,7 @@
@@ -296,6 +302,12 @@
+
+
+ DotScreenFilter
+
+
+
Ellipse
@@ -350,6 +362,12 @@
+
+
+ PIXI.PixiFastShader
+
+
+
PIXI.PixiShader
@@ -423,14 +441,14 @@
-
- SpriteSheetLoader
+
+ Sprite
-
- Sprite™
+
+ SpriteSheetLoader
@@ -458,6 +476,12 @@
+
+
+ TwistFilter
+
+
+
WebGLRenderer
diff --git a/src/pixi/InteractionManager.js b/src/pixi/InteractionManager.js
index 16052ec..25e8ddf 100644
--- a/src/pixi/InteractionManager.js
+++ b/src/pixi/InteractionManager.js
@@ -125,7 +125,7 @@ PIXI.InteractionManager.prototype.setTarget = function(target)
this.setTargetDomElement( target.view );
}
- document.body.addEventListener('mouseup', this.onMouseUp, true);
+
};
@@ -141,20 +141,8 @@ PIXI.InteractionManager.prototype.setTarget = function(target)
PIXI.InteractionManager.prototype.setTargetDomElement = function(domElement)
{
//remove previouse listeners
- if( this.interactionDOMElement !== null )
- {
- this.interactionDOMElement.style['-ms-content-zooming'] = '';
- this.interactionDOMElement.style['-ms-touch-action'] = '';
- this.interactionDOMElement.removeEventListener('mousemove', this.onMouseMove, true);
- this.interactionDOMElement.removeEventListener('mousedown', this.onMouseDown, true);
- this.interactionDOMElement.removeEventListener('mouseout', this.onMouseOut, true);
-
- // aint no multi touch just yet!
- this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true);
- this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true);
- this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true);
- }
+ this.removeEvents();
if (window.navigator.msPointerEnabled)
@@ -176,6 +164,31 @@ PIXI.InteractionManager.prototype.setTargetDomElement = function(domElement)
domElement.addEventListener('touchstart', this.onTouchStart, true);
domElement.addEventListener('touchend', this.onTouchEnd, true);
domElement.addEventListener('touchmove', this.onTouchMove, true);
+
+ document.body.addEventListener('mouseup', this.onMouseUp, true);
+};
+
+
+PIXI.InteractionManager.prototype.removeEvents = function()
+{
+ if(!this.interactionDOMElement)return;
+
+ console.log( this.interactionDOMElement)
+ this.interactionDOMElement.style['-ms-content-zooming'] = '';
+ this.interactionDOMElement.style['-ms-touch-action'] = '';
+
+ this.interactionDOMElement.removeEventListener('mousemove', this.onMouseMove, true);
+ this.interactionDOMElement.removeEventListener('mousedown', this.onMouseDown, true);
+ this.interactionDOMElement.removeEventListener('mouseout', this.onMouseOut, true);
+
+ // aint no multi touch just yet!
+ this.interactionDOMElement.removeEventListener('touchstart', this.onTouchStart, true);
+ this.interactionDOMElement.removeEventListener('touchend', this.onTouchEnd, true);
+ this.interactionDOMElement.removeEventListener('touchmove', this.onTouchMove, true);
+
+ this.interactionDOMElement = null;
+
+ document.body.removeEventListener('mouseup', this.onMouseUp, true);
};
/**
diff --git a/src/pixi/display/SpriteBatch.js b/src/pixi/display/SpriteBatch.js
index a6ab59c..54975c7 100644
--- a/src/pixi/display/SpriteBatch.js
+++ b/src/pixi/display/SpriteBatch.js
@@ -95,6 +95,8 @@ PIXI.SpriteBatch.prototype._renderCanvas = function(renderSession)
var texture = child.texture;
var frame = texture.frame;
+ context.globalAlpha = this.worldAlpha * child.alpha;
+
if(child.rotation % (Math.PI * 2) === 0)
{
diff --git a/src/pixi/renderers/webgl/WebGLRenderer.js b/src/pixi/renderers/webgl/WebGLRenderer.js
index 0839dc7..3edbd33 100644
--- a/src/pixi/renderers/webgl/WebGLRenderer.js
+++ b/src/pixi/renderers/webgl/WebGLRenderer.js
@@ -172,6 +172,8 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
// if rendering a new stage clear the batches..
if(this.__stage !== stage)
{
+ if(stage.interactive)stage.interactionManager.removeEvents();
+
// TODO make this work
// dont think this is needed any more?
this.__stage = stage;
@@ -219,6 +221,14 @@ PIXI.WebGLRenderer.prototype.render = function(stage)
stage.interactionManager.setTarget(this);
}
}
+ else
+ {
+ if(stage._interactiveEventsAdded)
+ {
+ stage._interactiveEventsAdded = false;
+ stage.interactionManager.setTarget(this);
+ }
+ }
/*
//can simulate context loss in Chrome like so: