[ts][phaser] Fix texture fetching with loader path set. Closes #2845.

This commit is contained in:
Davide Tantillo 2025-05-13 12:14:20 +02:00
parent f256510248
commit 6e4162d093
2 changed files with 8 additions and 2 deletions

View File

@ -370,7 +370,10 @@ class SpineAtlasFile extends Phaser.Loader.MultiFile {
}
}
let basePath = file.src.match(/^.*\//) ?? "";
let basePath = (file.src.match(/^.*\//) ?? "").toString();
if(this.loader.path && this.loader.path.length > 0 && basePath.startsWith(this.loader.path))
basePath = basePath.slice(this.loader.path.length);
for (var i = 0; i < textures.length; i++) {
var url = basePath + textures[i];
var key = file.key + "!" + textures[i];

View File

@ -362,7 +362,10 @@ class SpineAtlasFile extends Phaser.Loader.MultiFile {
}
}
let basePath = file.src.match(/^.*\//) ?? "";
let basePath = (file.src.match(/^.*\//) ?? "").toString();
if(this.loader.path && this.loader.path.length > 0 && basePath.startsWith(this.loader.path))
basePath = basePath.slice(this.loader.path.length);
for (var i = 0; i < textures.length; i++) {
var url = basePath + textures[i];
var key = file.key + "!" + textures[i];