Chapter 3. Gestures, Touches, and the Accelerometer

The topics covered in this chapter are as follows:

  • Understanding swipe
  • Implementing tap
  • Adding LongPress
  • Adding pinch/zoom controls
  • Adding rotation objects
  • Adding panning
  • Including touches
  • Creating objects with touchBegan
  • Moving objects with touchMoved
  • Customizing touches in the sprite class
  • Adding an accelerometer
  • Adding a directional pad

Introduction

Gestures and touches are the main way to interact with any application. The gestures are swipe, tap, hold, pinch/zoom, rotate, and pan. All these gestures are used in a wide array of applications and are widely used in games as well.

Apart from gestures, there are also touches that can be used to make custom touch interactions. The touch functions keep track of each finger location and aid you in keeping track of each finger and monitoring its movement. The functions keep track by knowing when each finger touches the screen, moves across the screen, and stops touching the screen. In fact, you can create your own gestures with these functions.

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

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