Skip to content

raylib.GetCollisionRec

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Get collision rectangle for two rectangles collision

Parameters

Parameter Default Value Note
rec1
rec2

Return value

Condition Return Value
(always) map

Notes

Example

// Find the overlapping area of two rectangles
rec1 = {x:50, y:50, width:150, height:100}
rec2 = {x:100, y:80, width:150, height:100}
overlap = raylib.GetCollisionRec(rec1, rec2)
print "Overlap: " + overlap.x + ", " + overlap.y + ", " + overlap.width + "x" + overlap.height

Clone this wiki locally