OZONE Asylum
Forums
DHTML/Javascript
points in polygon test
This page's ID:
31745
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
And how about using the [url=http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-ispointinpath]CanvasRenderingContext2DisPointInPath( x, y )[/url] method ? Or since you're tracing the polygons anyways, why not fill them, each of them, with a unique (dark) color and check the color of the pixel at the x,y coordinates you want ? The unique color will act as a unique ID for all the polygons and make a lot of things easier. [edit] Oh! And you should not put any game logic in the event handlers because events can be fired much faster than the main loop of your game. The only thing your event handlers should do is set some flags to be interpreted in the main loop of your game. And don't forget to add [b]<!doctype html>[/b] at the beginning of your page ;) [/edit] Also, please, try to make it easier for people to look at your work in progress by posting a URL instead of posting a big chunk of code in the forum. [url=http://www.p01.org/][sigrotate][img]http://poi.ribbon.free.fr/files/p01_ozoneasylum_sig_teapot.png[/img][/sigrotate][/url] [small](Edited by [url=http://www.ozoneasylum.com/user/2185]poi[/url] on 03-30-2010 10:09)[/small]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »