gb.collidePointRect

From Gamebuino Wiki
Revision as of 2014-09-05T22:55:59 by Rodot (talk | contribs) (Example: example added)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.

Example

See also