diff --git a/package.json b/package.json index 3706307..766e7eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "3.0.9-dev", + "version": "3.0.10-dev", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", "contributors": [ @@ -30,13 +30,12 @@ "README.md" ], "dependencies": { - "async": "^1.4.2", + "async": "^1.5.0", "brfs": "^1.4.1", - "earcut": "^2.0.2", + "earcut": "^2.0.7", "eventemitter3": "^1.1.1", - "gulp-header": "^1.7.1", "object-assign": "^4.0.1", - "resource-loader": "^1.6.2" + "resource-loader": "^1.6.4" }, "devDependencies": { "browserify": "^11.1.0", @@ -46,6 +45,7 @@ "gulp-cached": "^1.1.0", "gulp-concat": "^2.6.0", "gulp-debug": "^2.1.0", + "gulp-header": "^1.7.1", "gulp-jshint": "^1.11.2", "gulp-mirror": "^0.4.0", "gulp-plumber": "^1.0.1", diff --git a/package.json b/package.json index 3706307..766e7eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "3.0.9-dev", + "version": "3.0.10-dev", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", "contributors": [ @@ -30,13 +30,12 @@ "README.md" ], "dependencies": { - "async": "^1.4.2", + "async": "^1.5.0", "brfs": "^1.4.1", - "earcut": "^2.0.2", + "earcut": "^2.0.7", "eventemitter3": "^1.1.1", - "gulp-header": "^1.7.1", "object-assign": "^4.0.1", - "resource-loader": "^1.6.2" + "resource-loader": "^1.6.4" }, "devDependencies": { "browserify": "^11.1.0", @@ -46,6 +45,7 @@ "gulp-cached": "^1.1.0", "gulp-concat": "^2.6.0", "gulp-debug": "^2.1.0", + "gulp-header": "^1.7.1", "gulp-jshint": "^1.11.2", "gulp-mirror": "^0.4.0", "gulp-plumber": "^1.0.1", diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index afbb360..3bf301a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -220,6 +220,8 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * + * @todo For the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ @@ -525,7 +527,7 @@ * @param [pivotY=0] {number} The Y pivot value * @return {PIXI.DisplayObject} */ -DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) +DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { this.position.x = x || 0; this.position.y = y || 0; diff --git a/package.json b/package.json index 3706307..766e7eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "3.0.9-dev", + "version": "3.0.10-dev", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", "contributors": [ @@ -30,13 +30,12 @@ "README.md" ], "dependencies": { - "async": "^1.4.2", + "async": "^1.5.0", "brfs": "^1.4.1", - "earcut": "^2.0.2", + "earcut": "^2.0.7", "eventemitter3": "^1.1.1", - "gulp-header": "^1.7.1", "object-assign": "^4.0.1", - "resource-loader": "^1.6.2" + "resource-loader": "^1.6.4" }, "devDependencies": { "browserify": "^11.1.0", @@ -46,6 +45,7 @@ "gulp-cached": "^1.1.0", "gulp-concat": "^2.6.0", "gulp-debug": "^2.1.0", + "gulp-header": "^1.7.1", "gulp-jshint": "^1.11.2", "gulp-mirror": "^0.4.0", "gulp-plumber": "^1.0.1", diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index afbb360..3bf301a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -220,6 +220,8 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * + * @todo For the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ @@ -525,7 +527,7 @@ * @param [pivotY=0] {number} The Y pivot value * @return {PIXI.DisplayObject} */ -DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) +DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { this.position.x = x || 0; this.position.y = y || 0; diff --git a/src/core/index.js b/src/core/index.js index 1cc4552..84e8eab 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -46,8 +46,12 @@ // renderers - webgl WebGLRenderer: require('./renderers/webgl/WebGLRenderer'), + WebGLManager: require('./renderers/webgl/managers/WebGLManager'), ShaderManager: require('./renderers/webgl/managers/ShaderManager'), Shader: require('./renderers/webgl/shaders/Shader'), + TextureShader: require('./renderers/webgl/shaders/TextureShader'), + PrimitiveShader: require('./renderers/webgl/shaders/PrimitiveShader'), + ComplexPrimitiveShader: require('./renderers/webgl/shaders/ComplexPrimitiveShader'), ObjectRenderer: require('./renderers/webgl/utils/ObjectRenderer'), RenderTarget: require('./renderers/webgl/utils/RenderTarget'), diff --git a/package.json b/package.json index 3706307..766e7eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "3.0.9-dev", + "version": "3.0.10-dev", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", "contributors": [ @@ -30,13 +30,12 @@ "README.md" ], "dependencies": { - "async": "^1.4.2", + "async": "^1.5.0", "brfs": "^1.4.1", - "earcut": "^2.0.2", + "earcut": "^2.0.7", "eventemitter3": "^1.1.1", - "gulp-header": "^1.7.1", "object-assign": "^4.0.1", - "resource-loader": "^1.6.2" + "resource-loader": "^1.6.4" }, "devDependencies": { "browserify": "^11.1.0", @@ -46,6 +45,7 @@ "gulp-cached": "^1.1.0", "gulp-concat": "^2.6.0", "gulp-debug": "^2.1.0", + "gulp-header": "^1.7.1", "gulp-jshint": "^1.11.2", "gulp-mirror": "^0.4.0", "gulp-plumber": "^1.0.1", diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index afbb360..3bf301a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -220,6 +220,8 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * + * @todo For the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ @@ -525,7 +527,7 @@ * @param [pivotY=0] {number} The Y pivot value * @return {PIXI.DisplayObject} */ -DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) +DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { this.position.x = x || 0; this.position.y = y || 0; diff --git a/src/core/index.js b/src/core/index.js index 1cc4552..84e8eab 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -46,8 +46,12 @@ // renderers - webgl WebGLRenderer: require('./renderers/webgl/WebGLRenderer'), + WebGLManager: require('./renderers/webgl/managers/WebGLManager'), ShaderManager: require('./renderers/webgl/managers/ShaderManager'), Shader: require('./renderers/webgl/shaders/Shader'), + TextureShader: require('./renderers/webgl/shaders/TextureShader'), + PrimitiveShader: require('./renderers/webgl/shaders/PrimitiveShader'), + ComplexPrimitiveShader: require('./renderers/webgl/shaders/ComplexPrimitiveShader'), ObjectRenderer: require('./renderers/webgl/utils/ObjectRenderer'), RenderTarget: require('./renderers/webgl/utils/RenderTarget'), diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index b29d188..f058e3d 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -43,5 +43,5 @@ */ InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) { - return displayObject.toLocal(globalPos || this.global, null, point); + return displayObject.worldTransform.applyInverse(globalPos || this.global, point); }; diff --git a/package.json b/package.json index 3706307..766e7eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "3.0.9-dev", + "version": "3.0.10-dev", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", "contributors": [ @@ -30,13 +30,12 @@ "README.md" ], "dependencies": { - "async": "^1.4.2", + "async": "^1.5.0", "brfs": "^1.4.1", - "earcut": "^2.0.2", + "earcut": "^2.0.7", "eventemitter3": "^1.1.1", - "gulp-header": "^1.7.1", "object-assign": "^4.0.1", - "resource-loader": "^1.6.2" + "resource-loader": "^1.6.4" }, "devDependencies": { "browserify": "^11.1.0", @@ -46,6 +45,7 @@ "gulp-cached": "^1.1.0", "gulp-concat": "^2.6.0", "gulp-debug": "^2.1.0", + "gulp-header": "^1.7.1", "gulp-jshint": "^1.11.2", "gulp-mirror": "^0.4.0", "gulp-plumber": "^1.0.1", diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index afbb360..3bf301a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -220,6 +220,8 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * + * @todo For the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ @@ -525,7 +527,7 @@ * @param [pivotY=0] {number} The Y pivot value * @return {PIXI.DisplayObject} */ -DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) +DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { this.position.x = x || 0; this.position.y = y || 0; diff --git a/src/core/index.js b/src/core/index.js index 1cc4552..84e8eab 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -46,8 +46,12 @@ // renderers - webgl WebGLRenderer: require('./renderers/webgl/WebGLRenderer'), + WebGLManager: require('./renderers/webgl/managers/WebGLManager'), ShaderManager: require('./renderers/webgl/managers/ShaderManager'), Shader: require('./renderers/webgl/shaders/Shader'), + TextureShader: require('./renderers/webgl/shaders/TextureShader'), + PrimitiveShader: require('./renderers/webgl/shaders/PrimitiveShader'), + ComplexPrimitiveShader: require('./renderers/webgl/shaders/ComplexPrimitiveShader'), ObjectRenderer: require('./renderers/webgl/utils/ObjectRenderer'), RenderTarget: require('./renderers/webgl/utils/RenderTarget'), diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index b29d188..f058e3d 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -43,5 +43,5 @@ */ InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) { - return displayObject.toLocal(globalPos || this.global, null, point); + return displayObject.worldTransform.applyInverse(globalPos || this.global, point); }; diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 57e1b9d..20bd785 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -368,6 +368,12 @@ var hit = false, interactiveParent = interactive = displayObject.interactive || interactive; + // if the displayobject has a hitArea, then it does not need to hitTest children. + if(displayObject.hitArea) + { + interactiveParent = false; + } + // ** FREE TIP **! If an object is not interacttive or has no buttons in it (such as a game scene!) set interactiveChildren to false for that displayObject. // This will allow pixi to completly ignore and bypass checking the displayObjects children. if(displayObject.interactiveChildren) diff --git a/package.json b/package.json index 3706307..766e7eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "3.0.9-dev", + "version": "3.0.10-dev", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", "contributors": [ @@ -30,13 +30,12 @@ "README.md" ], "dependencies": { - "async": "^1.4.2", + "async": "^1.5.0", "brfs": "^1.4.1", - "earcut": "^2.0.2", + "earcut": "^2.0.7", "eventemitter3": "^1.1.1", - "gulp-header": "^1.7.1", "object-assign": "^4.0.1", - "resource-loader": "^1.6.2" + "resource-loader": "^1.6.4" }, "devDependencies": { "browserify": "^11.1.0", @@ -46,6 +45,7 @@ "gulp-cached": "^1.1.0", "gulp-concat": "^2.6.0", "gulp-debug": "^2.1.0", + "gulp-header": "^1.7.1", "gulp-jshint": "^1.11.2", "gulp-mirror": "^0.4.0", "gulp-plumber": "^1.0.1", diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index afbb360..3bf301a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -220,6 +220,8 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * + * @todo For the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ @@ -525,7 +527,7 @@ * @param [pivotY=0] {number} The Y pivot value * @return {PIXI.DisplayObject} */ -DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) +DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { this.position.x = x || 0; this.position.y = y || 0; diff --git a/src/core/index.js b/src/core/index.js index 1cc4552..84e8eab 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -46,8 +46,12 @@ // renderers - webgl WebGLRenderer: require('./renderers/webgl/WebGLRenderer'), + WebGLManager: require('./renderers/webgl/managers/WebGLManager'), ShaderManager: require('./renderers/webgl/managers/ShaderManager'), Shader: require('./renderers/webgl/shaders/Shader'), + TextureShader: require('./renderers/webgl/shaders/TextureShader'), + PrimitiveShader: require('./renderers/webgl/shaders/PrimitiveShader'), + ComplexPrimitiveShader: require('./renderers/webgl/shaders/ComplexPrimitiveShader'), ObjectRenderer: require('./renderers/webgl/utils/ObjectRenderer'), RenderTarget: require('./renderers/webgl/utils/RenderTarget'), diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index b29d188..f058e3d 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -43,5 +43,5 @@ */ InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) { - return displayObject.toLocal(globalPos || this.global, null, point); + return displayObject.worldTransform.applyInverse(globalPos || this.global, point); }; diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 57e1b9d..20bd785 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -368,6 +368,12 @@ var hit = false, interactiveParent = interactive = displayObject.interactive || interactive; + // if the displayobject has a hitArea, then it does not need to hitTest children. + if(displayObject.hitArea) + { + interactiveParent = false; + } + // ** FREE TIP **! If an object is not interacttive or has no buttons in it (such as a game scene!) set interactiveChildren to false for that displayObject. // This will allow pixi to completly ignore and bypass checking the displayObjects children. if(displayObject.interactiveChildren) diff --git a/src/loaders/bitmapFontParser.js b/src/loaders/bitmapFontParser.js index c6bc554..4bf08bf 100644 --- a/src/loaders/bitmapFontParser.js +++ b/src/loaders/bitmapFontParser.js @@ -106,7 +106,8 @@ else { var loadOptions = { crossOrigin: resource.crossOrigin, - loadType: Resource.LOAD_TYPE.IMAGE + loadType: Resource.LOAD_TYPE.IMAGE, + metadata: resource.metadata.imageMetadata }; // load the texture for the font this.add(resource.name + '_image', textureUrl, loadOptions, function (res) { diff --git a/package.json b/package.json index 3706307..766e7eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "3.0.9-dev", + "version": "3.0.10-dev", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", "contributors": [ @@ -30,13 +30,12 @@ "README.md" ], "dependencies": { - "async": "^1.4.2", + "async": "^1.5.0", "brfs": "^1.4.1", - "earcut": "^2.0.2", + "earcut": "^2.0.7", "eventemitter3": "^1.1.1", - "gulp-header": "^1.7.1", "object-assign": "^4.0.1", - "resource-loader": "^1.6.2" + "resource-loader": "^1.6.4" }, "devDependencies": { "browserify": "^11.1.0", @@ -46,6 +45,7 @@ "gulp-cached": "^1.1.0", "gulp-concat": "^2.6.0", "gulp-debug": "^2.1.0", + "gulp-header": "^1.7.1", "gulp-jshint": "^1.11.2", "gulp-mirror": "^0.4.0", "gulp-plumber": "^1.0.1", diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index afbb360..3bf301a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -220,6 +220,8 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * + * @todo For the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ @@ -525,7 +527,7 @@ * @param [pivotY=0] {number} The Y pivot value * @return {PIXI.DisplayObject} */ -DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) +DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { this.position.x = x || 0; this.position.y = y || 0; diff --git a/src/core/index.js b/src/core/index.js index 1cc4552..84e8eab 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -46,8 +46,12 @@ // renderers - webgl WebGLRenderer: require('./renderers/webgl/WebGLRenderer'), + WebGLManager: require('./renderers/webgl/managers/WebGLManager'), ShaderManager: require('./renderers/webgl/managers/ShaderManager'), Shader: require('./renderers/webgl/shaders/Shader'), + TextureShader: require('./renderers/webgl/shaders/TextureShader'), + PrimitiveShader: require('./renderers/webgl/shaders/PrimitiveShader'), + ComplexPrimitiveShader: require('./renderers/webgl/shaders/ComplexPrimitiveShader'), ObjectRenderer: require('./renderers/webgl/utils/ObjectRenderer'), RenderTarget: require('./renderers/webgl/utils/RenderTarget'), diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index b29d188..f058e3d 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -43,5 +43,5 @@ */ InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) { - return displayObject.toLocal(globalPos || this.global, null, point); + return displayObject.worldTransform.applyInverse(globalPos || this.global, point); }; diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 57e1b9d..20bd785 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -368,6 +368,12 @@ var hit = false, interactiveParent = interactive = displayObject.interactive || interactive; + // if the displayobject has a hitArea, then it does not need to hitTest children. + if(displayObject.hitArea) + { + interactiveParent = false; + } + // ** FREE TIP **! If an object is not interacttive or has no buttons in it (such as a game scene!) set interactiveChildren to false for that displayObject. // This will allow pixi to completly ignore and bypass checking the displayObjects children. if(displayObject.interactiveChildren) diff --git a/src/loaders/bitmapFontParser.js b/src/loaders/bitmapFontParser.js index c6bc554..4bf08bf 100644 --- a/src/loaders/bitmapFontParser.js +++ b/src/loaders/bitmapFontParser.js @@ -106,7 +106,8 @@ else { var loadOptions = { crossOrigin: resource.crossOrigin, - loadType: Resource.LOAD_TYPE.IMAGE + loadType: Resource.LOAD_TYPE.IMAGE, + metadata: resource.metadata.imageMetadata }; // load the texture for the font this.add(resource.name + '_image', textureUrl, loadOptions, function (res) { diff --git a/src/loaders/spritesheetParser.js b/src/loaders/spritesheetParser.js index 3737329..8de8b68 100644 --- a/src/loaders/spritesheetParser.js +++ b/src/loaders/spritesheetParser.js @@ -14,7 +14,8 @@ var loadOptions = { crossOrigin: resource.crossOrigin, - loadType: Resource.LOAD_TYPE.IMAGE + loadType: Resource.LOAD_TYPE.IMAGE, + metadata: resource.metadata.imageMetadata }; var route = path.dirname(resource.url.replace(this.baseUrl, '')); diff --git a/package.json b/package.json index 3706307..766e7eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "3.0.9-dev", + "version": "3.0.10-dev", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", "contributors": [ @@ -30,13 +30,12 @@ "README.md" ], "dependencies": { - "async": "^1.4.2", + "async": "^1.5.0", "brfs": "^1.4.1", - "earcut": "^2.0.2", + "earcut": "^2.0.7", "eventemitter3": "^1.1.1", - "gulp-header": "^1.7.1", "object-assign": "^4.0.1", - "resource-loader": "^1.6.2" + "resource-loader": "^1.6.4" }, "devDependencies": { "browserify": "^11.1.0", @@ -46,6 +45,7 @@ "gulp-cached": "^1.1.0", "gulp-concat": "^2.6.0", "gulp-debug": "^2.1.0", + "gulp-header": "^1.7.1", "gulp-jshint": "^1.11.2", "gulp-mirror": "^0.4.0", "gulp-plumber": "^1.0.1", diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index afbb360..3bf301a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -220,6 +220,8 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * + * @todo For the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ @@ -525,7 +527,7 @@ * @param [pivotY=0] {number} The Y pivot value * @return {PIXI.DisplayObject} */ -DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) +DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { this.position.x = x || 0; this.position.y = y || 0; diff --git a/src/core/index.js b/src/core/index.js index 1cc4552..84e8eab 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -46,8 +46,12 @@ // renderers - webgl WebGLRenderer: require('./renderers/webgl/WebGLRenderer'), + WebGLManager: require('./renderers/webgl/managers/WebGLManager'), ShaderManager: require('./renderers/webgl/managers/ShaderManager'), Shader: require('./renderers/webgl/shaders/Shader'), + TextureShader: require('./renderers/webgl/shaders/TextureShader'), + PrimitiveShader: require('./renderers/webgl/shaders/PrimitiveShader'), + ComplexPrimitiveShader: require('./renderers/webgl/shaders/ComplexPrimitiveShader'), ObjectRenderer: require('./renderers/webgl/utils/ObjectRenderer'), RenderTarget: require('./renderers/webgl/utils/RenderTarget'), diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index b29d188..f058e3d 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -43,5 +43,5 @@ */ InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) { - return displayObject.toLocal(globalPos || this.global, null, point); + return displayObject.worldTransform.applyInverse(globalPos || this.global, point); }; diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 57e1b9d..20bd785 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -368,6 +368,12 @@ var hit = false, interactiveParent = interactive = displayObject.interactive || interactive; + // if the displayobject has a hitArea, then it does not need to hitTest children. + if(displayObject.hitArea) + { + interactiveParent = false; + } + // ** FREE TIP **! If an object is not interacttive or has no buttons in it (such as a game scene!) set interactiveChildren to false for that displayObject. // This will allow pixi to completly ignore and bypass checking the displayObjects children. if(displayObject.interactiveChildren) diff --git a/src/loaders/bitmapFontParser.js b/src/loaders/bitmapFontParser.js index c6bc554..4bf08bf 100644 --- a/src/loaders/bitmapFontParser.js +++ b/src/loaders/bitmapFontParser.js @@ -106,7 +106,8 @@ else { var loadOptions = { crossOrigin: resource.crossOrigin, - loadType: Resource.LOAD_TYPE.IMAGE + loadType: Resource.LOAD_TYPE.IMAGE, + metadata: resource.metadata.imageMetadata }; // load the texture for the font this.add(resource.name + '_image', textureUrl, loadOptions, function (res) { diff --git a/src/loaders/spritesheetParser.js b/src/loaders/spritesheetParser.js index 3737329..8de8b68 100644 --- a/src/loaders/spritesheetParser.js +++ b/src/loaders/spritesheetParser.js @@ -14,7 +14,8 @@ var loadOptions = { crossOrigin: resource.crossOrigin, - loadType: Resource.LOAD_TYPE.IMAGE + loadType: Resource.LOAD_TYPE.IMAGE, + metadata: resource.metadata.imageMetadata }; var route = path.dirname(resource.url.replace(this.baseUrl, '')); diff --git a/src/mesh/Mesh.js b/src/mesh/Mesh.js index b8738ed..b9edfe3 100644 --- a/src/mesh/Mesh.js +++ b/src/mesh/Mesh.js @@ -8,7 +8,7 @@ * @extends PIXI.Container * @memberof PIXI.mesh * @param texture {PIXI.Texture} The texture to use - * @param [vertices] {Float32Arrif you want to specify the vertices + * @param [vertices] {Float32Array} if you want to specify the vertices * @param [uvs] {Float32Array} if you want to specify the uvs * @param [indices] {Uint16Array} if you want to specify the indices * @param [drawMode] {number} the drawMode, can be any of the Mesh.DRAW_MODES consts @@ -30,9 +30,9 @@ * * @member {Float32Array} */ - this.uvs = uvs || new Float32Array([0, 1, - 1, 1, + this.uvs = uvs || new Float32Array([0, 0, 1, 0, + 1, 1, 0, 1]); /** @@ -49,7 +49,7 @@ * @member {Uint16Array} An array containing the indices of the vertices */ // TODO auto generate this based on draw mode! - this.indices = indices || new Uint16Array([0, 1, 2, 3]); + this.indices = indices || new Uint16Array([0, 1, 3, 2]); /** * Whether the Mesh is dirty or not diff --git a/package.json b/package.json index 3706307..766e7eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "3.0.9-dev", + "version": "3.0.10-dev", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", "contributors": [ @@ -30,13 +30,12 @@ "README.md" ], "dependencies": { - "async": "^1.4.2", + "async": "^1.5.0", "brfs": "^1.4.1", - "earcut": "^2.0.2", + "earcut": "^2.0.7", "eventemitter3": "^1.1.1", - "gulp-header": "^1.7.1", "object-assign": "^4.0.1", - "resource-loader": "^1.6.2" + "resource-loader": "^1.6.4" }, "devDependencies": { "browserify": "^11.1.0", @@ -46,6 +45,7 @@ "gulp-cached": "^1.1.0", "gulp-concat": "^2.6.0", "gulp-debug": "^2.1.0", + "gulp-header": "^1.7.1", "gulp-jshint": "^1.11.2", "gulp-mirror": "^0.4.0", "gulp-plumber": "^1.0.1", diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index afbb360..3bf301a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -220,6 +220,8 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * + * @todo For the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ @@ -525,7 +527,7 @@ * @param [pivotY=0] {number} The Y pivot value * @return {PIXI.DisplayObject} */ -DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) +DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { this.position.x = x || 0; this.position.y = y || 0; diff --git a/src/core/index.js b/src/core/index.js index 1cc4552..84e8eab 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -46,8 +46,12 @@ // renderers - webgl WebGLRenderer: require('./renderers/webgl/WebGLRenderer'), + WebGLManager: require('./renderers/webgl/managers/WebGLManager'), ShaderManager: require('./renderers/webgl/managers/ShaderManager'), Shader: require('./renderers/webgl/shaders/Shader'), + TextureShader: require('./renderers/webgl/shaders/TextureShader'), + PrimitiveShader: require('./renderers/webgl/shaders/PrimitiveShader'), + ComplexPrimitiveShader: require('./renderers/webgl/shaders/ComplexPrimitiveShader'), ObjectRenderer: require('./renderers/webgl/utils/ObjectRenderer'), RenderTarget: require('./renderers/webgl/utils/RenderTarget'), diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index b29d188..f058e3d 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -43,5 +43,5 @@ */ InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) { - return displayObject.toLocal(globalPos || this.global, null, point); + return displayObject.worldTransform.applyInverse(globalPos || this.global, point); }; diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 57e1b9d..20bd785 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -368,6 +368,12 @@ var hit = false, interactiveParent = interactive = displayObject.interactive || interactive; + // if the displayobject has a hitArea, then it does not need to hitTest children. + if(displayObject.hitArea) + { + interactiveParent = false; + } + // ** FREE TIP **! If an object is not interacttive or has no buttons in it (such as a game scene!) set interactiveChildren to false for that displayObject. // This will allow pixi to completly ignore and bypass checking the displayObjects children. if(displayObject.interactiveChildren) diff --git a/src/loaders/bitmapFontParser.js b/src/loaders/bitmapFontParser.js index c6bc554..4bf08bf 100644 --- a/src/loaders/bitmapFontParser.js +++ b/src/loaders/bitmapFontParser.js @@ -106,7 +106,8 @@ else { var loadOptions = { crossOrigin: resource.crossOrigin, - loadType: Resource.LOAD_TYPE.IMAGE + loadType: Resource.LOAD_TYPE.IMAGE, + metadata: resource.metadata.imageMetadata }; // load the texture for the font this.add(resource.name + '_image', textureUrl, loadOptions, function (res) { diff --git a/src/loaders/spritesheetParser.js b/src/loaders/spritesheetParser.js index 3737329..8de8b68 100644 --- a/src/loaders/spritesheetParser.js +++ b/src/loaders/spritesheetParser.js @@ -14,7 +14,8 @@ var loadOptions = { crossOrigin: resource.crossOrigin, - loadType: Resource.LOAD_TYPE.IMAGE + loadType: Resource.LOAD_TYPE.IMAGE, + metadata: resource.metadata.imageMetadata }; var route = path.dirname(resource.url.replace(this.baseUrl, '')); diff --git a/src/mesh/Mesh.js b/src/mesh/Mesh.js index b8738ed..b9edfe3 100644 --- a/src/mesh/Mesh.js +++ b/src/mesh/Mesh.js @@ -8,7 +8,7 @@ * @extends PIXI.Container * @memberof PIXI.mesh * @param texture {PIXI.Texture} The texture to use - * @param [vertices] {Float32Arrif you want to specify the vertices + * @param [vertices] {Float32Array} if you want to specify the vertices * @param [uvs] {Float32Array} if you want to specify the uvs * @param [indices] {Uint16Array} if you want to specify the indices * @param [drawMode] {number} the drawMode, can be any of the Mesh.DRAW_MODES consts @@ -30,9 +30,9 @@ * * @member {Float32Array} */ - this.uvs = uvs || new Float32Array([0, 1, - 1, 1, + this.uvs = uvs || new Float32Array([0, 0, 1, 0, + 1, 1, 0, 1]); /** @@ -49,7 +49,7 @@ * @member {Uint16Array} An array containing the indices of the vertices */ // TODO auto generate this based on draw mode! - this.indices = indices || new Uint16Array([0, 1, 2, 3]); + this.indices = indices || new Uint16Array([0, 1, 3, 2]); /** * Whether the Mesh is dirty or not diff --git a/src/mesh/Plane.js b/src/mesh/Plane.js index e83a2d4..9fddbd8 100644 --- a/src/mesh/Plane.js +++ b/src/mesh/Plane.js @@ -65,7 +65,6 @@ var segmentsYSub = this.segmentsY - 1; var i = 0; - // TODO MAP UVS.. var sizeX = texture.width / segmentsXSub; var sizeY = texture.height / segmentsYSub; @@ -78,8 +77,9 @@ verts.push((x * sizeX), (y * sizeY)); - uvs.push(x / (this.segmentsX-1), y/ (this.segmentsY-1)); - } + // this works for rectangular textures. + uvs.push(texture._uvs.x0 + (texture._uvs.x1 - texture._uvs.x0) * (x / (this.segmentsX-1)), texture._uvs.y0 + (texture._uvs.y3-texture._uvs.y0) * (y/ (this.segmentsY-1))); + } // cons diff --git a/package.json b/package.json index 3706307..766e7eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixi.js", - "version": "3.0.9-dev", + "version": "3.0.10-dev", "description": "Pixi.js is a fast lightweight 2D library that works across all devices.", "author": "Mat Groves", "contributors": [ @@ -30,13 +30,12 @@ "README.md" ], "dependencies": { - "async": "^1.4.2", + "async": "^1.5.0", "brfs": "^1.4.1", - "earcut": "^2.0.2", + "earcut": "^2.0.7", "eventemitter3": "^1.1.1", - "gulp-header": "^1.7.1", "object-assign": "^4.0.1", - "resource-loader": "^1.6.2" + "resource-loader": "^1.6.4" }, "devDependencies": { "browserify": "^11.1.0", @@ -46,6 +45,7 @@ "gulp-cached": "^1.1.0", "gulp-concat": "^2.6.0", "gulp-debug": "^2.1.0", + "gulp-header": "^1.7.1", "gulp-jshint": "^1.11.2", "gulp-mirror": "^0.4.0", "gulp-plumber": "^1.0.1", diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index afbb360..3bf301a 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -220,6 +220,8 @@ * In PIXI a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilises shape clipping. * To remove a mask, set this property to null. * + * @todo For the moment, PIXI.CanvasRenderer doesn't support PIXI.Sprite as mask. + * * @member {PIXI.Graphics|PIXI.Sprite} * @memberof PIXI.DisplayObject# */ @@ -525,7 +527,7 @@ * @param [pivotY=0] {number} The Y pivot value * @return {PIXI.DisplayObject} */ -DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) +DisplayObject.prototype.setTransform = function(x, y, scaleX, scaleY, rotation, skewX, skewY, pivotX, pivotY) //jshint ignore:line { this.position.x = x || 0; this.position.y = y || 0; diff --git a/src/core/index.js b/src/core/index.js index 1cc4552..84e8eab 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -46,8 +46,12 @@ // renderers - webgl WebGLRenderer: require('./renderers/webgl/WebGLRenderer'), + WebGLManager: require('./renderers/webgl/managers/WebGLManager'), ShaderManager: require('./renderers/webgl/managers/ShaderManager'), Shader: require('./renderers/webgl/shaders/Shader'), + TextureShader: require('./renderers/webgl/shaders/TextureShader'), + PrimitiveShader: require('./renderers/webgl/shaders/PrimitiveShader'), + ComplexPrimitiveShader: require('./renderers/webgl/shaders/ComplexPrimitiveShader'), ObjectRenderer: require('./renderers/webgl/utils/ObjectRenderer'), RenderTarget: require('./renderers/webgl/utils/RenderTarget'), diff --git a/src/interaction/InteractionData.js b/src/interaction/InteractionData.js index b29d188..f058e3d 100644 --- a/src/interaction/InteractionData.js +++ b/src/interaction/InteractionData.js @@ -43,5 +43,5 @@ */ InteractionData.prototype.getLocalPosition = function (displayObject, point, globalPos) { - return displayObject.toLocal(globalPos || this.global, null, point); + return displayObject.worldTransform.applyInverse(globalPos || this.global, point); }; diff --git a/src/interaction/InteractionManager.js b/src/interaction/InteractionManager.js index 57e1b9d..20bd785 100644 --- a/src/interaction/InteractionManager.js +++ b/src/interaction/InteractionManager.js @@ -368,6 +368,12 @@ var hit = false, interactiveParent = interactive = displayObject.interactive || interactive; + // if the displayobject has a hitArea, then it does not need to hitTest children. + if(displayObject.hitArea) + { + interactiveParent = false; + } + // ** FREE TIP **! If an object is not interacttive or has no buttons in it (such as a game scene!) set interactiveChildren to false for that displayObject. // This will allow pixi to completly ignore and bypass checking the displayObjects children. if(displayObject.interactiveChildren) diff --git a/src/loaders/bitmapFontParser.js b/src/loaders/bitmapFontParser.js index c6bc554..4bf08bf 100644 --- a/src/loaders/bitmapFontParser.js +++ b/src/loaders/bitmapFontParser.js @@ -106,7 +106,8 @@ else { var loadOptions = { crossOrigin: resource.crossOrigin, - loadType: Resource.LOAD_TYPE.IMAGE + loadType: Resource.LOAD_TYPE.IMAGE, + metadata: resource.metadata.imageMetadata }; // load the texture for the font this.add(resource.name + '_image', textureUrl, loadOptions, function (res) { diff --git a/src/loaders/spritesheetParser.js b/src/loaders/spritesheetParser.js index 3737329..8de8b68 100644 --- a/src/loaders/spritesheetParser.js +++ b/src/loaders/spritesheetParser.js @@ -14,7 +14,8 @@ var loadOptions = { crossOrigin: resource.crossOrigin, - loadType: Resource.LOAD_TYPE.IMAGE + loadType: Resource.LOAD_TYPE.IMAGE, + metadata: resource.metadata.imageMetadata }; var route = path.dirname(resource.url.replace(this.baseUrl, '')); diff --git a/src/mesh/Mesh.js b/src/mesh/Mesh.js index b8738ed..b9edfe3 100644 --- a/src/mesh/Mesh.js +++ b/src/mesh/Mesh.js @@ -8,7 +8,7 @@ * @extends PIXI.Container * @memberof PIXI.mesh * @param texture {PIXI.Texture} The texture to use - * @param [vertices] {Float32Arrif you want to specify the vertices + * @param [vertices] {Float32Array} if you want to specify the vertices * @param [uvs] {Float32Array} if you want to specify the uvs * @param [indices] {Uint16Array} if you want to specify the indices * @param [drawMode] {number} the drawMode, can be any of the Mesh.DRAW_MODES consts @@ -30,9 +30,9 @@ * * @member {Float32Array} */ - this.uvs = uvs || new Float32Array([0, 1, - 1, 1, + this.uvs = uvs || new Float32Array([0, 0, 1, 0, + 1, 1, 0, 1]); /** @@ -49,7 +49,7 @@ * @member {Uint16Array} An array containing the indices of the vertices */ // TODO auto generate this based on draw mode! - this.indices = indices || new Uint16Array([0, 1, 2, 3]); + this.indices = indices || new Uint16Array([0, 1, 3, 2]); /** * Whether the Mesh is dirty or not diff --git a/src/mesh/Plane.js b/src/mesh/Plane.js index e83a2d4..9fddbd8 100644 --- a/src/mesh/Plane.js +++ b/src/mesh/Plane.js @@ -65,7 +65,6 @@ var segmentsYSub = this.segmentsY - 1; var i = 0; - // TODO MAP UVS.. var sizeX = texture.width / segmentsXSub; var sizeY = texture.height / segmentsYSub; @@ -78,8 +77,9 @@ verts.push((x * sizeX), (y * sizeY)); - uvs.push(x / (this.segmentsX-1), y/ (this.segmentsY-1)); - } + // this works for rectangular textures. + uvs.push(texture._uvs.x0 + (texture._uvs.x1 - texture._uvs.x0) * (x / (this.segmentsX-1)), texture._uvs.y0 + (texture._uvs.y3-texture._uvs.y0) * (y/ (this.segmentsY-1))); + } // cons diff --git a/test/unit/interaction/InteractionData.test.js b/test/unit/interaction/InteractionData.test.js index 70660fc..690ca16 100644 --- a/test/unit/interaction/InteractionData.test.js +++ b/test/unit/interaction/InteractionData.test.js @@ -2,11 +2,16 @@ describe('getLocalPosition', function() { it('should populate second parameter with result', function() { var data = new PIXI.interaction.InteractionData(), + stage = new PIXI.DisplayObject(), displayObject = new PIXI.DisplayObject(), point = new PIXI.Point(); data.global.set(10, 10); + displayObject.position.set(5, 3); + + displayObject.parent = stage + displayObject.displayObjectUpdateTransform(); data.getLocalPosition(displayObject, point);