Question

I trying to write a new game using Libgdx. Before I jump into creating the main screen (menu) , I wold like to ask a quick question from the experienced developers

What are the pros and cons in writing a menu splash screen in android native code(using activity etc.) vs writing a AbstractScreen using Libgdx scene2d?

Was it helpful?

Solution

I'd generally suggest you to use the Screens completely instead of having a separate activity just for the loading purposes.

Afaik there already is a SplashScreen class you can extend and use. But even besides that, it's fairly easy to create a class for your LoadScreen that implements the Screen interface.

In this class you can have an AssetManager to asynchronously load your assets while displaying e.g. a load bar or just a splash image or animation. Doing this as Screen in libgdx vs. a separate Activity will also give you the full control over the look. You can use your shaders, assets and whatever completely within your libgdx structure, no need to tinker around with connecting the load activity with the rest of the game.

After loading your assets, the menu can also be easily created with libgdx and scene2D. Your menu buttons can use the same skin and look as buttons in the rest of the game, using tables and other layouting options allow you to easily create good-looking menus.

And even though it might not be important to you yet, doing all this completely in libgdx will result in it to work on desktop and iOS as well. You can almost completely test the gameplay and look of your game on the desktop, which is faster than deploying to Android all the time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top