O'Reilly logo

Libgdx Cross-platform Game Development Cookbook by Alberto Cejas Sánchez, David Saltares Márquez

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

Creating new widgets

It has been a long journey since you learned the basics of Scene2D, so you are now prepared for the fun part consisting of extending the library and generating your own content for personal projects or even for the community itself. With proper usage of the Skin class, you can perform a complete overhaul of your UI just by changing image assets. As you will know, software reuse becomes a booster in development companies so that you will not have to reinvent the wheel.

In this direction, you can easily create new widgets composed of simpler ones. Usually, the easiest way of approaching this is by extending a Table class and organizing inner widgets within it, but do not discard extending from WidgetGroup and using composition ...

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