I am trying to use the AssetManager class in LibGDX and I understand how it works but I am trying to implement a loading screen. I have followed the AssetManagerTest.java file here, but I am having a hard time trying to figure out how to get it to work correctly. Can someone point me in the right direction? My goal is to load the assets (textures, sounds, fonts, ... etc) and update a bar with the percentage complete on the screen. I don't understand the ResolutionFileResolver and the Resolution[] in the link I provided. What are they for? My goal is to support a static class that can give me access to all of the assets I need in my game from any screen. Is there a preferred method to do this? Thanks.


To create a Loading screen you may want to follow the approach explained in the thread "How should I manage resources in a professional project" of LibGDX forum.

ResolutionFileResolver is used to load different assets depending the resolution of the device. For example, you define a file extension ".480800" for devices of 480x800 then the AssetManager loads one or the other asset based on the resolver.

Hope it helps.

| improve this answer | |
  • \$\begingroup\$ Thanks for the link. That definitely helps... As for the ResolutionFileResolver, do I create separate directories with those names, or actually use those as file extensions for the images? Is there a general size I should follow for images in my game, to be used on almost all resolutions? Thanks for your help! \$\endgroup\$ – Alex_Hyzer_Kenoyer Mar 8 '12 at 19:42
  • \$\begingroup\$ I am not an AssetManager expert so I don't know exactly. However, it should be an example of that available with LibGDX. I believe it tries to load always the default name, for example, you add a resolution resolver for "480320" and later you want to load a font named "somefont.fnt", then it will load that one on all devices, on the 480x320 device will try to load "480320/somefont.fnt" and if there is one, it loads that, otherwise it loads the default. I may be totally wrong. \$\endgroup\$ – arielsan Mar 16 '12 at 2:33
  • \$\begingroup\$ I think you are right on with that, thanks. The AssetManager is turning out to be really useful. \$\endgroup\$ – Alex_Hyzer_Kenoyer Mar 16 '12 at 12:33

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.