Android multi-touch. How exactly does it work

********************  
                        //* If a finger (non-primary) is removed from the screen *  
                        //*  How do I determine where the remaining ones are?!  *  
                       //****************************************   *******           
                  
            }  
              
            case MotionEvent.ACTION_UP: {  
                  
                    //Stop Sprite when last finger released  
                    renderer.setSpriteState('l', false);  
                    renderer.setSpriteState('r', false);                  
                    break;}  
            }  
              
        
            return true;  
            // TODO Auto-generated method stub 
The MotionEvent keeps track of all the fingers/pointers on the screen. You can keep track the fingers using the getX(int) and getY(int) methods. The integer parameter is the index of the point being tracked. If you want to get the location of the fingers that were not released as part of the ACTION_POINTER_UP action, then you would:
1) Call the getPointerCount() to determine the total number of fingers touching the display. The indeces will be from 0 to the count-1
2) Determine the index of the finger which was released. Use the [tt]getActionIndex() method

Back  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... Next  >> 

Copyright © 2007-2012 www.chuibin.com Chuibin Copyright