How can I fit a rectangle to an irregular shape?

Posted by Anil gupta on Game Development See other posts from Game Development or by Anil gupta
Published on 2012-07-05T02:45:52Z Indexed on 2012/07/05 9:23 UTC
Read the original article Hit count: 432

I used masking for breaking an image into the below pattern. Now that it's broken into different pieces I need to make a rectangle of each piece. I need to drag the broken pieces and adjust to the correct position so I can reconstruct the image. To drag and put at the right position I need to make the pieces rectangles but I am not getting the idea of how to make rectangles out of these irregular shapes. How can I make rectangles for manipulating these pieces?

This is a follow up to my previous question.

I need to make Rect of each small pattern which is drawn by line in below mention image

© Game Development or respective owner

Related posts about iphone

Related posts about cocos2d-iphone