-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTouchListener.pde
24 lines (20 loc) · 1.25 KB
/
TouchListener.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class TouchListener implements OmicronTouchListener{
// Called on a touch down event
// mousePressed events also call this with an ID of -1 and an xWidth and yWidth of 10.
public void touchDown(int ID, float xPos, float yPos, float xWidth, float yWidth){
// This is an optional call if you want the function call in the main applet class.
// 'OmicronExample' should be replaced with the sketch name i.e. ((SketchName)applet).touchDown( ID, xPos, yPos, xWidth, yWidth );
// Make sure applet is defined as PApplet and that 'applet = this;' is in setup().
((CS424Project4)applet).touchDown( ID, xPos, yPos, xWidth, yWidth );
}// touchDown
// Called on a touch move event
// mouseDragged events also call this with an ID of -1 and an xWidth and yWidth of 10.
public void touchMove(int ID, float xPos, float yPos, float xWidth, float yWidth){
((CS424Project4)applet).touchMove( ID, xPos, yPos, xWidth, yWidth );
}// touchMove
// Called on a touch up event
// mouseReleased events also call this with an ID of -1 and an xWidth and yWidth of 10.
public void touchUp(int ID, float xPos, float yPos, float xWidth, float yWidth){
((CS424Project4)applet).touchUp( ID, xPos, yPos, xWidth, yWidth );
}// touchUp
}// TouchListener