Skip to content

RectsOverlap

Narta Xaymar Dirks edited this page Oct 28, 2026 · 5 revisions

Blitz3DBlitzPlusBlitzBasic

RectsOverlap

RectsOverlap:Int32 x1:Int32, y1:Int32, width1:Int32, height1:Int32, x2:Int32, y2:Int32, width2:Int32, height2:Int32
Parameter Mode Type Default Description
x1 In Int32 required Left edge of the first rectangle.
y1 In Int32 required Top edge of the first rectangle.
width1 In Int32 required Width of the first rectangle.
height1 In Int32 required Height of the first rectangle.
x2 In Int32 required Left edge of the second rectangle.
y2 In Int32 required Top edge of the second rectangle.
width2 In Int32 required Width of the second rectangle.
height2 In Int32 required Height of the second rectangle.

Returns: 1 if the rectangles overlap, otherwise 0.

Description

Tells whether two rectangles touch. It works on plain numbers and needs no image, so it is a good quick test for boxes of any kind.

Examples

Print RectsOverlap(0, 0, 50, 50, 40, 40, 50, 50)
Print RectsOverlap(0, 0, 50, 50, 60, 60, 50, 50)
WaitKey

Related Commands

ImageRectOverlap, ImagesOverlap, MaskImage, MidHandle

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally