###

» Thu Mar 07, 2013 7:51 pm

ok. one more try...

If I can't get the fences to draw more accurately, I need a way to calculate when sprites are boxed in by the lines.

ie. if the user drew 4 lines (4 sides of a box) I'd need to know the area of the box and what sprites were in it. Then, if the user drew another line through that box it would divide it into 2 boxes. I would then need to know the area of both boxes and what sprites were in each of them.

I was going to find the area of each boxed in square by noting the locations of the ends of the lines. (but since the ends of the lines are often over the lines, it makes for a very inaccurate measurement).

Is there a way I can either draw the lines more accurately, OR, calculate when an area has been "boxed in" and what sprites are in the boxed in area?

TIA!