Tuesday, 1 September 2015

Color Base Collision in Android

public  boolean isCollide(int x, int y)
{
int color = Color.TRANSPARENT;

try {
color = mBitmap.getPixel(
Math.abs(x- mLiveBitmap.mX),
Math.abs(y- mLiveBitmap.mY));
} catch (Exception e) {
}

 if (color != Color.TRANSPARENT)
                {
return true;
}

return false;
}

No comments:

Post a Comment