Comparing version 3.0.0-rc1 to 3.0.0-rc2
{ | ||
"name": "pixi.js", | ||
"version": "3.0.0-rc1", | ||
"version": "3.0.0-rc2", | ||
@@ -5,0 +5,0 @@ "main": "bin/pixi.dev.js", |
@@ -10,2 +10,3 @@ var path = require('path'), | ||
watchify = require('watchify'), | ||
exorcist = require('exorcist'), | ||
handleErrors = require('../util/handleErrors'); | ||
@@ -18,2 +19,3 @@ | ||
.pipe(handleErrors()) | ||
.pipe(exorcist(paths.out + '/pixi.js.map')) | ||
.pipe(source('pixi.js')) | ||
@@ -20,0 +22,0 @@ .pipe(gulp.dest(paths.out)) |
var gutil = require('gulp-util'), | ||
plumber = require('gulp-plumber'); | ||
plumber = require('gulp-plumber'), | ||
ERROR = gutil.colors.red('[ERROR]'); | ||
function errorHandler(err) { | ||
gutil.log(err.stack || err); | ||
// var args = [].slice.apply(arguments); | ||
var msg = err.toString(); | ||
// // Send error to notification center with gulp-notify | ||
// notify.onError({ | ||
// title: 'Error', | ||
// message: '<' + '%= error.message %' + '>' | ||
// }).apply(this, args); | ||
if (msg === '[object Object]') { | ||
msg = err; | ||
} | ||
gutil.log(ERROR, err); | ||
if (err.stack) { | ||
gutil.log(ERROR, err.stack); | ||
} | ||
// Keep gulp from hanging on this task | ||
@@ -22,2 +26,2 @@ this.emit('end'); | ||
module.exports.handler = errorHandler; | ||
module.exports.handler = errorHandler; |
{ | ||
"name": "pixi.js", | ||
"version": "3.0.0-rc1", | ||
"version": "3.0.0-rc2", | ||
"description": "Pixi.js is a fast lightweight 2D library that works across all devices.", | ||
@@ -23,6 +23,6 @@ "author": "Mat Groves", | ||
"devDependencies": { | ||
"brfs": "^1.2.0", | ||
"browserify": "^8.0.2", | ||
"chai": "^1.10.0", | ||
"del": "^1.1.0", | ||
"exorcist": "^0.1.6", | ||
"gulp": "^3.8.10", | ||
@@ -55,3 +55,4 @@ "gulp-cached": "^1.0.1", | ||
"async": "^0.9.0", | ||
"resource-loader": "^1.2.0" | ||
"resource-loader": "^1.2.2", | ||
"brfs": "^1.2.0" | ||
}, | ||
@@ -58,0 +59,0 @@ "browserify": { |
@@ -547,1 +547,10 @@ var math = require('../math'), | ||
}; | ||
/** | ||
* Destroys the container | ||
* | ||
*/ | ||
Container.prototype.destroy = function () | ||
{ | ||
this.children = null; | ||
}; |
@@ -442,1 +442,22 @@ var math = require('../math'), | ||
}; | ||
/** | ||
* Base destroy method for generic display objects | ||
* | ||
*/ | ||
DisplayObject.prototype.destroy = function () | ||
{ | ||
this.position = null; | ||
this.scale = null; | ||
this.pivot = null; | ||
this._bounds = null; | ||
this._currentBounds = null; | ||
this._mask = null; | ||
this.worldTransform = null; | ||
this.filterArea = null; | ||
this.listeners = null; | ||
}; |
@@ -24,2 +24,3 @@ var AbstractFilter = require('./AbstractFilter'), | ||
mask: { type: 'sampler2D', value: sprite._texture }, | ||
alpha: { type: 'f', value: 1}, | ||
otherMatrix: { type: 'mat3', value: maskMatrix.toArray(true) } | ||
@@ -53,2 +54,3 @@ } | ||
this.uniforms.otherMatrix.value = this.maskMatrix.toArray(true); | ||
this.uniforms.alpha.value = this.maskSprite.worldAlpha; | ||
@@ -55,0 +57,0 @@ var shader = this.getShader(renderer); |
@@ -76,2 +76,3 @@ var WebGLManager = require('./WebGLManager'), | ||
var bounds = target.filterArea || target.getBounds(); | ||
//bounds = bounds.clone(); | ||
@@ -86,3 +87,3 @@ // round off the rectangle to get a nice smoooooooth filter :) | ||
// padding! | ||
var padding = filters[0].padding; | ||
var padding = filters[0].padding | 0; | ||
bounds.x -= padding; | ||
@@ -153,2 +154,3 @@ bounds.y -= padding; | ||
// TODO.. this probably only needs to be done once! | ||
@@ -160,2 +162,7 @@ gl.bindBuffer(gl.ARRAY_BUFFER, this.quad.vertexBuffer); | ||
// assuming all filters follow the correct format?? | ||
gl.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aVertexPosition, 2, gl.FLOAT, false, 0, 0); | ||
gl.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aTextureCoord, 2, gl.FLOAT, false, 0, 2 * 4 * 4); | ||
gl.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aColor, 4, gl.FLOAT, false, 0, 4 * 4 * 4); | ||
if (filters.length === 1) | ||
@@ -264,6 +271,7 @@ { | ||
shader.syncUniforms(); | ||
/* | ||
gl.vertexAttribPointer(shader.attributes.aVertexPosition, 2, gl.FLOAT, false, 0, 0); | ||
gl.vertexAttribPointer(shader.attributes.aTextureCoord, 2, gl.FLOAT, false, 0, 2 * 4 * 4); | ||
gl.vertexAttribPointer(shader.attributes.aColor, 4, gl.FLOAT, false, 0, 4 * 4 * 4); | ||
*/ | ||
@@ -270,0 +278,0 @@ gl.activeTexture(gl.TEXTURE0); |
@@ -96,23 +96,2 @@ var math = require('../math'), | ||
/** | ||
* Destroys this sprite and optionally its texture | ||
* | ||
* @param destroyTexture {boolean} Should it destroy the current texture of the sprite as well | ||
* @param destroyBaseTexture {boolean} Should it destroy the base texture of the sprite as well | ||
*/ | ||
Sprite.prototype.destroy = function (destroyTexture, destroyBaseTexture) | ||
{ | ||
Container.prototype.destroy.call(this); | ||
this.anchor = null; | ||
if (destroyTexture) | ||
{ | ||
this._texture.destroy(destroyBaseTexture); | ||
} | ||
this._texture = null; | ||
this.shader = null; | ||
}; | ||
// constructor | ||
@@ -508,2 +487,23 @@ Sprite.prototype = Object.create(Container.prototype); | ||
/** | ||
* Destroys this sprite and optionally its texture | ||
* | ||
* @param destroyTexture {boolean} Should it destroy the current texture of the sprite as well | ||
* @param destroyBaseTexture {boolean} Should it destroy the base texture of the sprite as well | ||
*/ | ||
Sprite.prototype.destroy = function (destroyTexture, destroyBaseTexture) | ||
{ | ||
Container.prototype.destroy.call(this); | ||
this.anchor = null; | ||
if (destroyTexture) | ||
{ | ||
this._texture.destroy(destroyBaseTexture); | ||
} | ||
this._texture = null; | ||
this.shader = null; | ||
}; | ||
// some helper functions.. | ||
@@ -510,0 +510,0 @@ |
@@ -11,3 +11,2 @@ var CONST = require('../const'); | ||
RAFramePolyfill:require('./requestAnimationFramePolyfill'), | ||
Ticker: require('./Ticker'), | ||
EventData: require('./EventData'), | ||
@@ -14,0 +13,0 @@ eventTarget: require('./eventTarget'), |
var core = require('./core'), | ||
extras = require('./extras'), | ||
mesh = require('./mesh'), | ||
text = require('./text'); | ||
core.Stage = function () | ||
{ | ||
window.console.warn('You do not need to use a PIXI Stage any more, you can simply render any container.'); | ||
return new core.Container(); | ||
}; | ||
@@ -20,12 +16,30 @@ core.SpriteBatch = function () | ||
core.DisplayObjectContainer = function () { | ||
window.console.warn('DisplayObjectContainer has been shortened to Container, please use Container from now on'); | ||
return new core.Container(); | ||
}; | ||
Object.defineProperties(core, { | ||
core.Strip = function (texture) { | ||
window.console.warn('The Strip class has been renamed to Mesh, please use Mesh from now on'); | ||
return new extras.mesh.Mesh(texture); | ||
}; | ||
Stage: { | ||
get: function () | ||
{ | ||
window.console.warn('You do not need to use a PIXI Stage any more, you can simply render any container.'); | ||
return new core.Container(); | ||
} | ||
}, | ||
DisplayObjectContainer: { | ||
get: function () | ||
{ | ||
window.console.warn('DisplayObjectContainer has been shortened to Container, please use Container from now on'); | ||
return new core.Container(); | ||
} | ||
}, | ||
Strip: { | ||
get: function () | ||
{ | ||
window.console.warn('The Strip class has been renamed to Mesh, please use Mesh from now on'); | ||
return new mesh.Mesh(texture); | ||
} | ||
} | ||
}); | ||
core.Sprite.prototype.setTexture = function (texture) | ||
@@ -32,0 +46,0 @@ { |
@@ -12,7 +12,7 @@ /** | ||
module.exports = { | ||
Ticker: require('./Ticker'), | ||
MovieClip: require('./MovieClip'), | ||
TilingSprite: require('./TilingSprite'), | ||
mesh: require('./mesh/index'), | ||
cacheAsBitmap: require('./cacheAsBitmap'), | ||
getChildByName: require('./getChildByName') | ||
}; |
@@ -1,3 +0,3 @@ | ||
var core = require('../core'), | ||
utils = require('../core/utils'); | ||
var core = require('../core'), | ||
Ticker = require('./Ticker'); | ||
@@ -141,3 +141,3 @@ /** | ||
this.playing = false; | ||
utils.Ticker.off('tick', this._updateBound); | ||
Ticker.off('tick', this._updateBound); | ||
}; | ||
@@ -157,3 +157,3 @@ | ||
this.playing = true; | ||
utils.Ticker.on('tick', this._updateBound); | ||
Ticker.on('tick', this._updateBound); | ||
}; | ||
@@ -160,0 +160,0 @@ |
@@ -52,3 +52,3 @@ var core = require('../../core'), | ||
{ | ||
this.padding = value * 1.5; | ||
this.padding = value * 0.5; | ||
this.blurXFilter.blur = this.blurYFilter.blur = value; | ||
@@ -55,0 +55,0 @@ } |
@@ -87,3 +87,3 @@ var core = require('../../core'); | ||
{ | ||
this.padding = value; | ||
this.padding = value * 0.5; | ||
this.strength = value; | ||
@@ -90,0 +90,0 @@ } |
@@ -79,3 +79,3 @@ var core = require('../../core'); | ||
{ | ||
this.padding = value; | ||
this.padding = value * 0.5; | ||
this.strength = value; | ||
@@ -82,0 +82,0 @@ } |
@@ -24,5 +24,9 @@ var core = require('../../core'), | ||
alpha: { type: '1f', value: 0.7 }, | ||
offset: { type: '2f', value:[5, 5]} | ||
offset: { type: '2f', value:[5, 5]}, | ||
strength: { type: '1f', value:1} | ||
} | ||
); | ||
this.passes = 1; | ||
this.strength = 4; | ||
} | ||
@@ -34,2 +38,34 @@ | ||
BlurYTintFilter.prototype.applyFilter = function (renderer, input, output, clear) | ||
{ | ||
var shader = this.getShader(renderer); | ||
this.uniforms.strength.value = this.strength / 4 / this.passes * (input.frame.height / input.size.height); | ||
if(this.passes === 1) | ||
{ | ||
renderer.filterManager.applyFilter(shader, input, output, clear); | ||
} | ||
else | ||
{ | ||
var renderTarget = renderer.filterManager.getRenderTarget(true); | ||
var flip = input; | ||
var flop = renderTarget; | ||
for(var i = 0; i < this.passes-1; i++) | ||
{ | ||
renderer.filterManager.applyFilter(shader, flip, flop, clear); | ||
var temp = flop; | ||
flop = flip; | ||
flip = temp; | ||
} | ||
renderer.filterManager.applyFilter(shader, flip, output, clear); | ||
renderer.filterManager.returnRenderTarget(renderTarget); | ||
} | ||
}; | ||
Object.defineProperties(BlurYTintFilter.prototype, { | ||
@@ -40,3 +76,3 @@ /** | ||
* @member {number} | ||
* @memberof BlurYTintFilter# | ||
* @memberof BlurYFilter# | ||
* @default 2 | ||
@@ -47,9 +83,10 @@ */ | ||
{ | ||
return this.uniforms.blur.value / blurFactor; | ||
return this.strength; | ||
}, | ||
set: function (value) | ||
{ | ||
this.uniforms.blur.value = blurFactor * value; | ||
this.padding = value * 0.5; | ||
this.strength = value; | ||
} | ||
} | ||
}, | ||
}); |
var core = require('./core'); | ||
extendCore(require('./extras')); | ||
extendCore(require('./mesh')); | ||
extendCore(require('./filters')); | ||
@@ -5,0 +6,0 @@ extendCore(require('./interaction')); |
@@ -32,3 +32,3 @@ var Resource = require('resource-loader').Resource, | ||
var textureUrl = this.baseUrl + resource.data.getElementsByTagName('page')[0].getAttribute('file'); | ||
var textureUrl = resource.data.getElementsByTagName('page')[0].getAttribute('file'); | ||
var loadOptions = { | ||
@@ -35,0 +35,0 @@ crossOrigin: resource.crossOrigin, |
@@ -12,4 +12,3 @@ /** | ||
module.exports = { | ||
// Loader: require('resource-loader'), | ||
Loader: require('./loader'), | ||
Loader: require('./loader'), | ||
@@ -22,1 +21,4 @@ // parsers | ||
}; | ||
module.exports.loader = new module.exports.Loader(); |
@@ -22,3 +22,3 @@ var Resource = require('resource-loader').Resource, | ||
// load the image for this sheet | ||
this.add(resource.name + '_image', this.baseUrl + route + '/' + resource.data.meta.image, loadOptions, function (res) | ||
this.add(resource.name + '_image', route + '/' + resource.data.meta.image, loadOptions, function (res) | ||
{ | ||
@@ -25,0 +25,0 @@ resource.textures = {}; |
@@ -65,7 +65,7 @@ var core = require('../core'); | ||
*/ | ||
this._style = { | ||
this._font = { | ||
tint: style.tint, | ||
align: style.align, | ||
fontName: null, | ||
fontSize: 0 | ||
name: null, | ||
size: 0 | ||
}; | ||
@@ -122,7 +122,7 @@ | ||
{ | ||
return this._style.tint; | ||
return this._font.tint; | ||
}, | ||
set: function (value) | ||
{ | ||
this._style.tint = (typeof value === 'number' && value >= 0) ? value : 0xFFFFFF; | ||
this._font.tint = (typeof value === 'number' && value >= 0) ? value : 0xFFFFFF; | ||
@@ -143,7 +143,7 @@ this.dirty = true; | ||
{ | ||
return this._style.align; | ||
return this._font.align; | ||
}, | ||
set: function (value) | ||
{ | ||
this._style.align = value; | ||
this._font.align = value; | ||
@@ -163,3 +163,3 @@ this.dirty = true; | ||
{ | ||
return this._style.font; | ||
return this._font; | ||
}, | ||
@@ -171,8 +171,8 @@ set: function (value) | ||
this._style.fontName = value.slice(1).join(' '); | ||
this._style.fontSize = value.length >= 2 ? parseInt(value[0], 10) : BitmapText.fonts[this.fontName].size; | ||
this._font.name = value.length === 1 ? value[0] : value.slice(1).join(' '); | ||
this._font.size = value.length >= 2 ? parseInt(value[0], 10) : BitmapText.fonts[this._font.name].size; | ||
} | ||
else { | ||
this._style.fontName = value.name; | ||
this._style.fontSize = typeof value.size === 'number' ? value.size : parseInt(value.size, 10); | ||
this._font.name = value.name; | ||
this._font.size = typeof value.size === 'number' ? value.size : parseInt(value.size, 10); | ||
} | ||
@@ -211,3 +211,3 @@ | ||
{ | ||
var data = BitmapText.fonts[this._style.fontName]; | ||
var data = BitmapText.fonts[this._font.name]; | ||
var pos = new core.math.Point(); | ||
@@ -220,3 +220,3 @@ var prevCharCode = null; | ||
var line = 0; | ||
var scale = this._style.fontSize / data.size; | ||
var scale = this._font.size / data.size; | ||
var lastSpace = -1; | ||
@@ -285,7 +285,7 @@ | ||
if (this._style.align === 'right') | ||
if (this._font.align === 'right') | ||
{ | ||
alignOffset = maxLineWidth - lineWidths[i]; | ||
} | ||
else if (this._style.align === 'center') | ||
else if (this._font.align === 'center') | ||
{ | ||
@@ -292,0 +292,0 @@ alignOffset = (maxLineWidth - lineWidths[i]) / 2; |
@@ -371,3 +371,3 @@ var core = require('../core'); | ||
{ | ||
this.resolution = renderer.resolution; | ||
//this.resolution = 1//renderer.resolution; | ||
@@ -389,3 +389,3 @@ this.updateText(); | ||
{ | ||
this.resolution = renderer.resolution; | ||
// this.resolution = 1//renderer.resolution; | ||
@@ -392,0 +392,0 @@ this.updateText(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
3787714
231
45476
1
3
2
38
+ Addedbrfs@^1.2.0
+ Addedacorn@7.4.1(transitive)
+ Addedbrfs@1.6.1(transitive)
+ Addedbuffer-equal@0.0.1(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedconcat-stream@1.6.2(transitive)
+ Addedconvert-source-map@1.9.0(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddeep-is@0.1.4(transitive)
+ Addedduplexer2@0.1.4(transitive)
+ Addedescodegen@1.9.12.1.0(transitive)
+ Addedesprima@3.1.34.0.1(transitive)
+ Addedestraverse@4.3.05.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedfalafel@2.2.5(transitive)
+ Addedfast-levenshtein@2.0.6(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedhas@1.0.4(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedisarray@1.0.02.0.5(transitive)
+ Addedlevn@0.3.0(transitive)
+ Addedmagic-string@0.22.5(transitive)
+ Addedmerge-source-map@1.0.4(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedobject-inspect@1.4.1(transitive)
+ Addedoptionator@0.8.3(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedprelude-ls@1.1.2(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedquote-stream@1.0.2(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedshallow-copy@0.0.1(transitive)
+ Addedsource-map@0.5.70.6.1(transitive)
+ Addedstatic-eval@2.1.1(transitive)
+ Addedstatic-module@2.2.5(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedthrough2@2.0.5(transitive)
+ Addedtype-check@0.3.2(transitive)
+ Addedtypedarray@0.0.6(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedvlq@0.2.3(transitive)
+ Addedword-wrap@1.2.5(transitive)
+ Addedxtend@4.0.2(transitive)
Updatedresource-loader@^1.2.2