I have exported a particle system from Particle Designer as .pex. The XML contains the texture data as (what I assume is) a Base64 encoded string.
So I do the following after loading and fetching the XML:
var stringData : String = particleData.texture.@data var b64 : Base64Decoder = new Base64Decoder(); b64.decode(stringData); var data : ByteArray = b64.toByteArray(); var loader : Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleLoad) loader.loadBytes(data);
However, Flash's Loader class does not seem to recognise this format, which I assume is PNG from the XML data:
<texture name="Untitled 1.png" data="H4sIAAAAAAAAA61XB1hUxxaee7c3YAtLkbL0XqUj0puANAULKrgssAILUu0tBBWNXVSwolFR [...snip...]"></texture>
Am I doing something wrong, or does someone have a better way of doing this? I kind of like having the texture embedded in the PEX.
Thanks in advance!
EDIT: Having just gotten Particle Designer today, it took me a while to notice that I could export the texture as a separate file. I reckon that is better as I can just include in one of my sprite sheets, so that makes this entry obsolete