HTML Canvas 中的原始形状库
是否有任何库可以为原始形状提供一些有限的功能。我尝试使用 EaselJS ,虽然它有一些令人惊奇的特性,但基本形状并不是其中之一。形状内部的测试是通过像素测试进行的,与光线测试等相比,速度非常慢。
我想矩形和圆形使用得最多,我可以为它们两个创建碰撞检测,但是多边形的情况会变得更加复杂。有没有相关的图书馆?我知道 JQuery 有一个,但它似乎是针对 HTML 元素而不是画布
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 for HTML elements and not the canvas
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能想看看 CAKE
或processingjs。我不确定这些是否特别适合您的需求,但它们似乎是目前最发达的画布库。
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.