import android.view.MotionEvent;
boolean showEvent = false;
int evAction;
int evX, evY;
void setup()
{
size(displayWidth, displayHeight);
background(0);
stroke(255);
strokeWeight(3);
}
void draw()
{
if(showEvent){
text("Action: " + str(evAction), 10, 50);
ellipse(evX, evY, 10, 10);
showEvent = false;
}
}
public boolean surfaceTouchEvent(MotionEvent event)
{
evAction = event.getAction();
evX = mouseX;
evY = mouseY;
showEvent = true;
return super.surfaceTouchEvent(event);
}
Title: Detect touch event in Processing for Android
Rating: 100% based on 99998 ratings. 10 user reviews.
Post by 1:32 AM
Rating: 100% based on 99998 ratings. 10 user reviews.
Post by 1:32 AM
0 comments:
Post a Comment