This allows you to check if two rectangles overlap, where true is returned if they do.
The first 4 parameters are for the first rectangle, and the second 4 are for the second rectangle.
The 'isCentred' parameter states if the locations refer to the top-left corner (when isCentred is false), or the middle of the rectangle (when isCentred is true).
// draws 'COLLISION!' to the screen
// if the mouse moves over a certain section of the page
c = getControls()
mx = c.getMouseX()
my = c.getMouseY()
if isRectOverlap( 100, 100, 200, 200, mx, my, 10, 10, true )
fillText( "COLLISION!", 100, 100 )