Difference between revisions of "Gb.collidePointRect"

From Gamebuino Wiki
Jump to: navigation, search
(Creation)
 
(Example: example added)
 
Line 20: Line 20:
  
 
== Example ==
 
== Example ==
 +
<gistit>https://github.com/Rodot/Gamebuino/blob/beta/libraries/Gamebuino/examples/5.Reference/physics/collidePointRect/collidePointRect.ino</gistit>
  
 
== See also ==
 
== See also ==
 
* [[gb.collideRectRect]]
 
* [[gb.collideRectRect]]

Latest revision as of 2014-09-05T22:55:59

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