Scene2D

Every game has information that the player needs to know, and LibGDX tackles this with an API called Scene2D to help us develop and manage the UI with easy, clean, and powerful implementations.

Scene2D

The preceding image is an example of the UI for our game. It's displaying the Score (top left), a Health bar, an Oxigen bar, and an Energy bar (bottom middle), and a pause button (top right).

Scene2D is LibGDX's scene graph; its basically, a scene where actors play. It consists of scenes that contain nods and can contain them on various layers. The benefit of using this approach is based on performance, productivity, portability, and scalability

Get Building a 3D Game with LibGDX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.