Closed jessadacharoen closed 5 years ago
XML handling is a little special, since all XMLs are processed at the very end, when all other parts of the queue are finished. I just had a look, and here's what's happening:
name = getName(xml.@imagePath.toString());
texture = getTexture(name);
addTextureAtlas(name, new TextureAtlas(texture, xml));
As you can see, the name of the texture is used as the key for both atlas and atlas texture. I must admit I can't remember if there was any special reason for that. Normally, the atlas XML and texture are named the same (e.g. atlas.xml
and atlas.png
), but I don't see why this would be a must.
My plan is to refactor the complete AssetManager for the 2.1 release — that's a perfect time to look into that again. :-)
I forgot to update this – this was fixed with Starling 2.4's new AssetManager.
With the following code, TextureAtlas is added with the name "huds-v0005" instead of "huds". Why does enqueueWithName completely ignore name argument for xml? Is this expected or a bug?