-
Notifications
You must be signed in to change notification settings - Fork 1
getTouch() and getTouchRect() Usage
KonPet edited this page Jan 10, 2021
·
7 revisions
getTouch() Gets the Status of the stylus (eg pressed or not pressed). This is integrated into getTouchRect() but can be used on it's own
getTouchRect() Check's if you are touching/holding/not touching a defined area
bool getTouch(
KeyPhase phase // KeyPhase enum
)bool getTouchRect(
int x, int y, // Position of the rectangle
int width, int height, // Dimensions of the rectangle
KeyPhase phase // KeyPhase enum
)KeyPhase enum contain:
press, held, release
if(getTouch(KeyPhase::press){
[YOUR CODE HERE]
}if(getTouchRect(0, 0, 16, 16, KeyPhase::press)){ //Checks if the 16X16 area in the coordinates X:0 Y:0 are touched
[YOUR CODE HERE]
}