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

GUI creation with Scene2D

We have our game, but you may be wondering why we haven't done anything with the lifecycle of the game, like we did with Snake. Well, that is because we are going to add new screens that will appear at the start and the end. But before we get on to creating and making the new screens, I want to talk about a really useful set of UI tools LibGDX offers for making UIs, Scene2D. Well, what is it?

According the LibGDX wiki page:

"Scene2d is a 2D scene graph for building applications and UIs using a hierarchy of actors."

At its core, Scene2d is made of three classes:

  • Actor: This contains the position, size (rectangular only), origin, scale, rotation, and color.
  • Group: This is an Actor class that can contain other actors and children. ...

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