Processing – Czy dany punkt znajduje się w prostokącie.
Prosta funkcja której celem jest sprawdzenie czy dany punkt (point_x i point_y) znajdują w prostokącie o współrzędnych x,y o szerokości width i wysokoście height.
1 2 3 4 5 6 7 8 9 10 11 | boolean overRect(int x, int y, int width, int height, int point_x, int point_y) { if (point_x >= x && point_x <= x+width && point_y >= y && point_y <= y+height) { return true; } else { return false; } } |








