将用户绘制的形状与预设形状进行比较(iPhone 游戏)
对于我的 iPhone 游戏程序,我需要获取用户绘制的内容并查看它是什么。例如,我需要看看它是正方形、圆形、星形还是三角形。有没有可用的工具来完成这样的事情?我真的不知道从哪里开始......
For my iphone game program, I need to take what the user draws and see what it is. For example, I need to see if it is a square, circle, star, or triangle. Are there tools available for something like this? I don't really know where to start...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您只需要单笔画形状,您可以尝试 $1 识别器。 GLGestureRecognizer 是一个 Objective-C 实现,尽管我还没有尝试过。
如果您需要多次划水,请尝试 $N 变体,它也有iOS 实现。我之前在 Flex 项目中使用过 $N 并取得了相当不错的效果。
You might try the $1 recognizer if you only need single-stroke shapes. GLGestureRecognizer is an Objective-C implementation, though I haven't tried it out.
If you need multiple strokes, try the $N variant, which also has an iOS implementation. I've used $N in a Flex project before and had pretty good results.