Understanding orthographic cameras

Very much like in films, Libgdx uses the concept of a camera as a tool to visualize the world. Throughout this recipe, we will learn how to wield the features of orthographic cameras, which make 2D scene rendering a much more enjoyable endeavor.

Among the topics shown, we can highlight camera sizes, movement, and zooming. This time around, in our example, we will load a massive texture and allow the user to move around, zooming in and out with both keyboard and touch controls. Naturally, in a real-life situation, you would have a level made out of chunks rather than a big texture.

Getting ready

Just make sure you already have the sample projects in your Eclipse workspace.

How to do it…

To start working with orthographic ...

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.