New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pixi.js

Package Overview
Dependencies
Maintainers
2
Versions
511
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pixi.js - npm Package Compare versions

Comparing version 4.5.2 to 4.5.3

lib/core/utils/mapPremultipliedBlendModes.js

14

lib/core/Application.js

@@ -53,7 +53,15 @@ 'use strict';

* @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, enable this if you
* need to call toDataUrl on the webgl context
* need to call toDataUrl on the webgl context
* @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer, retina would be 2
* @param {boolean} [options.forceCanvas=false] - prevents selection of WebGL renderer, even if such is present
* @param {boolean} [options.legacy=false] - If true Pixi will aim to ensure compatibility
* with older / less advanced devices. If you experience unexplained flickering try setting this to true.
* @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area
* (shown if not transparent).
* @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or
* not before the new render pass.
* @param {boolean} [options.roundPixels=false] - If true Pixi will Math.floor() x/y values when rendering,
* stopping pixel interpolation.
* @param {boolean} [options.forceFXAA=false] - forces FXAA antialiasing to be used over native.
* FXAA is faster, but may not always look as great **webgl only**
* @param {boolean} [options.legacy=false] - `true` to ensure compatibility with older / less advanced devices.
* If you experience unexplained flickering try setting this to true. **webgl only**
* @param {boolean} [options.sharedTicker=false] - `true` to use PIXI.ticker.shared, `false` to create new ticker.

@@ -60,0 +68,0 @@ * @param {boolean} [options.sharedLoader=false] - `true` to use PIXI.loaders.shared, `false` to create new Loader.

@@ -37,5 +37,15 @@ 'use strict';

* @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation, enable this if you
* need to call toDataUrl on the webgl context
* need to call toDataUrl on the webgl context
* @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area
* (shown if not transparent).
* @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or
* not before the new render pass.
* @param {number} [options.resolution=1] - The resolution / device pixel ratio of the renderer, retina would be 2
* @param {boolean} [options.forceCanvas=false] - prevents selection of WebGL renderer, even if such is present
* @param {boolean} [options.roundPixels=false] - If true Pixi will Math.floor() x/y values when rendering,
* stopping pixel interpolation.
* @param {boolean} [options.forceFXAA=false] - forces FXAA antialiasing to be used over native.
* FXAA is faster, but may not always look as great **webgl only**
* @param {boolean} [options.legacy=false] - `true` to ensure compatibility with older / less advanced devices.
* If you experience unexplained flickering try setting this to true. **webgl only**
* @return {PIXI.WebGLRenderer|PIXI.CanvasRenderer} Returns WebGL renderer if available, otherwise CanvasRenderer

@@ -42,0 +52,0 @@ */

@@ -13,3 +13,3 @@ 'use strict';

*/
var VERSION = exports.VERSION = '4.5.2';
var VERSION = exports.VERSION = '4.5.3';

