Images Collide and Transparency?

BlitzMax Forums/BlitzMax Programming/Images Collide and Transparency?

Sean Doherty(Posted 2006) [#1]
I am having a issue with Image Collide not working when the image alpha value is not 255? For example, if you have a png file in paint shop pro with an O of less then 255 there doesn't seem to be any collision?

Why?


Sean Doherty(Posted 2006) [#2]
Anyone?


Sean Doherty(Posted 2006) [#3]
Does anyone know if there is any documentation available where this may be expained?


Hotcakes(Posted 2006) [#4]
I believe transparency is treated as : anything less than full value is transparent. Therefore, pixel perfect collision methods would take that into account. You may be better off using rects instead?


Haramanai(Posted 2006) [#5]
Using rects?
I believe that using rects it's the same thing with using image.
If I am not wrong Max2D does not store the rotation values for evry rect you may use but stores the pixels in the COLLISION_LAYER... So it doesn't mater if you use rects or images.
Maybe Rects are faster for the moving objects because they take less time to be added in the collision layer but for the static use images and load them just once before the main loop in a layer that you will not reset with the collisionreset Function.


JazzieB(Posted 2006) [#6]
I believe Sean is referring to the normal ImagesCollide() and ImagesCollide2() functions, not the layer collision detection methods that are new to BlitzMax.

I'm not sure what constitutes transparent or not with regards to image collision detection, but the ImagesCollide2() function has additional parameters to check for collisions between rotated and/or scaled images.

There's no need to remember rotation or scaling with the layer collision methods as the pixels within the layers are set accordingly anyway. Again, not sure how alpha is interpreted using this method.


tonyg(Posted 2006) [#7]
Seeing some code from Sean might help get a few more responses so we don't have to double-guess the question/problem.