Book Image

Libgdx Cross-platform Game Development Cookbook

Book Image

Libgdx Cross-platform Game Development Cookbook

Overview of this book

Table of Contents (20 chapters)
Libgdx Cross-platform Game Development Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Detecting more complex gestures


Control and user experience should receive a strong focus when you are working on applications in general and games in particular. It is essential that your target audience finds your product to be smooth and flawless. Many elements impact the user experience, such as UI or sound, although a truly crucial one is controls.

Tapping, double tapping, pinching, panning, zooming—there are a myriad of gestures that have almost become an accepted convention. For better or worse, users now expect a certain behavior when they perform an action on a specific game element.

For instance, it is normal for the camera to be moved around when you swing your finger over a map so that the displayed section changes.

Libgdx offers an easy way to detect and react to the most typical gestures. In this recipe, you will learn how to do it through a sample application. We will capture user gestures and show a log on the screen, as we have done in previous input-related recipes.

Getting...