Processing for Android

Touches array

This array contains the list of current touch pointers. Each pointer is characterized by its x,y coordinate, area, pressure, and a unique ID.


void setup() {
  fullScreen();
  textFont(createFont("SansSerif", 24));
  textAlign(CENTER, CENTER);
}    

void draw() {
  background(255);
  for (int i = 0; i < touches.length; i++) {
    float d = 50 * touches[i].area;
    fill(0, 255 * touches[i].pressure);
    ellipse(touches[i].x, touches[i].y, d, d);
    fill(255, 0, 0);
    text(touches[i].id, touches[i].x, touches[i].y);
  }  
}