Skip to content Skip to sidebar Skip to footer

Libgdx Assetmanager Not Loading Anything

I have recently added an AssetManager class to my LibGDX game, but I can't seem to get it to work. Here's my AssetManager class: public class AssetLoader { public AssetManager

Solution 1:

You are only queuing elements

the AssetManager.load() methods only adds a "loadable" resource to it, but doesn't actually load it. To do that, you need to call AssetManager.update()

Then it loads your resources, be loading one by one for each call to update().

Try this:

publicvoidrender() {
      if(manager.update()) {
         // we are done loading, let's move to another screen!
      }

      // display loading informationfloat progress = manager.getProgress()
      ... left to the renderer, display loading bar or somthing ...
}

You could then display a loading bar indicator or something while manager.update() returns false.

Note that the framerate is very low during loading, as stuff needs be loaded in the GL Thread in order to have correct access to the GL context. But during your initial loading screen, this shouldn't matter, as long as there is a loading bar, so the user doesn't think the game is stuck.

Post a Comment for "Libgdx Assetmanager Not Loading Anything"