Setting up the resource manager for scene resources
In order to facilitate the loading of resources by the menu and game scenes, the resource manager must be first set up to handle the resources. Our resource manager will automatically load the respective resources when we call its loadMenuResources()
or loadGameResources()
methods. Likewise, unloading resources for menus or game scenes that use a large amount of memory will simply be a call to the resource manager using unloadMenuResources()
, unloadGameResources()
, or unloadSharedResources()
.
Getting ready...
Open the ResourceManager.java
class in this chapter's code bundle, as we will be referencing it for this recipe. Also, refer to the inline comments of the class for more information on specific portions of code.
How to do it...
Follow these steps to understand how the ResourceManager
class is set up to be used with our managed scenes:
Take note of the public, non-static variables defined in the
ResourceManager
class. The engine and context...