pixi.js 7.2.0-rc.3 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/pixi.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * pixi.js - v7.2.0-rc.3
3
- * Compiled Sat, 11 Mar 2023 14:36:53 UTC
2
+ * pixi.js - v7.2.0
3
+ * Compiled Tue, 14 Mar 2023 19:26:30 UTC
4
4
  *
5
5
  * pixi.js is licensed under the MIT License.
6
6
  * http://www.opensource.org/licenses/mit-license
@@ -10358,7 +10358,7 @@ ${this.fragmentSrc}`;
10358
10358
  const { renderer } = this;
10359
10359
  renderer.runners.init.emit(renderer.options);
10360
10360
  if (options.hello) {
10361
- console.log(`PixiJS ${"7.2.0-rc.3"} - ${renderer.rendererLogId} - https://pixijs.com`);
10361
+ console.log(`PixiJS ${"7.2.0"} - ${renderer.rendererLogId} - https://pixijs.com`);
10362
10362
  }
10363
10363
  renderer.resize(renderer.screen.width, renderer.screen.height);
10364
10364
  }
@@ -12544,7 +12544,7 @@ ${this.fragmentSrc}`;
12544
12544
  }
12545
12545
  }
12546
12546
 
12547
- const VERSION = "7.2.0-rc.3";
12547
+ const VERSION = "7.2.0";
12548
12548
 
12549
12549
  class Bounds {
12550
12550
  constructor() {
@@ -16955,6 +16955,8 @@ ${e}`);
16955
16955
  return LoaderParserPriority2;
16956
16956
  })(LoaderParserPriority || {});
16957
16957
 
16958
+ const validJSONExtension = ".json";
16959
+ const validJSONMIME = "application/json";
16958
16960
  const loadJson = {
16959
16961
  extension: {
16960
16962
  type: ExtensionType.LoadParser,
@@ -16962,7 +16964,7 @@ ${e}`);
16962
16964
  },
16963
16965
  name: "loadJson",
16964
16966
  test(url) {
16965
- return path.extname(url).toLowerCase() === ".json";
16967
+ return checkDataUrl(url, validJSONMIME) || checkExtension(url, validJSONExtension);
16966
16968
  },
16967
16969
  async load(url) {
16968
16970
  const response = await settings.ADAPTER.fetch(url);
@@ -16972,6 +16974,8 @@ ${e}`);
16972
16974
  };
16973
16975
  extensions$1.add(loadJson);
16974
16976
 
16977
+ const validTXTExtension = ".txt";
16978
+ const validTXTMIME = "text/plain";
16975
16979
  const loadTxt = {
16976
16980
  name: "loadTxt",
16977
16981
  extension: {
@@ -16979,7 +16983,7 @@ ${e}`);
16979
16983
  priority: LoaderParserPriority.Low
16980
16984
  },
16981
16985
  test(url) {
16982
- return path.extname(url).toLowerCase() === ".txt";
16986
+ return checkDataUrl(url, validTXTMIME) || checkExtension(url, validTXTExtension);
16983
16987
  },
16984
16988
  async load(url) {
16985
16989
  const response = await settings.ADAPTER.fetch(url);
@@ -17280,6 +17284,8 @@ ${e}`);
17280
17284
  };
17281
17285
  extensions$1.add(loadTextures);
17282
17286
 
17287
+ const validSVGExtension = ".svg";
17288
+ const validSVGMIME = "image/svg+xml";
17283
17289
  const loadSVG = {
17284
17290
  extension: {
17285
17291
  type: ExtensionType.LoadParser,
@@ -17287,7 +17293,7 @@ ${e}`);
17287
17293
  },
17288
17294
  name: "loadSVG",
17289
17295
  test(url) {
17290
- return path.extname(url).toLowerCase() === ".svg";
17296
+ return checkDataUrl(url, validSVGMIME) || checkExtension(url, validSVGExtension);
17291
17297
  },
17292
17298
  async testParse(data) {
17293
17299
  return SVGResource.test(data);
@@ -24117,7 +24123,7 @@ ${e}`);
24117
24123
  };
24118
24124
  BitmapFont.available = {};
24119
24125
 
24120
- var msdfFrag = "// Pixi texture info\r\nvarying vec2 vTextureCoord;\r\nuniform sampler2D uSampler;\r\n\r\n// Tint\r\nuniform vec4 uColor;\r\n\r\n// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r\nuniform float uFWidth;\r\n\r\nvoid main(void) {\r\n\r\n // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r\n vec4 texColor = texture2D(uSampler, vTextureCoord);\r\n\r\n // MSDF\r\n float median = texColor.r + texColor.g + texColor.b -\r\n min(texColor.r, min(texColor.g, texColor.b)) -\r\n max(texColor.r, max(texColor.g, texColor.b));\r\n // SDF\r\n median = min(median, texColor.a);\r\n\r\n float screenPxDistance = uFWidth * (median - 0.5);\r\n float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r\n if (median < 0.01) {\r\n alpha = 0.0;\r\n } else if (median > 0.99) {\r\n alpha = 1.0;\r\n }\r\n\r\n // NPM Textures, NPM outputs\r\n gl_FragColor = vec4(uColor.rgb, uColor.a * alpha);\r\n\r\n}\r\n";
24126
+ var msdfFrag = "// Pixi texture info\r\nvarying vec2 vTextureCoord;\r\nuniform sampler2D uSampler;\r\n\r\n// Tint\r\nuniform vec4 uColor;\r\n\r\n// on 2D applications fwidth is screenScale / glyphAtlasScale * distanceFieldRange\r\nuniform float uFWidth;\r\n\r\nvoid main(void) {\r\n\r\n // To stack MSDF and SDF we need a non-pre-multiplied-alpha texture.\r\n vec4 texColor = texture2D(uSampler, vTextureCoord);\r\n\r\n // MSDF\r\n float median = texColor.r + texColor.g + texColor.b -\r\n min(texColor.r, min(texColor.g, texColor.b)) -\r\n max(texColor.r, max(texColor.g, texColor.b));\r\n // SDF\r\n median = min(median, texColor.a);\r\n\r\n float screenPxDistance = uFWidth * (median - 0.5);\r\n float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);\r\n if (median < 0.01) {\r\n alpha = 0.0;\r\n } else if (median > 0.99) {\r\n alpha = 1.0;\r\n }\r\n\r\n // Gamma correction for coverage-like alpha\r\n float luma = dot(uColor.rgb, vec3(0.299, 0.587, 0.114));\r\n float gamma = mix(1.0, 1.0 / 2.2, luma);\r\n float coverage = pow(uColor.a * alpha, gamma); \r\n\r\n // NPM Textures, NPM outputs\r\n gl_FragColor = vec4(uColor.rgb, coverage);\r\n}\r\n";
24121
24127
 
24122
24128
  var msdfVert = "// Mesh material default fragment\r\nattribute vec2 aVertexPosition;\r\nattribute vec2 aTextureCoord;\r\n\r\nuniform mat3 projectionMatrix;\r\nuniform mat3 translationMatrix;\r\nuniform mat3 uTextureMatrix;\r\n\r\nvarying vec2 vTextureCoord;\r\n\r\nvoid main(void)\r\n{\r\n gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\r\n\r\n vTextureCoord = (uTextureMatrix * vec3(aTextureCoord, 1.0)).xy;\r\n}\r\n";
24123
24129