BMax substitute to B3D imagesoverlap()?

BlitzMax Forums/BlitzMax Programming/BMax substitute to B3D imagesoverlap()?

AvestheFox(Posted 2011) [#1]
In Blitz 3D I use the imagesoverlap() command allot...

B3D example:
if imagesoverlap(mouse,ms_x,ms_y,t\img,t\x,t\y) then rect t\x,t\y,16,16,0


But now that I'm switching my project to Blitz Max I need to find a substitute for this command. I've tried Imagescollide() but it does pixel perfect detection. I want it to detect if the image rectangles are overlapping and not the visible pixels.


GfK(Posted 2011) [#2]
Not sure but try 'setblend solidblend' beforehand.


AvestheFox(Posted 2011) [#3]
hmm, nope, that doesnt seem to work :P

here's the code that I tried:



Last edited 2011


GfK(Posted 2011) [#4]
Your best solution might be to avoid collision checks completely, and write your own function to check each corner of one image, to see if it lies within the boundaries of the second image.

Alternatively, you could use proxy images to check for collisions using ImagesCollide2 - just scale the proxy image to the same size as the image you want to check for collisions against.


AvestheFox(Posted 2011) [#5]
I've considered the first option already and I might actually go that route.

I just wasn't sure if it was really the best method for doing this.


Oddball(Posted 2011) [#6]
Are you just trying to do AABB collision detection?


Last edited 2011


Oddball(Posted 2011) [#7]
and just for the sake of my own piece of mind I've add image handle correction too.


AvestheFox(Posted 2011) [#8]
hey, that's just awesome! :D

thanks!