@@ -110,3 +110,6 @@ /**

COLOR: 15,
LUMINOSITY: 16
LUMINOSITY: 16,
NORMAL_NPM: 17,
ADD_NPM: 18,
SCREEN_NPM: 19
};

@@ -113,0 +116,0 @@

@@ -60,3 +60,5 @@ 'use strict';

* resolution of the renderer retina would be 2.
* @param {boolean} [options.clearBeforeRender=true] - This sets if the CanvasRenderer will clear the canvas or
* @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation,
* enable this if you need to call toDataUrl on the webgl context.
* @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or
* not before the new render pass.

@@ -76,3 +78,3 @@ * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area

/**
* The canvas 2d context that everything is drawn with.
* The root canvas 2d context that everything is drawn with.
*

@@ -84,2 +86,9 @@ * @member {CanvasRenderingContext2D}

/**
* The currently active canvas 2d context (could change with renderTextures)
*
* @member {CanvasRenderingContext2D}
*/
_this.context = _this.rootContext;
/**
* Boolean flag controlling canvas refresh.

@@ -122,3 +131,2 @@ *

_this.context = null;
_this.renderingToScreen = false;

@@ -125,0 +133,0 @@

@@ -64,2 +64,6 @@ 'use strict';

}
// not-premultiplied, only for webgl
array[_const.BLEND_MODES.NORMAL_NPM] = array[_const.BLEND_MODES.NORMAL];
array[_const.BLEND_MODES.ADD_NPM] = array[_const.BLEND_MODES.ADD];
array[_const.BLEND_MODES.SCREEN_NPM] = array[_const.BLEND_MODES.SCREEN];

@@ -66,0 +70,0 @@ return array;

@@ -64,3 +64,5 @@ 'use strict';

* resolution of the renderer retina would be 2.
* @param {boolean} [options.clearBeforeRender=true] - This sets if the CanvasRenderer will clear the canvas or
* @param {boolean} [options.preserveDrawingBuffer=false] - enables drawing buffer preservation,
* enable this if you need to call toDataUrl on the webgl context.
* @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear the canvas or
* not before the new render pass.

@@ -314,3 +316,2 @@ * @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area

this.backgroundColor = 0;
this._tempDisplayObjectParent = null;

@@ -317,0 +318,0 @@ this._lastObjectRendered = null;

@@ -41,4 +41,9 @@ 'use strict';

// not-premultiplied blend modes
array[_const.BLEND_MODES.NORMAL_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA];
array[_const.BLEND_MODES.ADD_NPM] = [gl.SRC_ALPHA, gl.DST_ALPHA, gl.ONE, gl.DST_ALPHA];
array[_const.BLEND_MODES.SCREEN_NPM] = [gl.SRC_ALPHA, gl.ONE_MINUS_SRC_COLOR, gl.ONE, gl.ONE_MINUS_SRC_COLOR];
return array;
}
//# sourceMappingURL=mapWebGLBlendModesToPixi.js.map

@@ -215,3 +215,3 @@ 'use strict';

this.destinationFrame = destinationFrame || this.destinationFrame || this.defaultFrame;
this.sourceFrame = sourceFrame || this.sourceFrame || destinationFrame;
this.sourceFrame = sourceFrame || this.sourceFrame || this.destinationFrame;
};

@@ -218,0 +218,0 @@

@@ -100,3 +100,3 @@ 'use strict';

* The resolution of the renderer retina would be 2.
* @param {boolean} [options.clearBeforeRender=true] - This sets if the CanvasRenderer will clear
* @param {boolean} [options.clearBeforeRender=true] - This sets if the renderer will clear
* the canvas or not before the new render pass. If you wish to set this to false, you *must* set

@@ -108,2 +108,4 @@ * preserveDrawingBuffer to `true`.

* rendering, stopping pixel interpolation.
* @param {number} [options.backgroundColor=0x000000] - The background color of the rendered area
* (shown if not transparent).
* @param {boolean} [options.legacy=false] - If true Pixi will aim to ensure compatibility

@@ -578,3 +580,3 @@ * with older / less advanced devices. If you experiance unexplained flickering try setting this to true.

* @param {boolean} forceLocation - force the location
* @return {PIXI.WebGLRenderer} Returns itself.
* @return {number} bound texture location
*/

@@ -581,0 +583,0 @@

@@ -166,3 +166,9 @@ 'use strict';

this.gl.blendFunc(this.blendModes[value][0], this.blendModes[value][1]);
var mode = this.blendModes[value];
if (mode.length === 2) {
this.gl.blendFunc(mode[0], mode[1]);
} else {
this.gl.blendFuncSeparate(mode[0], mode[1], mode[2], mode[3]);
}
};

@@ -169,0 +175,0 @@

@@ -413,6 +413,6 @@ 'use strict';

