Book Image

Learning LibGDX Game Development- Second Edition

Book Image

Learning LibGDX Game Development- Second Edition

Overview of this book

Table of Contents (21 chapters)
Learning LibGDX Game Development Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Exploring Scene2D UI, TableLayout, and skins


LibGDX comes with a great feature set to easily create scene graphs. A scene graph is a hierarchically organized structure of objects similar to files and folders on a hard disk. In LibGDX, such objects are called actors. Actors can be nested to create logical groups. Grouping actors is a very useful feature, as modifications applied to a parent actor will also affect its child actors. Furthermore, each actor has its own local coordinate system, which makes it very easy to define relative offsets inside a group of actors, including position, angle of rotation, and scale.

Scene2D supports hit detection of rotated and scaled actors. LibGDX's flexible event system allows you to handle and route inputs as needed so that the parent actors can intercept inputs before they reach the child actors. Finally, the built-in action system can be used to easily manipulate actors over a period of time, creating complex effects that can execute in sequence, parallel...