Pixel perfect collision with Config.ALPHA_8

后端 未结 2 1575
失恋的感觉
失恋的感觉 2021-01-05 18:28

I\'ve found this code of pixel perfect collision checking and used it in my code:

public  boolean isCollisionDetected(Bitmap bitmap1, int x1, int y1,
               


        
2条回答
  •  滥情空心
    2021-01-05 18:52

    Android Config_Alpha_8 does not save color information, so when you draw the bitmap, adding the paint will do nothing, and all isFilled checks will return false.

    Neat piece of code though.

提交回复
热议问题