Setting up an activity to use the scene manager
Because of the way that our scene manager works, setting it up for use by an Activity
class that extends AndEngine's BaseGameActivity
class requires little effort. We are also going to implement an accurate screen-resolution scaling approach to ensure a consistent appearance across all devices. The SceneManager
class and ManagedScenes
class rely on the variables defined in the ResourceManager
class to register update handlers and create entities. As we go through the recipe, take note that we set up the ResourceManager
class prior to using any functions of the SceneManager
class.
Getting ready...
Create a new activity that extends AndEngine's BaseGameActivity
class, or load one that you have already created. Adapting an existing activity to use the scene manager requires the same steps as a new one would require, so do not worry about starting over on a project just to implement the scene manager.
How to do it...
Follow these steps to prepare...