Code archives/Miscellaneous/Rectsoverlap

This code has been declared by its author to be Public Domain code.

Download source code

Rectsoverlap by Leon Drake2007
Simple function using floats to check wether rectangles are overlapping.
Function RectsOverlap(x1#,y1#,w1#,h1#,x2#,y2#,w2#,h2#)

If x1#+w1# >= x2# And x1# <= x2#+w2# And y1#+h1# >= y2# And y1# <= y2#+h2# Then
Return True
Else
Return False
EndIf

End Function

Comments

None.

Code Archives Forum