AssetManager: can I use it to load file?

AssetManager is nice for textures, models and materials, but how can I load a normal file with assetManager?

In my case it’s a xml file storing “game values”. Its good enough, if the AssetManager returns file.

What do I have to do?



Thanks

You’d have to create the whole economy around it, the loader, the keys etc. Definitely possible but you have to see if its the right thing to do for your game.

If you have you own xml definition, you can try JaxB for easy xml reading.

XML reading is no problem.

Its more about getting the file. The only way I know doesn’t work with Jar

1 Like

Just write your own loader (implement AssetLoader) then use assetManager.registerLoader() call or edit the Desktop.cfg file.

1 Like

Thx momoko!

registerLoader() is handy candy, since I don’t want to modify the original jME3.

Well, I hoped there would be a shortcut. Guess I have to read the AssetLoader wiki :wink: