I am trying to implement a small application with canvas on surface view and added some Bmp images on that canvas as shown in attached image.
Click here to check the requirement in image
Here A,B,C,D,E and Bmp1 are bitmaps and all can move. Below is my requirements:
I want to drag bitmap on another bitmap like i want to drag bmpA from left to right over Bmp1(Now if i am trying to do like that they are merging).
I want to know where i have touched on the screen like i touched on Bmp1 or touched on A or B or C.... or empty canvas area.(Now i can recognize whether i have touched Bmp1 or other by using below code.
if (mTouched_x >= Bibox.getCurrentPosition().x && mTouched_x < (Bibox.getCurrentPosition().x + BBoxBmp.getWidth()) && mTouched_y >= Bibox.getCurrentPosition().y && mTouched_y < (Bibox.getCurrentPosition().y + BBoxBmp.getHeight())) return true; else return false;
But I want to know whether I have touched other Bmp's or not because A,B,C.. are dynamic bmp's and number may increase.