if (tempPoint.x > x1 && tempPoint.x < x1 + width) {
if (tempPoint.x >= x1 && tempPoint.x < x1 + width) {
y1 = -height * this.anchor.y;
if (tempPoint.y > y1 && tempPoint.y < y1 + height) {
if (tempPoint.y >= y1 && tempPoint.y < y1 + height) {
return true;

@@ -419,0 +419,0 @@ }

@@ -17,3 +17,3 @@ 'use strict';

function generateMultiTextureShader(gl, maxTextures) {
var vertexSrc = 'precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n';
var vertexSrc = 'precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = aTextureCoord;\n vTextureId = aTextureId;\n vColor = aColor;\n}\n';
var fragmentSrc = fragTemplate;

@@ -20,0 +20,0 @@

@@ -33,2 +33,4 @@ 'use strict';

var _utils = require('../../utils');
var _pixiGlCore = require('pixi-gl-core');

@@ -262,3 +264,3 @@

var uvs = void 0;
var blendMode = sprites[0].blendMode;
var blendMode = _utils.premultiplyBlendMode[sprites[0]._texture.baseTexture.premultipliedAlpha ? 1 : 0][sprites[0].blendMode];

@@ -286,5 +288,7 @@ currentGroup.textureCount = 0;

if (blendMode !== sprite.blendMode) {
var spriteBlendMode = _utils.premultiplyBlendMode[Number(nextTexture.premultipliedAlpha)][sprite.blendMode];
if (blendMode !== spriteBlendMode) {
// finish a group..
blendMode = sprite.blendMode;
blendMode = spriteBlendMode;

@@ -388,6 +392,8 @@ // force the batch to break!

uint32View[index + 17] = uvs[3];
/* eslint-disable max-len */
uint32View[index + 3] = uint32View[index + 8] = uint32View[index + 13] = uint32View[index + 18] = sprite._tintRGB + (Math.min(sprite.worldAlpha, 1) * 255 << 24);
var alpha = Math.min(sprite.worldAlpha, 1.0);
// we dont call extra function if alpha is 1.0, that's faster
var argb = alpha < 1.0 && nextTexture.premultipliedAlpha ? (0, _utils.premultiplyTint)(sprite._tintRGB, alpha) : sprite._tintRGB + (alpha * 255 << 24);
uint32View[index + 3] = uint32View[index + 8] = uint32View[index + 13] = uint32View[index + 18] = argb;
float32View[index + 4] = float32View[index + 9] = float32View[index + 14] = float32View[index + 19] = nextTexture._virtalBoundId;

@@ -394,0 +400,0 @@ /* eslint-enable max-len */

@@ -202,9 +202,8 @@ 'use strict';

if (style.dropShadow) {
context.fillStyle = style.dropShadowColor;
context.globalAlpha = style.dropShadowAlpha;
context.shadowBlur = style.dropShadowBlur;
context.globalAlpha = style.dropShadowAlpha;
if (style.dropShadowBlur > 0) {
context.shadowColor = style.dropShadowColor;
} else {
context.fillStyle = style.dropShadowColor;
}

@@ -211,0 +210,0 @@

@@ -21,3 +21,3 @@ 'use strict';

dropShadowBlur: 0,
dropShadowColor: '#000000',
dropShadowColor: 'black',
dropShadowDistance: 5,

@@ -64,3 +64,3 @@ fill: 'black',

* @param {number} [style.dropShadowBlur=0] - Set a shadow blur radius
* @param {string} [style.dropShadowColor='#000000'] - A fill style to be used on the dropshadow e.g 'red', '#00FF00'
* @param {string} [style.dropShadowColor='black'] - A fill style to be used on the dropshadow e.g 'red', '#00FF00'
* @param {number} [style.dropShadowDistance=5] - Set a distance of the drop shadow

@@ -67,0 +67,0 @@ * @param {string|string[]|number|number[]|CanvasGradient|CanvasPattern} [style.fill='black'] - A canvas

@@ -683,2 +683,4 @@ 'use strict';

image.crossOrigin = (0, _determineCrossOrigin2.default)(imageUrl);
} else if (crossorigin) {
image.crossOrigin = typeof crossorigin === 'string' ? crossorigin : 'anonymous';
}

@@ -685,0 +687,0 @@

'use strict';
exports.__esModule = true;
exports.BaseTextureCache = exports.TextureCache = exports.mixins = exports.pluginTarget = exports.EventEmitter = exports.removeItems = exports.isMobile = undefined;
exports.premultiplyBlendMode = exports.BaseTextureCache = exports.TextureCache = exports.mixins = exports.pluginTarget = exports.EventEmitter = exports.removeItems = exports.isMobile = undefined;
exports.uid = uid;

@@ -19,2 +19,6 @@ exports.hex2rgb = hex2rgb;

exports.clearTextureCache = clearTextureCache;
exports.correctBlendMode = correctBlendMode;
exports.premultiplyTint = premultiplyTint;
exports.premultiplyRgba = premultiplyRgba;
exports.premultiplyTintToRgba = premultiplyTintToRgba;

@@ -47,2 +51,6 @@ var _const = require('../const');

var _mapPremultipliedBlendModes = require('./mapPremultipliedBlendModes');
var _mapPremultipliedBlendModes2 = _interopRequireDefault(_mapPremultipliedBlendModes);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

@@ -372,2 +380,96 @@

}
/**
* @memberof PIXI.utils
* @const premultiplyBlendMode
* @type {Array<number[]>} maps premultiply flag and blendMode to adjusted blendMode
*/
var premultiplyBlendMode = exports.premultiplyBlendMode = (0, _mapPremultipliedBlendModes2.default)();
/**
* changes blendMode according to texture format
*
* @memberof PIXI.utils
* @function correctBlendMode
* @param {number} blendMode supposed blend mode
* @param {boolean} premultiplied whether source is premultiplied
* @returns {number} true blend mode for this texture
*/
function correctBlendMode(blendMode, premultiplied) {
return premultiplyBlendMode[premultiplied ? 1 : 0][blendMode];
}
/**
* premultiplies tint
*
* @param {number} tint integet RGB
* @param {number} alpha floating point alpha (0.0-1.0)
* @returns {number} tint multiplied by alpha
*/
function premultiplyTint(tint, alpha) {
if (alpha === 1.0) {
return (alpha * 255 << 24) + tint;
}
if (alpha === 0.0) {
return 0;
}
var R = tint >> 16 & 0xFF;
var G = tint >> 8 & 0xFF;
var B = tint & 0xFF;
R = R * alpha + 0.5 | 0;
G = G * alpha + 0.5 | 0;
B = B * alpha + 0.5 | 0;
return (alpha * 255 << 24) + (R << 16) + (G << 8) + B;
}
/**
* combines rgb and alpha to out array
*
* @param {Float32Array|number[]} rgb input rgb
* @param {number} alpha alpha param
* @param {Float32Array} [out] output
* @param {boolean} [premultiply=true] do premultiply it
* @returns {Float32Array} vec4 rgba
*/
function premultiplyRgba(rgb, alpha, out, premultiply) {
out = out || new Float32Array(4);
if (premultiply || premultiply === undefined) {
out[0] = rgb[0] * alpha;
out[1] = rgb[1] * alpha;
out[2] = rgb[2] * alpha;
} else {
out[0] = rgb[0];
out[1] = rgb[1];
out[2] = rgb[2];
}
out[3] = alpha;
return out;
}
/**
* converts integer tint and float alpha to vec4 form, premultiplies by default
*
* @param {number} tint input tint
* @param {number} alpha alpha param
* @param {Float32Array} [out] output
* @param {boolean} [premultiply=true] do premultiply it
* @returns {Float32Array} vec4 rgba
*/
function premultiplyTintToRgba(tint, alpha, out, premultiply) {
out = out || new Float32Array(4);
out[0] = (tint >> 16 & 0xFF) / 255.0;
out[1] = (tint >> 8 & 0xFF) / 255.0;
out[2] = (tint & 0xFF) / 255.0;
if (premultiply || premultiply === undefined) {
out[0] *= alpha;
out[1] *= alpha;
out[2] *= alpha;
}
out[3] = alpha;
return out;
}
//# sourceMappingURL=index.js.map

@@ -517,19 +517,21 @@ 'use strict';

Object.defineProperties(extras, {
if (extras.AnimatedSprite) {
Object.defineProperties(extras, {
/**
* @class
* @name MovieClip
* @memberof PIXI.extras
* @see PIXI.extras.AnimatedSprite
* @deprecated since version 4.2.0
*/
MovieClip: {
get: function get() {
warn('The MovieClip class has been renamed to AnimatedSprite, please use AnimatedSprite from now on.');
/**
* @class
* @name MovieClip
* @memberof PIXI.extras
* @see PIXI.extras.AnimatedSprite
* @deprecated since version 4.2.0
*/
MovieClip: {
get: function get() {
warn('The MovieClip class has been renamed to AnimatedSprite, please use AnimatedSprite from now on.');
return extras.AnimatedSprite;
return extras.AnimatedSprite;
}
}
}
});
});
}

@@ -590,13 +592,15 @@ core.DisplayObject.prototype.generateTexture = function generateTexture(renderer, scaleMode, resolution) {

/**
* @method
* @name PIXI.extras.BitmapText#setText
* @see PIXI.extras.BitmapText#text
* @deprecated since version 3.0.0
* @param {string} text - The text to set to.
*/
extras.BitmapText.prototype.setText = function setText(text) {
this.text = text;
warn('setText is now deprecated, please use the text property, e.g : myBitmapText.text = \'my text\';');
};
if (extras.BitmapText) {
/**
* @method
* @name PIXI.extras.BitmapText#setText
* @see PIXI.extras.BitmapText#text
* @deprecated since version 3.0.0
* @param {string} text - The text to set to.
*/
extras.BitmapText.prototype.setText = function setText(text) {
this.text = text;
warn('setText is now deprecated, please use the text property, e.g : myBitmapText.text = \'my text\';');
};
}

@@ -897,70 +901,76 @@ /**

/**
* @method
* @name PIXI.prepare.BasePrepare#register
* @see PIXI.prepare.BasePrepare#registerFindHook
* @deprecated since version 4.4.2
* @param {Function} [addHook] - Function call that takes two parameters: `item:*, queue:Array`
* function must return `true` if it was able to add item to the queue.
* @param {Function} [uploadHook] - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and
* function must return `true` if it was able to handle upload of item.
* @return {PIXI.BasePrepare} Instance of plugin for chaining.
*/
prepare.BasePrepare.prototype.register = function register(addHook, uploadHook) {
warn('renderer.plugins.prepare.register is now deprecated, ' + 'please use renderer.plugins.prepare.registerFindHook & renderer.plugins.prepare.registerUploadHook');
if (prepare.BasePrepare) {
/**
* @method
* @name PIXI.prepare.BasePrepare#register
* @see PIXI.prepare.BasePrepare#registerFindHook
* @deprecated since version 4.4.2
* @param {Function} [addHook] - Function call that takes two parameters: `item:*, queue:Array`
* function must return `true` if it was able to add item to the queue.
* @param {Function} [uploadHook] - Function call that takes two parameters: `prepare:CanvasPrepare, item:*` and
* function must return `true` if it was able to handle upload of item.
* @return {PIXI.BasePrepare} Instance of plugin for chaining.
*/
prepare.BasePrepare.prototype.register = function register(addHook, uploadHook) {
warn('renderer.plugins.prepare.register is now deprecated, ' + 'please use renderer.plugins.prepare.registerFindHook & renderer.plugins.prepare.registerUploadHook');
if (addHook) {
this.registerFindHook(addHook);
}
if (addHook) {
this.registerFindHook(addHook);
}
if (uploadHook) {
this.registerUploadHook(uploadHook);
}
if (uploadHook) {
this.registerUploadHook(uploadHook);
}
return this;
};
return this;
};
}
/**
* The number of graphics or textures to upload to the GPU.
*
* @name PIXI.prepare.canvas.UPLOADS_PER_FRAME
* @static
* @type {number}
* @see PIXI.prepare.BasePrepare.limiter
* @deprecated since 4.2.0
*/
Object.defineProperty(prepare.canvas, 'UPLOADS_PER_FRAME', {
set: function set() {
warn('PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please set ' + 'renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer');
// because we don't have a reference to the renderer, we can't actually set
// the uploads per frame, so we'll have to stick with the warning.
},
get: function get() {
warn('PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please use ' + 'renderer.plugins.prepare.limiter');
if (prepare.canvas) {
/**
* The number of graphics or textures to upload to the GPU.
*
* @name PIXI.prepare.canvas.UPLOADS_PER_FRAME
* @static
* @type {number}
* @see PIXI.prepare.BasePrepare.limiter
* @deprecated since 4.2.0
*/
Object.defineProperty(prepare.canvas, 'UPLOADS_PER_FRAME', {
set: function set() {
warn('PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please set ' + 'renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer');
// because we don't have a reference to the renderer, we can't actually set
// the uploads per frame, so we'll have to stick with the warning.
},
get: function get() {
warn('PIXI.CanvasPrepare.UPLOADS_PER_FRAME has been removed. Please use ' + 'renderer.plugins.prepare.limiter');
return NaN;
}
});
return NaN;
}
});
}
/**
* The number of graphics or textures to upload to the GPU.
*
* @name PIXI.prepare.webgl.UPLOADS_PER_FRAME
* @static
* @type {number}
* @see PIXI.prepare.BasePrepare.limiter
* @deprecated since 4.2.0
*/
Object.defineProperty(prepare.webgl, 'UPLOADS_PER_FRAME', {
set: function set() {
warn('PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please set ' + 'renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer');
// because we don't have a reference to the renderer, we can't actually set
// the uploads per frame, so we'll have to stick with the warning.
},
get: function get() {
warn('PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please use ' + 'renderer.plugins.prepare.limiter');
if (prepare.webgl) {
/**
* The number of graphics or textures to upload to the GPU.
*
* @name PIXI.prepare.webgl.UPLOADS_PER_FRAME
* @static
* @type {number}
* @see PIXI.prepare.BasePrepare.limiter
* @deprecated since 4.2.0
*/
Object.defineProperty(prepare.webgl, 'UPLOADS_PER_FRAME', {
set: function set() {
warn('PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please set ' + 'renderer.plugins.prepare.limiter.maxItemsPerFrame on your renderer');
// because we don't have a reference to the renderer, we can't actually set
// the uploads per frame, so we'll have to stick with the warning.
},
get: function get() {
warn('PIXI.WebGLPrepare.UPLOADS_PER_FRAME has been removed. Please use ' + 'renderer.plugins.prepare.limiter');
return NaN;
}
});
return NaN;
}
});
}

@@ -1027,59 +1037,63 @@ if (loaders.Loader) {

/**
* @name PIXI.interaction.interactiveTarget#defaultCursor
* @static
* @type {number}
* @see PIXI.interaction.interactiveTarget#cursor
* @deprecated since 4.3.0
*/
Object.defineProperty(interaction.interactiveTarget, 'defaultCursor', {
set: function set(value) {
warn('Property defaultCursor has been replaced with \'cursor\'. ');
this.cursor = value;
},
get: function get() {
warn('Property defaultCursor has been replaced with \'cursor\'. ');
if (interaction.interactiveTarget) {
/**
* @name PIXI.interaction.interactiveTarget#defaultCursor
* @static
* @type {number}
* @see PIXI.interaction.interactiveTarget#cursor
* @deprecated since 4.3.0
*/
Object.defineProperty(interaction.interactiveTarget, 'defaultCursor', {
set: function set(value) {
warn('Property defaultCursor has been replaced with \'cursor\'. ');
this.cursor = value;
},
get: function get() {
warn('Property defaultCursor has been replaced with \'cursor\'. ');
return this.cursor;
}
});
return this.cursor;
}
});
}
/**
* @name PIXI.interaction.InteractionManager#defaultCursorStyle
* @static
* @type {string}
* @see PIXI.interaction.InteractionManager#cursorStyles
* @deprecated since 4.3.0
*/
Object.defineProperty(interaction.InteractionManager, 'defaultCursorStyle', {
set: function set(value) {
warn('Property defaultCursorStyle has been replaced with \'cursorStyles.default\'. ');
this.cursorStyles.default = value;
},
get: function get() {
warn('Property defaultCursorStyle has been replaced with \'cursorStyles.default\'. ');
if (interaction.InteractionManager) {
/**
* @name PIXI.interaction.InteractionManager#defaultCursorStyle
* @static
* @type {string}
* @see PIXI.interaction.InteractionManager#cursorStyles
* @deprecated since 4.3.0
*/
Object.defineProperty(interaction.InteractionManager, 'defaultCursorStyle', {
set: function set(value) {
warn('Property defaultCursorStyle has been replaced with \'cursorStyles.default\'. ');
this.cursorStyles.default = value;
},
get: function get() {
warn('Property defaultCursorStyle has been replaced with \'cursorStyles.default\'. ');
return this.cursorStyles.default;
}
});
return this.cursorStyles.default;
}
});
/**
* @name PIXI.interaction.InteractionManager#currentCursorStyle
* @static
* @type {string}
* @see PIXI.interaction.InteractionManager#cursorStyles
* @deprecated since 4.3.0
*/
Object.defineProperty(interaction.InteractionManager, 'currentCursorStyle', {
set: function set(value) {
warn('Property currentCursorStyle has been removed.' + 'See the currentCursorMode property, which works differently.');
this.currentCursorMode = value;
},
get: function get() {
warn('Property currentCursorStyle has been removed.' + 'See the currentCursorMode property, which works differently.');
/**
* @name PIXI.interaction.InteractionManager#currentCursorStyle
* @static
* @type {string}
* @see PIXI.interaction.InteractionManager#cursorStyles
* @deprecated since 4.3.0
*/
Object.defineProperty(interaction.InteractionManager, 'currentCursorStyle', {
set: function set(value) {
warn('Property currentCursorStyle has been removed.' + 'See the currentCursorMode property, which works differently.');
this.currentCursorMode = value;
},
get: function get() {
warn('Property currentCursorStyle has been removed.' + 'See the currentCursorMode property, which works differently.');
return this.currentCursorMode;
}
});
return this.currentCursorMode;
}
});
}
}
//# sourceMappingURL=deprecation.js.map

@@ -110,2 +110,9 @@ 'use strict';

/**
* Function to call when 'loop' is true, and an AnimatedSprite is played and loops around to start again
*
* @member {Function}
*/
_this.onLoop = null;
/**
* Elapsed time since animation has been started, used internally to display current texture

@@ -249,2 +256,10 @@ *

} else if (previousFrame !== this.currentFrame) {
if (this.loop && this.onLoop) {
if (this.animationSpeed > 0 && this.currentFrame < previousFrame) {
this.onLoop();
} else if (this.animationSpeed < 0 && this.currentFrame > previousFrame) {
this.onLoop();
}
}
this.updateTexture();

@@ -251,0 +266,0 @@ }

@@ -127,4 +127,5 @@ 'use strict';

* @member {number}
* @private
*/
_this.maxWidth = 0;
_this._maxWidth = 0;

@@ -136,4 +137,5 @@ /**

* @member {number}
* @private
*/
_this.maxLineHeight = 0;
_this._maxLineHeight = 0;

@@ -181,2 +183,3 @@ /**

var lastSpaceWidth = 0;
var spacesRemoved = 0;
var maxLineHeight = 0;

@@ -203,6 +206,7 @@

if (lastSpace !== -1 && this.maxWidth > 0 && pos.x * scale > this.maxWidth) {
core.utils.removeItems(chars, lastSpace, i - lastSpace);
if (lastSpace !== -1 && this._maxWidth > 0 && pos.x * scale > this._maxWidth) {
core.utils.removeItems(chars, lastSpace - spacesRemoved, i - lastSpace);
i = lastSpace;
lastSpace = -1;
++spacesRemoved;

@@ -296,3 +300,3 @@ lineWidths.push(lastSpaceWidth);

}
this.maxLineHeight = maxLineHeight * scale;
this._maxLineHeight = maxLineHeight * scale;
};

@@ -511,2 +515,40 @@

/**
* The max width of this bitmap text in pixels. If the text provided is longer than the
* value provided, line breaks will be automatically inserted in the last whitespace.
* Disable by setting value to 0
*
* @member {number}
*/
}, {
key: 'maxWidth',
get: function get() {
return this._maxWidth;
},
set: function set(value) // eslint-disable-line require-jsdoc
{
if (this._maxWidth === value) {
return;
}
this._maxWidth = value;
this.dirty = true;
}
/**
* The max line height. This is useful when trying to use the total height of the Text,
* ie: when trying to vertically align.
*
* @member {number}
* @readonly
*/
}, {
key: 'maxLineHeight',
get: function get() {
this.validate();
return this._maxLineHeight;
}
/**
* The width of the overall text, different from fontSize,

@@ -513,0 +555,0 @@ * which is defined in the style object

@@ -192,3 +192,3 @@ 'use strict';

} else {
tempCanvas.context.drawImage(baseTexture.source, -texture._frame.x, -texture._frame.y);
tempCanvas.context.drawImage(baseTexture.source, -texture._frame.x * baseTextureResolution, -texture._frame.y * baseTextureResolution);
}

@@ -285,6 +285,6 @@ this._canvasPattern = tempCanvas.context.createPattern(tempCanvas.canvas, 'repeat');

if (tempPoint.x > x1 && tempPoint.x < x1 + width) {
if (tempPoint.x >= x1 && tempPoint.x < x1 + width) {
var y1 = -height * this.anchor._y;
if (tempPoint.y > y1 && tempPoint.y < y1 + height) {
if (tempPoint.y >= y1 && tempPoint.y < y1 + height) {
return true;

@@ -291,0 +291,0 @@ }

@@ -22,3 +22,2 @@ 'use strict';

var tempMat = new core.Matrix();
var tempArray = new Float32Array(4);

@@ -146,8 +145,3 @@ /**

shader.uniforms.uTransform = tempMat.toArray(true);
var color = tempArray;
core.utils.hex2rgb(ts.tint, color);
color[3] = ts.worldAlpha;
shader.uniforms.uColor = color;
shader.uniforms.uColor = core.utils.premultiplyTintToRgba(ts.tint, ts.worldAlpha, shader.uniforms.uColor, baseTex.premultipliedAlpha);
shader.uniforms.translationMatrix = ts.transform.worldTransform.toArray(true);

@@ -157,3 +151,3 @@

renderer.setBlendMode(ts.blendMode);
renderer.setBlendMode(core.utils.correctBlendMode(ts.blendMode, baseTex.premultipliedAlpha));

@@ -160,0 +154,0 @@ quad.vao.draw(this.renderer.gl.TRIANGLES, 6, 0);

@@ -66,3 +66,3 @@ 'use strict';

this.shader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n', 'varying vec2 vTextureCoord;\nuniform float alpha;\nuniform vec3 tint;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * vec4(tint * alpha, alpha);\n}\n');
this.shader = new core.Shader(gl, 'attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mat3 uTransform;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n\n vTextureCoord = (uTransform * vec3(aTextureCoord, 1.0)).xy;\n}\n', 'varying vec2 vTextureCoord;\nuniform vec4 uColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord) * uColor;\n}\n');
};

@@ -126,3 +126,3 @@

renderer.state.setBlendMode(mesh.blendMode);
renderer.state.setBlendMode(core.utils.correctBlendMode(mesh.blendMode, texture.baseTexture.premultipliedAlpha));

@@ -137,5 +137,5 @@ if (glData.shader.uniforms.uTransform) {

glData.shader.uniforms.translationMatrix = mesh.worldTransform.toArray(true);
glData.shader.uniforms.alpha = mesh.worldAlpha;
glData.shader.uniforms.tint = mesh.tintRgb;
glData.shader.uniforms.uColor = core.utils.premultiplyRgba(mesh.tintRgb, mesh.worldAlpha, glData.shader.uniforms.uColor, texture.baseTexture.premultipliedAlpha);
var drawMode = mesh.drawMode === _Mesh2.default.DRAW_MODES.TRIANGLE_MESH ? gl.TRIANGLE_STRIP : gl.TRIANGLES;

@@ -142,0 +142,0 @@

@@ -155,4 +155,4 @@ 'use strict';

*/
_this._tint = null;
_this._tintRGB = [];
_this._tint = 0;
_this.tintRgb = new Float32Array(4);
_this.tint = 0xFFFFFF;

@@ -363,3 +363,3 @@ return _this;

this._tint = value;
(0, _utils.hex2rgb)(value, this._tintRGB);
(0, _utils.hex2rgb)(value, this.tintRgb);
}

@@ -366,0 +366,0 @@ }]);

@@ -168,4 +168,6 @@ 'use strict';

var baseTexture = children[0]._texture.baseTexture;
// if the uvs have not updated then no point rendering just yet!
this.renderer.setBlendMode(container.blendMode);
this.renderer.setBlendMode(core.utils.correctBlendMode(container.blendMode, baseTexture.premultipliedAlpha));

@@ -179,8 +181,6 @@ var gl = renderer.gl;

this.shader.uniforms.projectionMatrix = m.toArray(true);
this.shader.uniforms.uAlpha = container.worldAlpha;
this.shader.uniforms.tint = container._tintRGB;
this.shader.uniforms.uColor = core.utils.premultiplyRgba(container.tintRgb, container.worldAlpha, this.shader.uniforms.uColor, baseTexture.premultipliedAlpha);
// make sure the texture is bound..
var baseTexture = children[0]._texture.baseTexture;
this.shader.uniforms.uSampler = renderer.bindTexture(baseTexture);

@@ -187,0 +187,0 @@

@@ -35,3 +35,3 @@ 'use strict';

// hello
['varying vec2 vTextureCoord;', 'varying float vColor;', 'uniform sampler2D uSampler;', 'uniform float uAlpha;', 'uniform vec3 tint;', 'void main(void){', ' vec4 color = texture2D(uSampler, vTextureCoord) * vColor * vec4(tint * uAlpha, uAlpha);', ' if (color.a == 0.0) discard;', ' gl_FragColor = color;', '}'].join('\n')));
['varying vec2 vTextureCoord;', 'varying float vColor;', 'uniform sampler2D uSampler;', 'uniform vec4 uColor;', 'void main(void){', ' vec4 color = texture2D(uSampler, vTextureCoord) * vColor * uColor;', ' if (color.a == 0.0) discard;', ' gl_FragColor = color;', '}'].join('\n')));
}

@@ -38,0 +38,0 @@

{
"name": "pixi.js",
"version": "4.5.2",
"version": "4.5.3",
"description": "Pixi.js is a fast lightweight 2D library that works across all devices.",

@@ -5,0 +5,0 @@ "author": "Mat Groves",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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

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

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

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

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

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc