O'Reilly logo

LibGDX Game Development By Example by James Cook

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Start screen and disposal

So, here we are back with Flappee Bee. The first thing we should tackle is having a Start screen, or menu screen, depending on what you want to call it. This Screen class will be built entirely with Scene2d.ui components and you will be mesmerized by how awesome all this is.

First things first; let's decide what we will have on our start screen. We will need a play button and some text, perhaps also a title image on the screen.

Let's create our StartScreen class and add the Stage classes to it:

public class StartScreen extends ScreenAdapter { private static final float WORLD_WIDTH = 480; private static final float WORLD_HEIGHT = 640; private Stage stage; public void show() { stage = new Stage(new FitViewport(WORLD_WIDTH, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required