-
Notifications
You must be signed in to change notification settings - Fork 2
raylib.GetCollisionRec
JoeStrout edited this page Apr 29, 2026
·
2 revisions
Get collision rectangle for two rectangles collision
| Parameter | Default Value | Note |
|---|---|---|
| rec1 | ||
| rec2 |
| Condition | Return Value |
|---|---|
| (always) | map |
// 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