Primitive Shapes Library in HTML Canvas
Are there any libraries out there that provide some limited functionality for primitive shapes. I tried getting my feet wet with EaselJS and although it has some amazing properties, basic shapes is not one of them. Tests for inside a shape are carried out by pixel testing which is incredibly slow compared to for example ray testing.
I imagine the rectangle and the circle gets used the most, and I can create collision detection for the two of them, but things get more complicated with polygons. Are there any libraries out there for this? I know JQuery has one, but it seems like it is f开发者_运维百科or HTML elements and not the canvas
You might want to take a look at CAKE or processingjs. I'm not sure if these are particuarly suited to your needs, but they seem the most developed library's for canvas at the moment.
精彩评论