Game Development Reference
In-Depth Information
Figure 8-1. Touch events
In Figure 8-1 , we see a several lines composed of dots. Each one of these lines is the result of a
finger being dragged across the screen. The topmost line was created when a single figure was
moved across the screen—it is drawn with red dots. The second topmost line was created by
dragging two fingers across the screen, as was the one below it, and both are drawn with green
dots. The bottom three lines were drawn with three fingers, and it is made of blue dots. If you can
see Figure 8-1 in color (if you have the ebook ), take a look at the left-most dots on the bottom line.
Notice that one is red and the other is green. This is because I did not get all three of my fingers to
land on the screen at the same time.
In this first example, besides drawing dots with your finger, you can scale the dots up or down by
tapping with a single finger or two fingers, respectively. The scaling feature demonstrates how touch
events and gestures can work together. We will explore this in more detail once we understand the
basics of the touch events.
Search WWH ::




Custom Search