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

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 ...

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