" />

gb.collidePointRect

DESCRIPTION


Checks if a specified point is within a rectangle.

SYNTAX


gb.collidePointRect(x1, y1, x2, y2, w, h);

 

PARAMETERS


  • x1: horizontal coordinate of the point.
  • y1: vertical coordinate of the point.
  • x2: horizontal coordinate of the top left corner of the rectangle.
  • y2: vertical coordinate of the top left corner of the rectangle.
  • w: width of the rectangle.
  • h: height of the rectangle

RETURNS


  • true: if the point is inside the rectangle.
  • false: if the point is not inside the rectangle.

0