collision detection - Android Create a rectangle within an image view -
hi wanted know how can create rectangle inside imageview. can see in image (http://i.stack.imgur.com/zcpdt.png ) need create rectangular internal , external, determining collision outside there no problems, can not seem create internal one. create internal one, did way:
rect r1 = new rect(object1.x, object1.y, object1.x + bounds1.width(), object1.y + bounds1.height());
for internal 1 had thought same, halving values, not work =(
i think must write custom imageview extends imageview , override ondraw method. draw rect on it.
Comments
Post a Comment