@pixi/settings
Advanced tools
Comparing version 5.2.0 to 5.2.1
/*! | ||
* @pixi/settings - v5.2.0 | ||
* Compiled Wed, 06 Nov 2019 02:32:43 UTC | ||
* @pixi/settings - v5.2.1 | ||
* Compiled Tue, 28 Jan 2020 23:33:11 UTC | ||
* | ||
@@ -10,338 +10,411 @@ * @pixi/settings is licensed under the MIT License. | ||
var _pixi_settings = (function (exports) { | ||
'use strict'; | ||
'use strict'; | ||
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; | ||
var appleIphone = /iPhone/i; | ||
var appleIpod = /iPod/i; | ||
var appleTablet = /iPad/i; | ||
var androidPhone = /\bAndroid(?:.+)Mobile\b/i; | ||
var androidTablet = /Android/i; | ||
var amazonPhone = /(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i; | ||
var amazonTablet = /Silk/i; | ||
var windowsPhone = /Windows Phone/i; | ||
var windowsTablet = /\bWindows(?:.+)ARM\b/i; | ||
var otherBlackBerry = /BlackBerry/i; | ||
var otherBlackBerry10 = /BB10/i; | ||
var otherOpera = /Opera Mini/i; | ||
var otherChrome = /\b(CriOS|Chrome)(?:.+)Mobile/i; | ||
var otherFirefox = /Mobile(?:.+)Firefox\b/i; | ||
function match(regex, userAgent) { | ||
return regex.test(userAgent); | ||
} | ||
function isMobile(userAgent) { | ||
userAgent = | ||
userAgent || (typeof navigator !== 'undefined' ? navigator.userAgent : ''); | ||
var tmp = userAgent.split('[FBAN'); | ||
if (typeof tmp[1] !== 'undefined') { | ||
userAgent = tmp[0]; | ||
} | ||
tmp = userAgent.split('Twitter'); | ||
if (typeof tmp[1] !== 'undefined') { | ||
userAgent = tmp[0]; | ||
} | ||
var result = { | ||
apple: { | ||
phone: match(appleIphone, userAgent) && !match(windowsPhone, userAgent), | ||
ipod: match(appleIpod, userAgent), | ||
tablet: !match(appleIphone, userAgent) && | ||
match(appleTablet, userAgent) && | ||
!match(windowsPhone, userAgent), | ||
device: (match(appleIphone, userAgent) || | ||
match(appleIpod, userAgent) || | ||
match(appleTablet, userAgent)) && | ||
!match(windowsPhone, userAgent), | ||
}, | ||
amazon: { | ||
phone: match(amazonPhone, userAgent), | ||
tablet: !match(amazonPhone, userAgent) && match(amazonTablet, userAgent), | ||
device: match(amazonPhone, userAgent) || match(amazonTablet, userAgent), | ||
}, | ||
android: { | ||
phone: (!match(windowsPhone, userAgent) && match(amazonPhone, userAgent)) || | ||
(!match(windowsPhone, userAgent) && match(androidPhone, userAgent)), | ||
tablet: !match(windowsPhone, userAgent) && | ||
!match(amazonPhone, userAgent) && | ||
!match(androidPhone, userAgent) && | ||
(match(amazonTablet, userAgent) || match(androidTablet, userAgent)), | ||
device: (!match(windowsPhone, userAgent) && | ||
(match(amazonPhone, userAgent) || | ||
match(amazonTablet, userAgent) || | ||
match(androidPhone, userAgent) || | ||
match(androidTablet, userAgent))) || | ||
match(/\bokhttp\b/i, userAgent), | ||
}, | ||
windows: { | ||
phone: match(windowsPhone, userAgent), | ||
tablet: match(windowsTablet, userAgent), | ||
device: match(windowsPhone, userAgent) || match(windowsTablet, userAgent), | ||
}, | ||
other: { | ||
blackberry: match(otherBlackBerry, userAgent), | ||
blackberry10: match(otherBlackBerry10, userAgent), | ||
opera: match(otherOpera, userAgent), | ||
firefox: match(otherFirefox, userAgent), | ||
chrome: match(otherChrome, userAgent), | ||
device: match(otherBlackBerry, userAgent) || | ||
match(otherBlackBerry10, userAgent) || | ||
match(otherOpera, userAgent) || | ||
match(otherFirefox, userAgent) || | ||
match(otherChrome, userAgent), | ||
}, | ||
any: false, | ||
phone: false, | ||
tablet: false, | ||
}; | ||
result.any = | ||
result.apple.device || | ||
result.android.device || | ||
result.windows.device || | ||
result.other.device; | ||
result.phone = | ||
result.apple.phone || result.android.phone || result.windows.phone; | ||
result.tablet = | ||
result.apple.tablet || result.android.tablet || result.windows.tablet; | ||
return result; | ||
} | ||
function commonjsRequire () { | ||
throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs'); | ||
} | ||
// The ESM/CJS versions of ismobilejs only | ||
function unwrapExports (x) { | ||
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; | ||
} | ||
var isMobile$1 = isMobile(); | ||
function createCommonjsModule(fn, module) { | ||
return module = { exports: {} }, fn(module, module.exports), module.exports; | ||
} | ||
/** | ||
* The maximum recommended texture units to use. | ||
* In theory the bigger the better, and for desktop we'll use as many as we can. | ||
* But some mobile devices slow down if there is to many branches in the shader. | ||
* So in practice there seems to be a sweet spot size that varies depending on the device. | ||
* | ||
* In v4, all mobile devices were limited to 4 texture units because for this. | ||
* In v5, we allow all texture units to be used on modern Apple or Android devices. | ||
* | ||
* @private | ||
* @param {number} max | ||
* @returns {number} | ||
*/ | ||
function maxRecommendedTextures(max) | ||
{ | ||
var allowMax = true; | ||
function getCjsExportFromNamespace (n) { | ||
return n && n['default'] || n; | ||
} | ||
if (isMobile$1.tablet || isMobile$1.phone) | ||
{ | ||
allowMax = false; | ||
var isMobile_min = createCommonjsModule(function (module) { | ||
!function(e){var n=/iPhone/i,t=/iPod/i,r=/iPad/i,a=/\bAndroid(?:.+)Mobile\b/i,p=/Android/i,b=/\bAndroid(?:.+)SD4930UR\b/i,l=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,f=/Windows Phone/i,s=/\bWindows(?:.+)ARM\b/i,u=/BlackBerry/i,c=/BB10/i,h=/Opera Mini/i,v=/\b(CriOS|Chrome)(?:.+)Mobile/i,w=/Mobile(?:.+)Firefox\b/i;function m(e,i){return e.test(i)}function i(e){var i=e||("undefined"!=typeof navigator?navigator.userAgent:""),o=i.split("[FBAN");void 0!==o[1]&&(i=o[0]),void 0!==(o=i.split("Twitter"))[1]&&(i=o[0]);var d={apple:{phone:m(n,i)&&!m(f,i),ipod:m(t,i),tablet:!m(n,i)&&m(r,i)&&!m(f,i),device:(m(n,i)||m(t,i)||m(r,i))&&!m(f,i)},amazon:{phone:m(b,i),tablet:!m(b,i)&&m(l,i),device:m(b,i)||m(l,i)},android:{phone:!m(f,i)&&m(b,i)||!m(f,i)&&m(a,i),tablet:!m(f,i)&&!m(b,i)&&!m(a,i)&&(m(l,i)||m(p,i)),device:!m(f,i)&&(m(b,i)||m(l,i)||m(a,i)||m(p,i))||m(/\bokhttp\b/i,i)},windows:{phone:m(f,i),tablet:m(s,i),device:m(f,i)||m(s,i)},other:{blackberry:m(u,i),blackberry10:m(c,i),opera:m(h,i),firefox:m(w,i),chrome:m(v,i),device:m(u,i)||m(c,i)||m(h,i)||m(w,i)||m(v,i)}};return d.any=d.apple.device||d.android.device||d.windows.device||d.other.device,d.phone=d.apple.phone||d.android.phone||d.windows.phone,d.tablet=d.apple.tablet||d.android.tablet||d.windows.tablet,d}"undefined"!='object'&&module.exports&&"undefined"==typeof window?module.exports=i:"undefined"!='object'&&module.exports&&"undefined"!=typeof window?(module.exports=i(),module.exports.isMobile=i):"function"==typeof undefined&&undefined.amd?undefined([],e.isMobile=i()):e.isMobile=i();}(commonjsGlobal); | ||
}); | ||
var isMobile_min_1 = isMobile_min.isMobile; | ||
if (isMobile$1.apple.device) | ||
{ | ||
var match = (navigator.userAgent).match(/OS (\d+)_(\d+)?/); | ||
/** | ||
* The maximum recommended texture units to use. | ||
* In theory the bigger the better, and for desktop we'll use as many as we can. | ||
* But some mobile devices slow down if there is to many branches in the shader. | ||
* So in practice there seems to be a sweet spot size that varies depending on the device. | ||
* | ||
* In v4, all mobile devices were limited to 4 texture units because for this. | ||
* In v5, we allow all texture units to be used on modern Apple or Android devices. | ||
* | ||
* @private | ||
* @param {number} max | ||
* @returns {number} | ||
*/ | ||
function maxRecommendedTextures(max) | ||
{ | ||
var allowMax = true; | ||
if (match) | ||
{ | ||
var majorVersion = parseInt(match[1], 10); | ||
if (isMobile_min.tablet || isMobile_min.phone) | ||
{ | ||
allowMax = false; | ||
// All texture units can be used on devices that support ios 11 or above | ||
if (majorVersion >= 11) | ||
{ | ||
allowMax = true; | ||
} | ||
} | ||
} | ||
if (isMobile$1.android.device) | ||
{ | ||
var match$1 = (navigator.userAgent).match(/Android\s([0-9.]*)/); | ||
if (isMobile_min.apple.device) | ||
{ | ||
var match = (navigator.userAgent).match(/OS (\d+)_(\d+)?/); | ||
if (match$1) | ||
{ | ||
var majorVersion$1 = parseInt(match$1[1], 10); | ||
if (match) | ||
{ | ||
var majorVersion = parseInt(match[1], 10); | ||
// All texture units can be used on devices that support Android 7 (Nougat) or above | ||
if (majorVersion$1 >= 7) | ||
{ | ||
allowMax = true; | ||
} | ||
} | ||
} | ||
} | ||
// All texture units can be used on devices that support ios 11 or above | ||
if (majorVersion >= 11) | ||
{ | ||
allowMax = true; | ||
} | ||
} | ||
} | ||
if (isMobile_min.android.device) | ||
{ | ||
var match$1 = (navigator.userAgent).match(/Android\s([0-9.]*)/); | ||
return allowMax ? max : 4; | ||
} | ||
if (match$1) | ||
{ | ||
var majorVersion$1 = parseInt(match$1[1], 10); | ||
/** | ||
* Uploading the same buffer multiple times in a single frame can cause performance issues. | ||
* Apparent on iOS so only check for that at the moment | ||
* This check may become more complex if this issue pops up elsewhere. | ||
* | ||
* @private | ||
* @returns {boolean} | ||
*/ | ||
function canUploadSameBuffer() | ||
{ | ||
return !isMobile$1.apple.device; | ||
} | ||
// All texture units can be used on devices that support Android 7 (Nougat) or above | ||
if (majorVersion$1 >= 7) | ||
{ | ||
allowMax = true; | ||
} | ||
} | ||
} | ||
} | ||
/** | ||
* User's customizable globals for overriding the default PIXI settings, such | ||
* as a renderer's default resolution, framerate, float precision, etc. | ||
* @example | ||
* // Use the native window resolution as the default resolution | ||
* // will support high-density displays when rendering | ||
* PIXI.settings.RESOLUTION = window.devicePixelRatio; | ||
* | ||
* // Disable interpolation when scaling, will make texture be pixelated | ||
* PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST; | ||
* @namespace PIXI.settings | ||
*/ | ||
var settings = { | ||
return allowMax ? max : 4; | ||
} | ||
/** | ||
* If set to true WebGL will attempt make textures mimpaped by default. | ||
* Mipmapping will only succeed if the base texture uploaded has power of two dimensions. | ||
* | ||
* @static | ||
* @name MIPMAP_TEXTURES | ||
* @memberof PIXI.settings | ||
* @type {PIXI.MIPMAP_MODES} | ||
* @default PIXI.MIPMAP_MODES.POW2 | ||
*/ | ||
MIPMAP_TEXTURES: 1, | ||
/** | ||
* Uploading the same buffer multiple times in a single frame can cause performance issues. | ||
* Apparent on iOS so only check for that at the moment | ||
* This check may become more complex if this issue pops up elsewhere. | ||
* | ||
* @private | ||
* @returns {boolean} | ||
*/ | ||
function canUploadSameBuffer() | ||
{ | ||
return !isMobile_min.apple.device; | ||
} | ||
/** | ||
* Default anisotropic filtering level of textures. | ||
* Usually from 0 to 16 | ||
* | ||
* @static | ||
* @name ANISOTROPIC_LEVEL | ||
* @memberof PIXI.settings | ||
* @type {number} | ||
* @default 0 | ||
*/ | ||
ANISOTROPIC_LEVEL: 0, | ||
/** | ||
* User's customizable globals for overriding the default PIXI settings, such | ||
* as a renderer's default resolution, framerate, float precision, etc. | ||
* @example | ||
* // Use the native window resolution as the default resolution | ||
* // will support high-density displays when rendering | ||
* PIXI.settings.RESOLUTION = window.devicePixelRatio; | ||
* | ||
* // Disable interpolation when scaling, will make texture be pixelated | ||
* PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST; | ||
* @namespace PIXI.settings | ||
*/ | ||
var settings = { | ||
/** | ||
* Default resolution / device pixel ratio of the renderer. | ||
* | ||
* @static | ||
* @name RESOLUTION | ||
* @memberof PIXI.settings | ||
* @type {number} | ||
* @default 1 | ||
*/ | ||
RESOLUTION: 1, | ||
/** | ||
* If set to true WebGL will attempt make textures mimpaped by default. | ||
* Mipmapping will only succeed if the base texture uploaded has power of two dimensions. | ||
* | ||
* @static | ||
* @name MIPMAP_TEXTURES | ||
* @memberof PIXI.settings | ||
* @type {PIXI.MIPMAP_MODES} | ||
* @default PIXI.MIPMAP_MODES.POW2 | ||
*/ | ||
MIPMAP_TEXTURES: 1, | ||
/** | ||
* Default filter resolution. | ||
* | ||
* @static | ||
* @name FILTER_RESOLUTION | ||
* @memberof PIXI.settings | ||
* @type {number} | ||
* @default 1 | ||
*/ | ||
FILTER_RESOLUTION: 1, | ||
/** | ||
* Default anisotropic filtering level of textures. | ||
* Usually from 0 to 16 | ||
* | ||
* @static | ||
* @name ANISOTROPIC_LEVEL | ||
* @memberof PIXI.settings | ||
* @type {number} | ||
* @default 0 | ||
*/ | ||
ANISOTROPIC_LEVEL: 0, | ||
/** | ||
* The maximum textures that this device supports. | ||
* | ||
* @static | ||
* @name SPRITE_MAX_TEXTURES | ||
* @memberof PIXI.settings | ||
* @type {number} | ||
* @default 32 | ||
*/ | ||
SPRITE_MAX_TEXTURES: maxRecommendedTextures(32), | ||
/** | ||
* Default resolution / device pixel ratio of the renderer. | ||
* | ||
* @static | ||
* @name RESOLUTION | ||
* @memberof PIXI.settings | ||
* @type {number} | ||
* @default 1 | ||
*/ | ||
RESOLUTION: 1, | ||
// TODO: maybe change to SPRITE.BATCH_SIZE: 2000 | ||
// TODO: maybe add PARTICLE.BATCH_SIZE: 15000 | ||
/** | ||
* Default filter resolution. | ||
* | ||
* @static | ||
* @name FILTER_RESOLUTION | ||
* @memberof PIXI.settings | ||
* @type {number} | ||
* @default 1 | ||
*/ | ||
FILTER_RESOLUTION: 1, | ||
/** | ||
* The default sprite batch size. | ||
* | ||
* The default aims to balance desktop and mobile devices. | ||
* | ||
* @static | ||
* @name SPRITE_BATCH_SIZE | ||
* @memberof PIXI.settings | ||
* @type {number} | ||
* @default 4096 | ||
*/ | ||
SPRITE_BATCH_SIZE: 4096, | ||
/** | ||
* The maximum textures that this device supports. | ||
* | ||
* @static | ||
* @name SPRITE_MAX_TEXTURES | ||
* @memberof PIXI.settings | ||
* @type {number} | ||
* @default 32 | ||
*/ | ||
SPRITE_MAX_TEXTURES: maxRecommendedTextures(32), | ||
/** | ||
* The default render options if none are supplied to {@link PIXI.Renderer} | ||
* or {@link PIXI.CanvasRenderer}. | ||
* | ||
* @static | ||
* @name RENDER_OPTIONS | ||
* @memberof PIXI.settings | ||
* @type {object} | ||
* @property {HTMLCanvasElement} view=null | ||
* @property {number} resolution=1 | ||
* @property {boolean} antialias=false | ||
* @property {boolean} forceFXAA=false | ||
* @property {boolean} autoDensity=false | ||
* @property {boolean} transparent=false | ||
* @property {number} backgroundColor=0x000000 | ||
* @property {boolean} clearBeforeRender=true | ||
* @property {boolean} preserveDrawingBuffer=false | ||
* @property {number} width=800 | ||
* @property {number} height=600 | ||
* @property {boolean} legacy=false | ||
*/ | ||
RENDER_OPTIONS: { | ||
view: null, | ||
antialias: false, | ||
forceFXAA: false, | ||
autoDensity: false, | ||
transparent: false, | ||
backgroundColor: 0x000000, | ||
clearBeforeRender: true, | ||
preserveDrawingBuffer: false, | ||
width: 800, | ||
height: 600, | ||
legacy: false, | ||
}, | ||
// TODO: maybe change to SPRITE.BATCH_SIZE: 2000 | ||
// TODO: maybe add PARTICLE.BATCH_SIZE: 15000 | ||
/** | ||
* Default Garbage Collection mode. | ||
* | ||
* @static | ||
* @name GC_MODE | ||
* @memberof PIXI.settings | ||
* @type {PIXI.GC_MODES} | ||
* @default PIXI.GC_MODES.AUTO | ||
*/ | ||
GC_MODE: 0, | ||
/** | ||
* The default sprite batch size. | ||
* | ||
* The default aims to balance desktop and mobile devices. | ||
* | ||
* @static | ||
* @name SPRITE_BATCH_SIZE | ||
* @memberof PIXI.settings | ||
* @type {number} | ||
* @default 4096 | ||
*/ | ||
SPRITE_BATCH_SIZE: 4096, | ||
/** | ||
* Default Garbage Collection max idle. | ||
* | ||
* @static | ||
* @name GC_MAX_IDLE | ||
* @memberof PIXI.settings | ||
* @type {number} | ||
* @default 3600 | ||
*/ | ||
GC_MAX_IDLE: 60 * 60, | ||
/** | ||
* The default render options if none are supplied to {@link PIXI.Renderer} | ||
* or {@link PIXI.CanvasRenderer}. | ||
* | ||
* @static | ||
* @name RENDER_OPTIONS | ||
* @memberof PIXI.settings | ||
* @type {object} | ||
* @property {HTMLCanvasElement} view=null | ||
* @property {number} resolution=1 | ||
* @property {boolean} antialias=false | ||
* @property {boolean} forceFXAA=false | ||
* @property {boolean} autoDensity=false | ||
* @property {boolean} transparent=false | ||
* @property {number} backgroundColor=0x000000 | ||
* @property {boolean} clearBeforeRender=true | ||
* @property {boolean} preserveDrawingBuffer=false | ||
* @property {number} width=800 | ||
* @property {number} height=600 | ||
* @property {boolean} legacy=false | ||
*/ | ||
RENDER_OPTIONS: { | ||
view: null, | ||
antialias: false, | ||
forceFXAA: false, | ||
autoDensity: false, | ||
transparent: false, | ||
backgroundColor: 0x000000, | ||
clearBeforeRender: true, | ||
preserveDrawingBuffer: false, | ||
width: 800, | ||
height: 600, | ||
legacy: false, | ||
}, | ||
/** | ||
* Default Garbage Collection maximum check count. | ||
* | ||
* @static | ||
* @name GC_MAX_CHECK_COUNT | ||
* @memberof PIXI.settings | ||
* @type {number} | ||
* @default 600 | ||
*/ | ||
GC_MAX_CHECK_COUNT: 60 * 10, | ||
/** | ||
* Default Garbage Collection mode. | ||
* | ||
* @static | ||
* @name GC_MODE | ||
* @memberof PIXI.settings | ||
* @type {PIXI.GC_MODES} | ||
* @default PIXI.GC_MODES.AUTO | ||
*/ | ||
GC_MODE: 0, | ||
/** | ||
* Default wrap modes that are supported by pixi. | ||
* | ||
* @static | ||
* @name WRAP_MODE | ||
* @memberof PIXI.settings | ||
* @type {PIXI.WRAP_MODES} | ||
* @default PIXI.WRAP_MODES.CLAMP | ||
*/ | ||
WRAP_MODE: 33071, | ||
/** | ||
* Default Garbage Collection max idle. | ||
* | ||
* @static | ||
* @name GC_MAX_IDLE | ||
* @memberof PIXI.settings | ||
* @type {number} | ||
* @default 3600 | ||
*/ | ||
GC_MAX_IDLE: 60 * 60, | ||
/** | ||
* Default scale mode for textures. | ||
* | ||
* @static | ||
* @name SCALE_MODE | ||
* @memberof PIXI.settings | ||
* @type {PIXI.SCALE_MODES} | ||
* @default PIXI.SCALE_MODES.LINEAR | ||
*/ | ||
SCALE_MODE: 1, | ||
/** | ||
* Default Garbage Collection maximum check count. | ||
* | ||
* @static | ||
* @name GC_MAX_CHECK_COUNT | ||
* @memberof PIXI.settings | ||
* @type {number} | ||
* @default 600 | ||
*/ | ||
GC_MAX_CHECK_COUNT: 60 * 10, | ||
/** | ||
* Default specify float precision in vertex shader. | ||
* | ||
* @static | ||
* @name PRECISION_VERTEX | ||
* @memberof PIXI.settings | ||
* @type {PIXI.PRECISION} | ||
* @default PIXI.PRECISION.HIGH | ||
*/ | ||
PRECISION_VERTEX: 'highp', | ||
/** | ||
* Default wrap modes that are supported by pixi. | ||
* | ||
* @static | ||
* @name WRAP_MODE | ||
* @memberof PIXI.settings | ||
* @type {PIXI.WRAP_MODES} | ||
* @default PIXI.WRAP_MODES.CLAMP | ||
*/ | ||
WRAP_MODE: 33071, | ||
/** | ||
* Default specify float precision in fragment shader. | ||
* iOS is best set at highp due to https://github.com/pixijs/pixi.js/issues/3742 | ||
* | ||
* @static | ||
* @name PRECISION_FRAGMENT | ||
* @memberof PIXI.settings | ||
* @type {PIXI.PRECISION} | ||
* @default PIXI.PRECISION.MEDIUM | ||
*/ | ||
PRECISION_FRAGMENT: isMobile$1.apple.device ? 'highp' : 'mediump', | ||
/** | ||
* Default scale mode for textures. | ||
* | ||
* @static | ||
* @name SCALE_MODE | ||
* @memberof PIXI.settings | ||
* @type {PIXI.SCALE_MODES} | ||
* @default PIXI.SCALE_MODES.LINEAR | ||
*/ | ||
SCALE_MODE: 1, | ||
/** | ||
* Can we upload the same buffer in a single frame? | ||
* | ||
* @static | ||
* @name CAN_UPLOAD_SAME_BUFFER | ||
* @memberof PIXI.settings | ||
* @type {boolean} | ||
*/ | ||
CAN_UPLOAD_SAME_BUFFER: canUploadSameBuffer(), | ||
/** | ||
* Default specify float precision in vertex shader. | ||
* | ||
* @static | ||
* @name PRECISION_VERTEX | ||
* @memberof PIXI.settings | ||
* @type {PIXI.PRECISION} | ||
* @default PIXI.PRECISION.HIGH | ||
*/ | ||
PRECISION_VERTEX: 'highp', | ||
/** | ||
* Enables bitmap creation before image load. This feature is experimental. | ||
* | ||
* @static | ||
* @name CREATE_IMAGE_BITMAP | ||
* @memberof PIXI.settings | ||
* @type {boolean} | ||
* @default false | ||
*/ | ||
CREATE_IMAGE_BITMAP: false, | ||
/** | ||
* Default specify float precision in fragment shader. | ||
* iOS is best set at highp due to https://github.com/pixijs/pixi.js/issues/3742 | ||
* | ||
* @static | ||
* @name PRECISION_FRAGMENT | ||
* @memberof PIXI.settings | ||
* @type {PIXI.PRECISION} | ||
* @default PIXI.PRECISION.MEDIUM | ||
*/ | ||
PRECISION_FRAGMENT: isMobile_min.apple.device ? 'highp' : 'mediump', | ||
/** | ||
* If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. | ||
* Advantages can include sharper image quality (like text) and faster rendering on canvas. | ||
* The main disadvantage is movement of objects may appear less smooth. | ||
* | ||
* @static | ||
* @constant | ||
* @memberof PIXI.settings | ||
* @type {boolean} | ||
* @default false | ||
*/ | ||
ROUND_PIXELS: false, | ||
}; | ||
/** | ||
* Can we upload the same buffer in a single frame? | ||
* | ||
* @static | ||
* @name CAN_UPLOAD_SAME_BUFFER | ||
* @memberof PIXI.settings | ||
* @type {boolean} | ||
*/ | ||
CAN_UPLOAD_SAME_BUFFER: canUploadSameBuffer(), | ||
exports.isMobile = isMobile$1; | ||
exports.settings = settings; | ||
/** | ||
* Enables bitmap creation before image load. This feature is experimental. | ||
* | ||
* @static | ||
* @name CREATE_IMAGE_BITMAP | ||
* @memberof PIXI.settings | ||
* @type {boolean} | ||
* @default false | ||
*/ | ||
CREATE_IMAGE_BITMAP: false, | ||
return exports; | ||
/** | ||
* If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. | ||
* Advantages can include sharper image quality (like text) and faster rendering on canvas. | ||
* The main disadvantage is movement of objects may appear less smooth. | ||
* | ||
* @static | ||
* @constant | ||
* @memberof PIXI.settings | ||
* @type {boolean} | ||
* @default false | ||
*/ | ||
ROUND_PIXELS: false, | ||
}; | ||
exports.isMobile = isMobile_min; | ||
exports.settings = settings; | ||
return exports; | ||
}({})); | ||
Object.assign(this.PIXI, _pixi_settings); | ||
//# sourceMappingURL=settings.js.map |
/*! | ||
* @pixi/settings - v5.2.0 | ||
* Compiled Wed, 06 Nov 2019 02:32:43 UTC | ||
* @pixi/settings - v5.2.1 | ||
* Compiled Tue, 28 Jan 2020 23:33:11 UTC | ||
* | ||
@@ -8,3 +8,3 @@ * @pixi/settings is licensed under the MIT License. | ||
*/ | ||
this.PIXI=this.PIXI||{};var _pixi_settings=function(e){"use strict";var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var o,n=(function(e){!function(i){var o=/iPhone/i,n=/iPod/i,t=/iPad/i,r=/\bAndroid(?:.+)Mobile\b/i,d=/Android/i,a=/\bAndroid(?:.+)SD4930UR\b/i,p=/\bAndroid(?:.+)(?:KF[A-Z]{2,4})\b/i,s=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,b=/BlackBerry/i,f=/BB10/i,c=/Opera Mini/i,v=/\b(CriOS|Chrome)(?:.+)Mobile/i,E=/Mobile(?:.+)Firefox\b/i;function h(e,i){return e.test(i)}function _(e){var i=e||("undefined"!=typeof navigator?navigator.userAgent:""),_=i.split("[FBAN");void 0!==_[1]&&(i=_[0]),void 0!==(_=i.split("Twitter"))[1]&&(i=_[0]);var A={apple:{phone:h(o,i)&&!h(s,i),ipod:h(n,i),tablet:!h(o,i)&&h(t,i)&&!h(s,i),device:(h(o,i)||h(n,i)||h(t,i))&&!h(s,i)},amazon:{phone:h(a,i),tablet:!h(a,i)&&h(p,i),device:h(a,i)||h(p,i)},android:{phone:!h(s,i)&&h(a,i)||!h(s,i)&&h(r,i),tablet:!h(s,i)&&!h(a,i)&&!h(r,i)&&(h(p,i)||h(d,i)),device:!h(s,i)&&(h(a,i)||h(p,i)||h(r,i)||h(d,i))||h(/\bokhttp\b/i,i)},windows:{phone:h(s,i),tablet:h(l,i),device:h(s,i)||h(l,i)},other:{blackberry:h(b,i),blackberry10:h(f,i),opera:h(c,i),firefox:h(E,i),chrome:h(v,i),device:h(b,i)||h(f,i)||h(c,i)||h(E,i)||h(v,i)}};return A.any=A.apple.device||A.android.device||A.windows.device||A.other.device,A.phone=A.apple.phone||A.android.phone||A.windows.phone,A.tablet=A.apple.tablet||A.android.tablet||A.windows.tablet,A}e.exports&&"undefined"==typeof window?e.exports=_:e.exports&&"undefined"!=typeof window?(e.exports=_(),e.exports.isMobile=_):i.isMobile=_()}(i)}(o={exports:{}},o.exports),o.exports);n.isMobile;var t={MIPMAP_TEXTURES:1,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(e){var i=!0;if(n.tablet||n.phone){if(i=!1,n.apple.device){var o=navigator.userAgent.match(/OS (\d+)_(\d+)?/);o&&parseInt(o[1],10)>=11&&(i=!0)}if(n.android.device){var t=navigator.userAgent.match(/Android\s([0-9.]*)/);t&&parseInt(t[1],10)>=7&&(i=!0)}}return i?e:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:n.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!n.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};return e.isMobile=n,e.settings=t,e}({});Object.assign(this.PIXI,_pixi_settings); | ||
this.PIXI=this.PIXI||{};var _pixi_settings=function(e){"use strict";var i=/iPhone/i,t=/iPod/i,n=/iPad/i,a=/\bAndroid(?:.+)Mobile\b/i,r=/Android/i,o=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,d=/Silk/i,p=/Windows Phone/i,l=/\bWindows(?:.+)ARM\b/i,s=/BlackBerry/i,b=/BB10/i,E=/Opera Mini/i,v=/\b(CriOS|Chrome)(?:.+)Mobile/i,c=/Mobile(?:.+)Firefox\b/i;function h(e,i){return e.test(i)}var _=function(e){var _=(e=e||("undefined"!=typeof navigator?navigator.userAgent:"")).split("[FBAN");void 0!==_[1]&&(e=_[0]),void 0!==(_=e.split("Twitter"))[1]&&(e=_[0]);var I={apple:{phone:h(i,e)&&!h(p,e),ipod:h(t,e),tablet:!h(i,e)&&h(n,e)&&!h(p,e),device:(h(i,e)||h(t,e)||h(n,e))&&!h(p,e)},amazon:{phone:h(o,e),tablet:!h(o,e)&&h(d,e),device:h(o,e)||h(d,e)},android:{phone:!h(p,e)&&h(o,e)||!h(p,e)&&h(a,e),tablet:!h(p,e)&&!h(o,e)&&!h(a,e)&&(h(d,e)||h(r,e)),device:!h(p,e)&&(h(o,e)||h(d,e)||h(a,e)||h(r,e))||h(/\bokhttp\b/i,e)},windows:{phone:h(p,e),tablet:h(l,e),device:h(p,e)||h(l,e)},other:{blackberry:h(s,e),blackberry10:h(b,e),opera:h(E,e),firefox:h(c,e),chrome:h(v,e),device:h(s,e)||h(b,e)||h(E,e)||h(c,e)||h(v,e)},any:!1,phone:!1,tablet:!1};return I.any=I.apple.device||I.android.device||I.windows.device||I.other.device,I.phone=I.apple.phone||I.android.phone||I.windows.phone,I.tablet=I.apple.tablet||I.android.tablet||I.windows.tablet,I}();var I={MIPMAP_TEXTURES:1,ANISOTROPIC_LEVEL:0,RESOLUTION:1,FILTER_RESOLUTION:1,SPRITE_MAX_TEXTURES:function(e){var i=!0;if(_.tablet||_.phone){if(i=!1,_.apple.device){var t=navigator.userAgent.match(/OS (\d+)_(\d+)?/);t&&parseInt(t[1],10)>=11&&(i=!0)}if(_.android.device){var n=navigator.userAgent.match(/Android\s([0-9.]*)/);n&&parseInt(n[1],10)>=7&&(i=!0)}}return i?e:4}(32),SPRITE_BATCH_SIZE:4096,RENDER_OPTIONS:{view:null,antialias:!1,forceFXAA:!1,autoDensity:!1,transparent:!1,backgroundColor:0,clearBeforeRender:!0,preserveDrawingBuffer:!1,width:800,height:600,legacy:!1},GC_MODE:0,GC_MAX_IDLE:3600,GC_MAX_CHECK_COUNT:600,WRAP_MODE:33071,SCALE_MODE:1,PRECISION_VERTEX:"highp",PRECISION_FRAGMENT:_.apple.device?"highp":"mediump",CAN_UPLOAD_SAME_BUFFER:!_.apple.device,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};return e.isMobile=_,e.settings=I,e}({});Object.assign(this.PIXI,_pixi_settings); | ||
//# sourceMappingURL=settings.min.js.map |
/*! | ||
* @pixi/settings - v5.2.0 | ||
* Compiled Wed, 06 Nov 2019 02:32:43 UTC | ||
* @pixi/settings - v5.2.1 | ||
* Compiled Tue, 28 Jan 2020 23:33:11 UTC | ||
* | ||
@@ -8,5 +8,8 @@ * @pixi/settings is licensed under the MIT License. | ||
*/ | ||
import isMobile from 'ismobilejs'; | ||
export { default as isMobile } from 'ismobilejs'; | ||
import isMobileCall from 'ismobilejs'; | ||
// The ESM/CJS versions of ismobilejs only | ||
var isMobile = isMobileCall(); | ||
/** | ||
@@ -316,3 +319,3 @@ * The maximum recommended texture units to use. | ||
export { settings }; | ||
export { isMobile, settings }; | ||
//# sourceMappingURL=settings.es.js.map |
/*! | ||
* @pixi/settings - v5.2.0 | ||
* Compiled Wed, 06 Nov 2019 02:32:43 UTC | ||
* @pixi/settings - v5.2.1 | ||
* Compiled Tue, 28 Jan 2020 23:33:11 UTC | ||
* | ||
@@ -14,4 +14,8 @@ * @pixi/settings is licensed under the MIT License. | ||
var isMobile = _interopDefault(require('ismobilejs')); | ||
var isMobileCall = _interopDefault(require('ismobilejs')); | ||
// The ESM/CJS versions of ismobilejs only | ||
var isMobile = isMobileCall(); | ||
/** | ||
@@ -18,0 +22,0 @@ * The maximum recommended texture units to use. |
{ | ||
"name": "@pixi/settings", | ||
"version": "5.2.0", | ||
"version": "5.2.1", | ||
"main": "lib/settings.js", | ||
@@ -27,5 +27,5 @@ "module": "lib/settings.es.js", | ||
"dependencies": { | ||
"ismobilejs": "^0.5.1" | ||
"ismobilejs": "^1.0.3" | ||
}, | ||
"gitHead": "aaf96b460582b83a1fa73037ef2dd69dd9e84415" | ||
"gitHead": "b56b4fca1c169f0e6d2a0472251ba1f7399bb4a3" | ||
} |
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
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
93167
982
+ Addedismobilejs@1.1.1(transitive)
- Removedismobilejs@0.5.2(transitive)
Updatedismobilejs@^1.0.3