Skip to content

ImagesCollide

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

Blitz3DBlitzPlusBlitzBasic

ImagesCollide

ImagesCollide:Int32 image1:Int32, x1:Int32, y1:Int32, frame1:Int32, image2:Int32, x2:Int32, y2:Int32, frame2:Int32
Parameter Mode Type Default Description
image1 In Int32 required The first image.
x1 In Int32 required Horizontal position where the first image is drawn.
y1 In Int32 required Vertical position where the first image is drawn.
frame1 In Int32 required The frame of the first image.
image2 In Int32 required The second image.
x2 In Int32 required Horizontal position where the second image is drawn.
y2 In Int32 required Vertical position where the second image is drawn.
frame2 In Int32 required The frame of the second image.

Returns: 1 if visible pixels of the two images are on top of each other, otherwise 0.

Description

Tells whether two images touch, looking at the pixels that are visible. Both images are taken at their handle, and the frame to test is given for each.

Differences

  • A frame number that does not exist stops the program with an error message.

Examples

Graphics 320, 240, 0, 2
SetBuffer BackBuffer()
Local a = CreateImage(80, 80)
SetBuffer ImageBuffer(a)
Color 255, 160, 0
Oval 0, 0, 80, 80, 1
SetBuffer BackBuffer()
Local b = CopyImage(a)
Cls
DrawImage a, 60, 40
DrawImage b, 125, 105
Color 255, 255, 255
Text 10, 190, "ImagesOverlap: " + ImagesOverlap(a, 60, 40, b, 125, 105)
Text 10, 206, "ImagesCollide: " + ImagesCollide(a, 60, 40, 0, b, 125, 105, 0)
Flip
WaitKey

Media

ImagesCollide

Related Commands

ImageRectCollide, ImageRectOverlap, ImagesOverlap, ImageWidth

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally