is there only one way that embeds res for js target?
I want to dynamic load resources without embed the whole dir.
LocalFileSystem is not work for js target.
and also I don’t want to pack the whole source?
any suggestion?
is there only one way that embeds res for js target?
I want to dynamic load resources without embed the whole dir.
LocalFileSystem is not work for js target.
and also I don’t want to pack the whole source?
any suggestion?
Here is my class which manage the dynamic load resources part for 3d models and for textures too, but it requires a little change in the framework too (textures variable in the ModelCache class has to be public):
In your case maybe the solution could be much easier (if you don’t need 3d models):
import hxd.net.BinaryLoader;
var url = "asset/image/myimage.png";
var loader = new BinaryLoader(url);
loader.load();
loader.onLoaded = function(data)
{
// You can convert it to anything like toTexture, toImage, toTile, etc...
var texture:Texture = hxd.res.Any.fromBytes(url, data).toTexture();
}
thanks for you tips .I’ll try that !