Introducing the Scene2D API
Before getting your hands dirty, it becomes absolutely necessary to clear up some key concepts:
- Actor: This represents a node within the scene graph and its default properties are position, size, origin, scale, rotation, Z-index, and color. In the context of this chapter, a node can contain a widget or a group of them taking into account that it will work in its local coordinate system, which means that transformations are performed relative to its current coordinate frame's origin and axes. Apart from that, it knows how to draw itself.
Note
Z-index refers to the level of depth when rendering. In the next image, you can see that the square with the higher z-index overlaps the other two.
Scene2D actors can serve as any type ...
Get Libgdx Cross-platform Game Development Cookbook 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.