Processing for Android

Touch events

Every time a new touch pointer is detected a series of events are triggered that allow to track the begin, change of position, and and of a touch.


void setup() {
  fullScreen();
}

void draw() {
  if (touchIsStarted) {
    background(150);
  } else {
    background(255);
  }
}    

void touchStarted() {
  println("touch started");
}

void touchMoved() {
  println("touch moved"); 
}

void touchEnded() {
  println("touch ended");  
}