-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Android NDK Game Development Cookbook
By :
In this recipe, we implement a function which detects pinch-zoom-rotate and fling/swipe gestures. It can serve as a starting point for recognition of your own custom gestures.
This recipe relies on the recipe Processing multi-touch events on Android from this chapter to handle multi-touch input.
We split the task of motion decoding into individual layers. The low-level code handles the OS-generated touch events. Collected touch point data is processed using a set of routines in the mid-level code, which we present in this recipe. Finally, all the decoded gestures are reported to the user's high-level code using the simple iGestureResponder interface:
class iGestureResponder
{
public:The Event_UpdateGesture() method is provided for direct access to the current state of contact points. The sMotionData structure is presented right after the iGestureResponder discussion. The 1_MultitouchInput example overrides this method to render the touch points...
Change the font size
Change margin width
Change background colour