Preface

Libgdx is a powerful Java-based open source cross-platform game framework. It allows developers to target Windows, Mac, Linux, Android, iOS, and HTML5 with a single codebase, sparing them the hassle of dealing with low-level, platform-specific details.

Preface

For more information, please refer to http://libgdx.badlogicgames.com/.

Through a clean and simple API, Libgdx offers a vast set of features, which are as follows:

  • Low-level OpenGL access: This includes vertex arrays, meshes, framebuffers, shaders, and immediate mode renderer
  • 2D graphics: This includes bitmaps, texture atlases, particles, scene graph, user interface, and maps
  • 3D graphics: This includes model loading, lighting, decal batching, particles, and so on
  • Audio: This includes streaming music, sound effects (MP3, WAV, and OGG), pitch control, and direct access to recording devices
  • Input: This includes keyboard, mouse, touch, accelerometer, compass, and controller events as well as gesture detection
  • Math and physics: This includes matrices, vectors, shapes, interpolators, frustum, intersection utilities, and full Box2D and Bullet physics JNI wrappers
  • File I/O: This includes cross-platform file access, preferences storage, XML, and JSON parsing
  • Utilities: This includes fast custom collections and easy multiresolution handling
  • Tools: This includes project creation, particle editor, bitmap font generator, and texture packer

Libgdx is incredibly fast, thanks to the use of JNI wrappers and heavy emphasis on avoiding garbage collection. This becomes crucial when deploying on mobile devices and browsers. Its framework nature allows you to choose which components to use as it does not enforce a single way of working like most engines do.

The community behind the framework is large, welcoming, and always willing to provide support. The GitHub repository shows how active the project is, with many commits every day, constant releases, and rich documentation. For more information, refer to https://github.com/libgdx/libgdx.

Thanks to its permissive Apache 2.0 license, Libgdx can be used for both commercial and noncommercial projects without having to necessarily disclose the source. According to AppBrain, 1.44 percent of all the Android applications (both games and nongames) are built on top of it, which reinforces its flexibility and ease of use. For more information, refer to http://appbrain.com/stats/libraries/details/libgdx/libgdx.

This book provides excellent coverage of the aforementioned systems focusing on 2D game development. Each chapter covers a set of related features through a series of recipes. A recipe explains with simple steps how to carry out a particular task with Libgdx such as rendering a texture on the screen. The practical approach will give you a very good insight on how things actually work, preparing you to use this technology on real-life projects.

After reading through the recipes in this book, you will have a solid understanding of how all the systems in Libgdx work and how to better leverage them in order to implement your games. The good practices exposed here will give you an edge to produce clean and efficient code.

What this book covers

Chapter 1, Diving into Libgdx, introduces the reader to the Libgdx development environment so as to get ready for the rest of the book. It also presents the basic architecture of the framework, how to run applications across devices, and how to put a project under source control.

Chapter 2, Working with 2D Graphics, covers the most important aspects of the Libgdx 2D API. The readers will learn how to render and animate textures, work with cameras, and deal with different resolutions.

Chapter 3, Advanced 2D Graphics, shows the reader how to achieve juicy effects with particles, shaders, and image composition.

Chapter 4, Detecting User Input, explains how to make your applications interactive across different devices. Keyboard, mouse, touch, and controller-based inputs are all found in this chapter.

Chapter 5, Audio and File I/O, shows readers how to play background music and sound effects to give that extra sparkle to the project. It also covers how to use the file's API and read popular formats such as JSON and XML.

Chapter 6, Font Rendering, details the different approaches to render text through Libgdx. Moreover, it also teaches how to overcome common pitfalls such as special characters and font scaling.

Chapter 7, Asset Management, provides information on how to control your assets' life cycle so as to accommodate low memory devices and make the most out of the hardware. It also gives insight into how to achieve asynchronous loading, so apps stay responsive while they stream content.

Chapter 8, User Interfaces with Scene2D, covers the powerful Libgdx scene hierarchy API focusing on how to build UI layouts. Moreover, it goes as far as skinning and custom widget creation. The reader will learn how to create great menus and in-game HUDs.

Chapter 9, The 2D Maps API, explains the simple Libgdx mechanisms to load and render levels created with tools such as Tiled as well as to query their metadata. The maps 2D API also allows users to provide loaders and renderers for additional formats.

Chapter 10, Rigid Body Physics with Box2D, shows the reader how to use the many features of the popular physics library that comes with Libgdx. Bodies, shapes, joints, sensors, collision handling, level geometry, raycasting, and fixed timestep are all covered in this chapter.

Chapter 11, Third-party Libraries and Extras, goes through the most popular Libgdx extensions, so the reader can make use of their enhancements. It covers a wide range of topics such as lighting, skeletal animation, localization, and entity systems.

Chapter 12, Performance and Optimizations, provides the readers with advice to achieve their performance targets. This becomes crucial when targeting mobile devices and browsers.

Chapter 13, Giving Back, lays out the process of publishing a finished application as well as contributing to the main Libgdx repository.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.98.250