0
\$\begingroup\$

I started using the asset manager, so I could use a loading screen. Everything is working fine, but when the app enters a pause state, it unloads every asset and when it loads the screen all the assets are gone. I debugged and I found that they are waiting to be loaded again, I commit an update to do it but nothing happened.

Am I missing something? (In the pause method, I don't unload anything)

\$\endgroup\$
2
\$\begingroup\$

Most resources (like Texture, if its loaded from file) in libGDX are managed resources. If you load such resource using AssetManager, it takes care of it to be reloaded on resume, but you have to instruct your AssetManager to actually reload your resources. All you need to do is constantly call update() on resume until this method returns true, which indicates fully-loaded assets; or you can call finishLoading() to block you app till everything is loaded. You should read entry about libGDX architecture to get broader knowledge on how this framework works.

You may also find this link helpful.

\$\endgroup\$
  • \$\begingroup\$ Well, I resolved my problem :) you mentioned something that i was´nt doing in my resume, call the update method of the asset manager until everything loaded :) my first update is in the render so it is called everytime :) thanks for that key words :P \$\endgroup\$ – Rudy_TM Jun 20 '12 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.