mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
Merge branch '4.0' into 4.1-beta
# Conflicts: # spine-ts/package-lock.json
This commit is contained in:
commit
9ee399bd1c
@ -138,7 +138,8 @@ export class AssetManagerBase implements Disposable {
|
|||||||
|
|
||||||
loadTextureAtlas (path: string,
|
loadTextureAtlas (path: string,
|
||||||
success: (path: string, atlas: TextureAtlas) => void = null,
|
success: (path: string, atlas: TextureAtlas) => void = null,
|
||||||
error: (path: string, message: string) => void = null
|
error: (path: string, message: string) => void = null,
|
||||||
|
fileAlias: {[keyword:string] : string} = null
|
||||||
) {
|
) {
|
||||||
let index = path.lastIndexOf("/");
|
let index = path.lastIndexOf("/");
|
||||||
let parent = index >= 0 ? path.substring(0, index + 1) : "";
|
let parent = index >= 0 ? path.substring(0, index + 1) : "";
|
||||||
@ -149,7 +150,7 @@ export class AssetManagerBase implements Disposable {
|
|||||||
let atlas = new TextureAtlas(atlasText);
|
let atlas = new TextureAtlas(atlasText);
|
||||||
let toLoad = atlas.pages.length, abort = false;
|
let toLoad = atlas.pages.length, abort = false;
|
||||||
for (let page of atlas.pages) {
|
for (let page of atlas.pages) {
|
||||||
this.loadTexture(parent + page.name,
|
this.loadTexture(fileAlias == null ? parent + page.name : fileAlias[page.name],
|
||||||
(imagePath: string, texture: Texture) => {
|
(imagePath: string, texture: Texture) => {
|
||||||
if (!abort) {
|
if (!abort) {
|
||||||
page.setTexture(texture);
|
page.setTexture(texture);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user