pixi.js 7.1.0 → 7.1.2
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/LICENSE +1 -1
- package/dist/pixi.js +100 -83
- package/dist/pixi.js.map +1 -1
- package/dist/pixi.min.js +58 -58
- package/dist/pixi.min.js.map +1 -1
- package/dist/pixi.min.mjs +60 -60
- package/dist/pixi.min.mjs.map +1 -1
- package/dist/pixi.mjs +100 -84
- package/dist/pixi.mjs.map +1 -1
- package/package.json +31 -31
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2013-
|
|
3
|
+
Copyright (c) 2013-2023 Mathew Groves, Chad Engler
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/dist/pixi.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* pixi.js - v7.1.
|
|
3
|
-
* Compiled Tue,
|
|
2
|
+
* pixi.js - v7.1.2
|
|
3
|
+
* Compiled Tue, 31 Jan 2023 14:52:16 UTC
|
|
4
4
|
*
|
|
5
5
|
* pixi.js is licensed under the MIT License.
|
|
6
6
|
* http://www.opensource.org/licenses/mit-license
|
|
@@ -224,16 +224,15 @@ var PIXI = (function (exports) {
|
|
|
224
224
|
RESOLUTION: 1,
|
|
225
225
|
RENDER_OPTIONS: {
|
|
226
226
|
view: null,
|
|
227
|
-
|
|
227
|
+
width: 800,
|
|
228
|
+
height: 600,
|
|
228
229
|
autoDensity: false,
|
|
229
230
|
backgroundColor: 0,
|
|
230
231
|
backgroundAlpha: 1,
|
|
231
|
-
premultipliedAlpha: true,
|
|
232
232
|
clearBeforeRender: true,
|
|
233
|
+
antialias: false,
|
|
234
|
+
premultipliedAlpha: true,
|
|
233
235
|
preserveDrawingBuffer: false,
|
|
234
|
-
width: 800,
|
|
235
|
-
height: 600,
|
|
236
|
-
legacy: false,
|
|
237
236
|
hello: false
|
|
238
237
|
},
|
|
239
238
|
CREATE_IMAGE_BITMAP: false,
|
|
@@ -7973,7 +7972,7 @@ ${this.fragmentSrc}`;
|
|
|
7973
7972
|
}
|
|
7974
7973
|
static fromLoader(source, imageUrl, name, options) {
|
|
7975
7974
|
const baseTexture = new BaseTexture(source, Object.assign({
|
|
7976
|
-
scaleMode:
|
|
7975
|
+
scaleMode: BaseTexture.defaultOptions.scaleMode,
|
|
7977
7976
|
resolution: getResolutionOfUrl(imageUrl)
|
|
7978
7977
|
}, options));
|
|
7979
7978
|
const { resource } = baseTexture;
|
|
@@ -9358,7 +9357,7 @@ ${this.fragmentSrc}`;
|
|
|
9358
9357
|
this.pooled = false;
|
|
9359
9358
|
this.isMaskData = true;
|
|
9360
9359
|
this.resolution = null;
|
|
9361
|
-
this.multisample =
|
|
9360
|
+
this.multisample = Filter.defaultMultisample;
|
|
9362
9361
|
this.enabled = true;
|
|
9363
9362
|
this.colorMask = 15;
|
|
9364
9363
|
this._filters = null;
|
|
@@ -10458,7 +10457,7 @@ ${this.fragmentSrc}`;
|
|
|
10458
10457
|
const renderer = this.renderer;
|
|
10459
10458
|
renderer.emitWithCustomOptions(renderer.runners.init, options);
|
|
10460
10459
|
if (options.hello) {
|
|
10461
|
-
console.log(`PixiJS ${"7.1.
|
|
10460
|
+
console.log(`PixiJS ${"7.1.2"} - ${renderer.rendererLogId} - https://pixijs.com`);
|
|
10462
10461
|
}
|
|
10463
10462
|
renderer.resize(this.renderer.screen.width, this.renderer.screen.height);
|
|
10464
10463
|
}
|
|
@@ -11241,7 +11240,7 @@ ${this.fragmentSrc}`;
|
|
|
11241
11240
|
return BaseTexture.defaultOptions.wrapMode;
|
|
11242
11241
|
},
|
|
11243
11242
|
set(value) {
|
|
11244
|
-
deprecation("7.1.0", "settings.WRAP_MODE is deprecated, use
|
|
11243
|
+
deprecation("7.1.0", "settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode");
|
|
11245
11244
|
BaseTexture.defaultOptions.wrapMode = value;
|
|
11246
11245
|
}
|
|
11247
11246
|
},
|
|
@@ -11250,7 +11249,7 @@ ${this.fragmentSrc}`;
|
|
|
11250
11249
|
return BaseTexture.defaultOptions.scaleMode;
|
|
11251
11250
|
},
|
|
11252
11251
|
set(value) {
|
|
11253
|
-
deprecation("7.1.0", "settings.SCALE_MODE is deprecated, use
|
|
11252
|
+
deprecation("7.1.0", "settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode");
|
|
11254
11253
|
BaseTexture.defaultOptions.scaleMode = value;
|
|
11255
11254
|
}
|
|
11256
11255
|
},
|
|
@@ -11259,7 +11258,7 @@ ${this.fragmentSrc}`;
|
|
|
11259
11258
|
return BaseTexture.defaultOptions.mipmap;
|
|
11260
11259
|
},
|
|
11261
11260
|
set(value) {
|
|
11262
|
-
deprecation("7.1.0", "settings.MIPMAP_TEXTURES is deprecated, use
|
|
11261
|
+
deprecation("7.1.0", "settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap");
|
|
11263
11262
|
BaseTexture.defaultOptions.mipmap = value;
|
|
11264
11263
|
}
|
|
11265
11264
|
},
|
|
@@ -11268,7 +11267,7 @@ ${this.fragmentSrc}`;
|
|
|
11268
11267
|
return BaseTexture.defaultOptions.anisotropicLevel;
|
|
11269
11268
|
},
|
|
11270
11269
|
set(value) {
|
|
11271
|
-
deprecation("7.1.0", "settings.ANISOTROPIC_LEVEL is deprecated, use
|
|
11270
|
+
deprecation("7.1.0", "settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel");
|
|
11272
11271
|
BaseTexture.defaultOptions.anisotropicLevel = value;
|
|
11273
11272
|
}
|
|
11274
11273
|
},
|
|
@@ -11964,8 +11963,8 @@ ${this.fragmentSrc}`;
|
|
|
11964
11963
|
preserveDrawingBuffer: options.preserveDrawingBuffer
|
|
11965
11964
|
}
|
|
11966
11965
|
};
|
|
11967
|
-
this.startup.run(startupOptions);
|
|
11968
11966
|
this.options = options;
|
|
11967
|
+
this.startup.run(startupOptions);
|
|
11969
11968
|
}
|
|
11970
11969
|
static test(options) {
|
|
11971
11970
|
if (options?.forceCanvas) {
|
|
@@ -12288,17 +12287,18 @@ ${this.fragmentSrc}`;
|
|
|
12288
12287
|
|
|
12289
12288
|
class ImageBitmapResource extends BaseImageResource {
|
|
12290
12289
|
constructor(source, options) {
|
|
12291
|
-
var __super = (...args) => {
|
|
12292
|
-
super(...args);
|
|
12293
|
-
};
|
|
12294
12290
|
options = options || {};
|
|
12291
|
+
let baseSource;
|
|
12292
|
+
let url;
|
|
12295
12293
|
if (typeof source === "string") {
|
|
12296
|
-
|
|
12297
|
-
|
|
12294
|
+
baseSource = ImageBitmapResource.EMPTY;
|
|
12295
|
+
url = source;
|
|
12298
12296
|
} else {
|
|
12299
|
-
|
|
12300
|
-
|
|
12297
|
+
baseSource = source;
|
|
12298
|
+
url = null;
|
|
12301
12299
|
}
|
|
12300
|
+
super(baseSource);
|
|
12301
|
+
this.url = url;
|
|
12302
12302
|
this.crossOrigin = options.crossOrigin ?? true;
|
|
12303
12303
|
this.alphaMode = typeof options.alphaMode === "number" ? options.alphaMode : null;
|
|
12304
12304
|
this._load = null;
|
|
@@ -12648,7 +12648,7 @@ ${this.fragmentSrc}`;
|
|
|
12648
12648
|
}
|
|
12649
12649
|
}
|
|
12650
12650
|
|
|
12651
|
-
const VERSION = "7.1.
|
|
12651
|
+
const VERSION = "7.1.2";
|
|
12652
12652
|
|
|
12653
12653
|
class Bounds {
|
|
12654
12654
|
constructor() {
|
|
@@ -14157,7 +14157,7 @@ ${this.fragmentSrc}`;
|
|
|
14157
14157
|
}
|
|
14158
14158
|
|
|
14159
14159
|
class BlurFilterPass extends Filter {
|
|
14160
|
-
constructor(horizontal, strength = 8, quality = 4, resolution =
|
|
14160
|
+
constructor(horizontal, strength = 8, quality = 4, resolution = Filter.defaultResolution, kernelSize = 5) {
|
|
14161
14161
|
const vertSrc = generateBlurVertSource(kernelSize, horizontal);
|
|
14162
14162
|
const fragSrc = generateBlurFragSource(kernelSize);
|
|
14163
14163
|
super(vertSrc, fragSrc);
|
|
@@ -15353,7 +15353,7 @@ ${this.fragmentSrc}`;
|
|
|
15353
15353
|
const isMouse = e.pointerType === "mouse" || e.pointerType === "pen";
|
|
15354
15354
|
const trackingData = this.trackingData(from.pointerId);
|
|
15355
15355
|
const outTarget = this.findMountedTarget(trackingData.overTargets);
|
|
15356
|
-
if (trackingData.overTargets && outTarget !== e.target) {
|
|
15356
|
+
if (trackingData.overTargets?.length > 0 && outTarget !== e.target) {
|
|
15357
15357
|
const outType = from.type === "mousemove" ? "mouseout" : "pointerout";
|
|
15358
15358
|
const outEvent = this.createPointerEvent(from, outType, outTarget);
|
|
15359
15359
|
this.dispatchEvent(outEvent, "pointerout");
|
|
@@ -15402,10 +15402,14 @@ ${this.fragmentSrc}`;
|
|
|
15402
15402
|
}
|
|
15403
15403
|
const propagationMethod = this.moveOnAll ? "all" : "dispatchEvent";
|
|
15404
15404
|
this[propagationMethod](e, "pointermove");
|
|
15405
|
-
|
|
15405
|
+
this.all(e, "globalpointermove");
|
|
15406
|
+
if (e.pointerType === "touch") {
|
|
15406
15407
|
this[propagationMethod](e, "touchmove");
|
|
15408
|
+
this.all(e, "globaltouchmove");
|
|
15409
|
+
}
|
|
15407
15410
|
if (isMouse) {
|
|
15408
15411
|
this[propagationMethod](e, "mousemove");
|
|
15412
|
+
this.all(e, "globalmousemove");
|
|
15409
15413
|
this.cursor = e.target?.cursor;
|
|
15410
15414
|
}
|
|
15411
15415
|
trackingData.overTargets = e.composedPath();
|
|
@@ -16071,6 +16075,7 @@ ${this.fragmentSrc}`;
|
|
|
16071
16075
|
onmouseenter: null,
|
|
16072
16076
|
onmouseleave: null,
|
|
16073
16077
|
onmousemove: null,
|
|
16078
|
+
onglobalmousemove: null,
|
|
16074
16079
|
onmouseout: null,
|
|
16075
16080
|
onmouseover: null,
|
|
16076
16081
|
onmouseup: null,
|
|
@@ -16080,6 +16085,7 @@ ${this.fragmentSrc}`;
|
|
|
16080
16085
|
onpointerenter: null,
|
|
16081
16086
|
onpointerleave: null,
|
|
16082
16087
|
onpointermove: null,
|
|
16088
|
+
onglobalpointermove: null,
|
|
16083
16089
|
onpointerout: null,
|
|
16084
16090
|
onpointerover: null,
|
|
16085
16091
|
onpointertap: null,
|
|
@@ -16094,6 +16100,7 @@ ${this.fragmentSrc}`;
|
|
|
16094
16100
|
ontouchend: null,
|
|
16095
16101
|
ontouchendoutside: null,
|
|
16096
16102
|
ontouchmove: null,
|
|
16103
|
+
onglobaltouchmove: null,
|
|
16097
16104
|
ontouchstart: null,
|
|
16098
16105
|
onwheel: null,
|
|
16099
16106
|
interactive: false,
|
|
@@ -16614,6 +16621,14 @@ ${this.fragmentSrc}`;
|
|
|
16614
16621
|
});
|
|
16615
16622
|
};
|
|
16616
16623
|
|
|
16624
|
+
const copySearchParams = (targetUrl, sourceUrl) => {
|
|
16625
|
+
const searchParams = sourceUrl.split("?")[1];
|
|
16626
|
+
if (searchParams) {
|
|
16627
|
+
targetUrl += `?${searchParams}`;
|
|
16628
|
+
}
|
|
16629
|
+
return targetUrl;
|
|
16630
|
+
};
|
|
16631
|
+
|
|
16617
16632
|
function processX(base, ids, depth, result, tags) {
|
|
16618
16633
|
const id = ids[depth];
|
|
16619
16634
|
for (let i = 0; i < id.length; i++) {
|
|
@@ -16889,9 +16904,6 @@ ${e}`);
|
|
|
16889
16904
|
return checkDataUrl(url, validFontMIMEs) || checkExtension(url, validFontExtensions);
|
|
16890
16905
|
},
|
|
16891
16906
|
async load(url, options) {
|
|
16892
|
-
if (!globalThis.navigator.onLine) {
|
|
16893
|
-
throw new Error("[loadWebFont] Cannot load font - navigator is offline");
|
|
16894
|
-
}
|
|
16895
16907
|
const fonts = settings.ADAPTER.getFontFaceSet();
|
|
16896
16908
|
if (fonts) {
|
|
16897
16909
|
const fontFaces = [];
|
|
@@ -17177,9 +17189,14 @@ ${e}`);
|
|
|
17177
17189
|
|
|
17178
17190
|
class Resolver {
|
|
17179
17191
|
constructor() {
|
|
17180
|
-
this.
|
|
17181
|
-
|
|
17182
|
-
|
|
17192
|
+
this._defaultBundleIdentifierOptions = {
|
|
17193
|
+
connector: "-",
|
|
17194
|
+
createBundleAssetId: (bundleId, assetId) => `${bundleId}${this._bundleIdConnector}${assetId}`,
|
|
17195
|
+
extractAssetIdFromBundle: (bundleId, assetBundleId) => assetBundleId.replace(`${bundleId}${this._bundleIdConnector}`, "")
|
|
17196
|
+
};
|
|
17197
|
+
this._bundleIdConnector = this._defaultBundleIdentifierOptions.connector;
|
|
17198
|
+
this._createBundleAssetId = this._defaultBundleIdentifierOptions.createBundleAssetId;
|
|
17199
|
+
this._extractAssetIdFromBundle = this._defaultBundleIdentifierOptions.extractAssetIdFromBundle;
|
|
17183
17200
|
this._assetMap = {};
|
|
17184
17201
|
this._preferredOrder = [];
|
|
17185
17202
|
this._parsers = [];
|
|
@@ -17219,12 +17236,15 @@ ${e}`);
|
|
|
17219
17236
|
return this._parsers;
|
|
17220
17237
|
}
|
|
17221
17238
|
reset() {
|
|
17239
|
+
this.setBundleIdentifier(this._defaultBundleIdentifierOptions);
|
|
17240
|
+
this._assetMap = {};
|
|
17222
17241
|
this._preferredOrder = [];
|
|
17223
17242
|
this._resolverHash = {};
|
|
17224
|
-
this._assetMap = {};
|
|
17225
17243
|
this._rootPath = null;
|
|
17226
17244
|
this._basePath = null;
|
|
17227
17245
|
this._manifest = null;
|
|
17246
|
+
this._bundles = {};
|
|
17247
|
+
this._defaultSearchParams = null;
|
|
17228
17248
|
}
|
|
17229
17249
|
setDefaultSearchParams(searchParams) {
|
|
17230
17250
|
if (typeof searchParams === "string") {
|
|
@@ -17250,7 +17270,7 @@ ${e}`);
|
|
|
17250
17270
|
if (typeof asset.name === "string") {
|
|
17251
17271
|
const bundleAssetId = this._createBundleAssetId(bundleId, asset.name);
|
|
17252
17272
|
assetNames.push(bundleAssetId);
|
|
17253
|
-
this.add([asset.name, bundleAssetId], asset.srcs);
|
|
17273
|
+
this.add([asset.name, bundleAssetId], asset.srcs, asset.data);
|
|
17254
17274
|
} else {
|
|
17255
17275
|
const bundleIds = asset.name.map((name) => this._createBundleAssetId(bundleId, name));
|
|
17256
17276
|
bundleIds.forEach((bundleId2) => {
|
|
@@ -17270,7 +17290,7 @@ ${e}`);
|
|
|
17270
17290
|
add(keysIn, assetsIn, data) {
|
|
17271
17291
|
const keys = convertToList(keysIn);
|
|
17272
17292
|
keys.forEach((key) => {
|
|
17273
|
-
if (this.
|
|
17293
|
+
if (this.hasKey(key)) {
|
|
17274
17294
|
console.warn(`[Resolver] already has key: ${key} overwriting`);
|
|
17275
17295
|
}
|
|
17276
17296
|
});
|
|
@@ -17384,6 +17404,12 @@ ${e}`);
|
|
|
17384
17404
|
});
|
|
17385
17405
|
return singleAsset ? result[keys[0]] : result;
|
|
17386
17406
|
}
|
|
17407
|
+
hasKey(key) {
|
|
17408
|
+
return !!this._assetMap[key];
|
|
17409
|
+
}
|
|
17410
|
+
hasBundle(key) {
|
|
17411
|
+
return !!this._bundles[key];
|
|
17412
|
+
}
|
|
17387
17413
|
_getPreferredOrder(assets) {
|
|
17388
17414
|
for (let i = 0; i < assets.length; i++) {
|
|
17389
17415
|
const asset = assets[0];
|
|
@@ -17473,6 +17499,9 @@ ${e}`);
|
|
|
17473
17499
|
this.resolver.add(url.src, url);
|
|
17474
17500
|
return url.src;
|
|
17475
17501
|
}
|
|
17502
|
+
if (!this.resolver.hasKey(url)) {
|
|
17503
|
+
this.resolver.add(url, url);
|
|
17504
|
+
}
|
|
17476
17505
|
return url;
|
|
17477
17506
|
});
|
|
17478
17507
|
const resolveResults = this.resolver.resolve(urlArray);
|
|
@@ -18513,42 +18542,10 @@ ${e}`);
|
|
|
18513
18542
|
throw new Error("Extract.base64() requires ICanvas.toDataURL or ICanvas.convertToBlob to be implemented");
|
|
18514
18543
|
}
|
|
18515
18544
|
canvas(target, frame) {
|
|
18516
|
-
const
|
|
18517
|
-
let resolution;
|
|
18518
|
-
let flipY = false;
|
|
18519
|
-
let renderTexture;
|
|
18520
|
-
let generated = false;
|
|
18521
|
-
if (target) {
|
|
18522
|
-
if (target instanceof RenderTexture) {
|
|
18523
|
-
renderTexture = target;
|
|
18524
|
-
} else {
|
|
18525
|
-
renderTexture = this.renderer.generateTexture(target);
|
|
18526
|
-
generated = true;
|
|
18527
|
-
}
|
|
18528
|
-
}
|
|
18529
|
-
if (renderTexture) {
|
|
18530
|
-
resolution = renderTexture.baseTexture.resolution;
|
|
18531
|
-
frame = frame ?? renderTexture.frame;
|
|
18532
|
-
flipY = false;
|
|
18533
|
-
renderer.renderTexture.bind(renderTexture);
|
|
18534
|
-
} else {
|
|
18535
|
-
resolution = renderer.resolution;
|
|
18536
|
-
if (!frame) {
|
|
18537
|
-
frame = TEMP_RECT;
|
|
18538
|
-
frame.width = renderer.width;
|
|
18539
|
-
frame.height = renderer.height;
|
|
18540
|
-
}
|
|
18541
|
-
flipY = true;
|
|
18542
|
-
renderer.renderTexture.bind(null);
|
|
18543
|
-
}
|
|
18544
|
-
const width = Math.round(frame.width * resolution);
|
|
18545
|
-
const height = Math.round(frame.height * resolution);
|
|
18545
|
+
const { pixels, width, height, flipY } = this._rawPixels(target, frame);
|
|
18546
18546
|
let canvasBuffer = new CanvasRenderTarget(width, height, 1);
|
|
18547
|
-
const webglPixels = new Uint8Array(BYTES_PER_PIXEL * width * height);
|
|
18548
|
-
const gl = renderer.gl;
|
|
18549
|
-
gl.readPixels(Math.round(frame.x * resolution), Math.round(frame.y * resolution), width, height, gl.RGBA, gl.UNSIGNED_BYTE, webglPixels);
|
|
18550
18547
|
const canvasData = canvasBuffer.context.getImageData(0, 0, width, height);
|
|
18551
|
-
_Extract.arrayPostDivide(
|
|
18548
|
+
_Extract.arrayPostDivide(pixels, canvasData.data);
|
|
18552
18549
|
canvasBuffer.context.putImageData(canvasData, 0, 0);
|
|
18553
18550
|
if (flipY) {
|
|
18554
18551
|
const target2 = new CanvasRenderTarget(canvasBuffer.width, canvasBuffer.height, 1);
|
|
@@ -18557,27 +18554,43 @@ ${e}`);
|
|
|
18557
18554
|
canvasBuffer.destroy();
|
|
18558
18555
|
canvasBuffer = target2;
|
|
18559
18556
|
}
|
|
18560
|
-
if (generated) {
|
|
18561
|
-
renderTexture.destroy(true);
|
|
18562
|
-
}
|
|
18563
18557
|
return canvasBuffer.canvas;
|
|
18564
18558
|
}
|
|
18565
18559
|
pixels(target, frame) {
|
|
18560
|
+
const { pixels } = this._rawPixels(target, frame);
|
|
18561
|
+
_Extract.arrayPostDivide(pixels, pixels);
|
|
18562
|
+
return pixels;
|
|
18563
|
+
}
|
|
18564
|
+
_rawPixels(target, frame) {
|
|
18566
18565
|
const renderer = this.renderer;
|
|
18567
18566
|
let resolution;
|
|
18567
|
+
let flipY = false;
|
|
18568
18568
|
let renderTexture;
|
|
18569
18569
|
let generated = false;
|
|
18570
18570
|
if (target) {
|
|
18571
18571
|
if (target instanceof RenderTexture) {
|
|
18572
18572
|
renderTexture = target;
|
|
18573
18573
|
} else {
|
|
18574
|
-
|
|
18574
|
+
const multisample = renderer.context.webGLVersion >= 2 ? renderer.multisample : MSAA_QUALITY.NONE;
|
|
18575
|
+
renderTexture = this.renderer.generateTexture(target, { multisample });
|
|
18576
|
+
if (multisample !== MSAA_QUALITY.NONE) {
|
|
18577
|
+
const resolvedTexture = RenderTexture.create({
|
|
18578
|
+
width: renderTexture.width,
|
|
18579
|
+
height: renderTexture.height
|
|
18580
|
+
});
|
|
18581
|
+
renderer.framebuffer.bind(renderTexture.framebuffer);
|
|
18582
|
+
renderer.framebuffer.blit(resolvedTexture.framebuffer);
|
|
18583
|
+
renderer.framebuffer.bind(null);
|
|
18584
|
+
renderTexture.destroy(true);
|
|
18585
|
+
renderTexture = resolvedTexture;
|
|
18586
|
+
}
|
|
18575
18587
|
generated = true;
|
|
18576
18588
|
}
|
|
18577
18589
|
}
|
|
18578
18590
|
if (renderTexture) {
|
|
18579
18591
|
resolution = renderTexture.baseTexture.resolution;
|
|
18580
18592
|
frame = frame ?? renderTexture.frame;
|
|
18593
|
+
flipY = false;
|
|
18581
18594
|
renderer.renderTexture.bind(renderTexture);
|
|
18582
18595
|
} else {
|
|
18583
18596
|
resolution = renderer.resolution;
|
|
@@ -18586,18 +18599,18 @@ ${e}`);
|
|
|
18586
18599
|
frame.width = renderer.width;
|
|
18587
18600
|
frame.height = renderer.height;
|
|
18588
18601
|
}
|
|
18602
|
+
flipY = true;
|
|
18589
18603
|
renderer.renderTexture.bind(null);
|
|
18590
18604
|
}
|
|
18591
18605
|
const width = Math.round(frame.width * resolution);
|
|
18592
18606
|
const height = Math.round(frame.height * resolution);
|
|
18593
|
-
const
|
|
18607
|
+
const pixels = new Uint8Array(BYTES_PER_PIXEL * width * height);
|
|
18594
18608
|
const gl = renderer.gl;
|
|
18595
|
-
gl.readPixels(Math.round(frame.x * resolution), Math.round(frame.y * resolution), width, height, gl.RGBA, gl.UNSIGNED_BYTE,
|
|
18609
|
+
gl.readPixels(Math.round(frame.x * resolution), Math.round(frame.y * resolution), width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
|
|
18596
18610
|
if (generated) {
|
|
18597
18611
|
renderTexture.destroy(true);
|
|
18598
18612
|
}
|
|
18599
|
-
|
|
18600
|
-
return webglPixels;
|
|
18613
|
+
return { pixels, width, height, flipY };
|
|
18601
18614
|
}
|
|
18602
18615
|
destroy() {
|
|
18603
18616
|
this.renderer = null;
|
|
@@ -23408,7 +23421,8 @@ ${e}`);
|
|
|
23408
23421
|
if (basePath && basePath.lastIndexOf("/") !== basePath.length - 1) {
|
|
23409
23422
|
basePath += "/";
|
|
23410
23423
|
}
|
|
23411
|
-
|
|
23424
|
+
let imagePath = basePath + asset.meta.image;
|
|
23425
|
+
imagePath = copySearchParams(imagePath, options.src);
|
|
23412
23426
|
const assets = await loader.load([imagePath]);
|
|
23413
23427
|
const texture = assets[imagePath];
|
|
23414
23428
|
const spritesheet = new Spritesheet(texture.baseTexture, asset, options.src);
|
|
@@ -23420,10 +23434,11 @@ ${e}`);
|
|
|
23420
23434
|
if (typeof item !== "string") {
|
|
23421
23435
|
continue;
|
|
23422
23436
|
}
|
|
23423
|
-
|
|
23437
|
+
let itemUrl = basePath + item;
|
|
23424
23438
|
if (options.data?.ignoreMultiPack) {
|
|
23425
23439
|
continue;
|
|
23426
23440
|
}
|
|
23441
|
+
itemUrl = copySearchParams(itemUrl, options.src);
|
|
23427
23442
|
promises.push(loader.load({
|
|
23428
23443
|
src: itemUrl,
|
|
23429
23444
|
data: {
|
|
@@ -23929,7 +23944,7 @@ ${e}`);
|
|
|
23929
23944
|
height,
|
|
23930
23945
|
xoffset: 0,
|
|
23931
23946
|
yoffset: 0,
|
|
23932
|
-
xadvance:
|
|
23947
|
+
xadvance: width - (style.dropShadow ? style.dropShadowDistance : 0) - (style.stroke ? style.strokeThickness : 0)
|
|
23933
23948
|
});
|
|
23934
23949
|
positionX += (textureGlyphWidth + 2 * padding) * resolution;
|
|
23935
23950
|
positionX = Math.ceil(positionX);
|
|
@@ -24067,8 +24082,8 @@ ${e}`);
|
|
|
24067
24082
|
charRenderData.texture = charData.texture;
|
|
24068
24083
|
charRenderData.line = line;
|
|
24069
24084
|
charRenderData.charCode = charCode;
|
|
24070
|
-
charRenderData.position.x = pos.x + charData.xOffset + this._letterSpacing / 2;
|
|
24071
|
-
charRenderData.position.y = pos.y + charData.yOffset;
|
|
24085
|
+
charRenderData.position.x = Math.round(pos.x + charData.xOffset + this._letterSpacing / 2);
|
|
24086
|
+
charRenderData.position.y = Math.round(pos.y + charData.yOffset);
|
|
24072
24087
|
charRenderData.prevSpaces = spaceCount;
|
|
24073
24088
|
chars.push(charRenderData);
|
|
24074
24089
|
lastLineWidth = charRenderData.position.x + Math.max(charData.xAdvance - charData.xOffset, charData.texture.orig.width);
|
|
@@ -24460,7 +24475,8 @@ ${e}`);
|
|
|
24460
24475
|
const textureUrls = [];
|
|
24461
24476
|
for (let i = 0; i < pages.length; ++i) {
|
|
24462
24477
|
const pageFile = pages[i].file;
|
|
24463
|
-
|
|
24478
|
+
let imagePath = path.join(path.dirname(src), pageFile);
|
|
24479
|
+
imagePath = copySearchParams(imagePath, src);
|
|
24464
24480
|
textureUrls.push(imagePath);
|
|
24465
24481
|
}
|
|
24466
24482
|
const loadedTextures = await loader.load(textureUrls);
|
|
@@ -24668,6 +24684,7 @@ ${e}`);
|
|
|
24668
24684
|
exports.checkExtension = checkExtension;
|
|
24669
24685
|
exports.checkMaxIfStatementsInShader = checkMaxIfStatementsInShader;
|
|
24670
24686
|
exports.convertToList = convertToList;
|
|
24687
|
+
exports.copySearchParams = copySearchParams;
|
|
24671
24688
|
exports.createStringVariations = createStringVariations;
|
|
24672
24689
|
exports.createTexture = createTexture;
|
|
24673
24690
|
exports.createUBOElements = createUBOElements;
|