Page is a not externally linkable
- Code, Content, and Presentation
-- JavaScript and AJAX
---- drag and drop into div or canvas


Fotiman - 7:24 pm on Jan 18, 2013 (gmt 0)


I would think you could still do that with one big area. Lets simplify the example: imagine if your area was just a 5px x 3px rectangular shape (15 points total area).


01234
+-----+
0|.....|
1|.....|
2|.....|
+-----+

Given a point within that area, you could map it to a specific sub-division:

01234
+-----+
0|AABBC|
1|ABBCC|
2|BBCCC|
+-----+

For example, shape "A" is somewhat triangular in shape and consists of 3 points:
0,0
1,0
0,1

Shape "B" is like a diagonal line consisting of points:
2,0
3,0
1,1
2,1
0,2
1,2

And Shape "C" is also triangular, consisting of points:
4,0
3,1
4,1
2,2
3,2
4,2

So, given any point, you can tell exactly which shape it is.


Thread source:: http://www.webmasterworld.com/javascript/4536235.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com