我应该学什么:Quartz 还是 OpenGL ES?
我正在学习为 iPhone 编程。我正在尝试弄清楚如何制作一些非常酷的自定义视图动画。我应该学什么,Quartz 还是 OpenGL ES?
对于任何说 OpenGL ES 的人,我可以使用它来动画我的视图还是只有 Quartz 适合该任务?谢谢。
还有任何资源/书籍或任何可以以最轻松的方式教您这些东西的东西吗?
I'm learning to program for the iPhone. I'm trying to figure out how to do some really cool custom view animations. What should I learn, Quartz or OpenGL ES?
For whoever says OpenGL ES, could I use it to animate my views or is only Quartz suitable for the task? Thanks.
Also any resources / the book or anything that teaches you this stuff in the most painless manner?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
通过 Quartz,您可能指的是核心动画。 Quartz 只是 Mac / iPhone 2-D 绘图 API,其中 Core Animation 处理视图和图层的动画。
使用 OpenGL 在视图上执行自定义动画非常困难,但 Core Animation 就是为此目的而设计的。我向人们建议,如果他们正在考虑制作 2D 动画,即使是在游戏中,他们也应该首先考虑 Core Animation,只有当 Core Animation 的性能不可接受时才转向 OpenGL ES。核心动画让您只需少量代码即可完成很多工作,并且现在有很多关于该主题的优秀参考资料(例如 Marcus Zarra 和 Matt Long 的 新书)。
您可能希望参考其中一些其他问题以了解更多信息:
By Quartz, you probably mean Core Animation. Quartz is simply the Mac / iPhone 2-D drawing API, where Core Animation handles animation of views and layers.
It is very difficult to use OpenGL for performing custom animations on views, but Core Animation is designed for this purpose. It has been my recommendation to people that if they are thinking about doing 2-D animations, even in games, they should look at Core Animation first and go to OpenGL ES only if Core Animation's performance is unacceptable. Core Animation lets you do a lot with just a little code, and there are now plenty of great references out there on the topic (such as Marcus Zarra and Matt Long's new book).
You may wish to refer to some of these other questions for more:
实际上,您甚至无需进入 Quartz 就可以对视图进行动画处理。使用 UIKit 可以做很多事情。 Apple 文档建议:
You can actually animate views without even going into Quartz. There's a lot you can do with UIKit. Apple's documentation recommends:
如果您想为视图添加动画效果,请从核心动画开始。它已经可以为您做很多事情了。如果尝试后无法单独使用 CoreAnimation 获得想要的效果,那么可以将其与 Quartz 结合使用。如果这仍然不能满足您的确切需求,那么只研究 OpenGL。
If you want to animate your views, start with Core Animation. It can do a lot for you already. If after trying you can't get the effect you want with CoreAnimation alone, then use it in conjunction with Quartz. If that still can't suit your exact need, then only investigate OpenGL.
如果您想为屏幕上视图的移动设置动画,那么核心动画就是您想要的。
如果您想在视图内运行自定义动画,那么您应该使用 OpenGLES 以获得最佳性能。
您可以同时进行这两项操作。
If you want to animate the movement of views around the screen then core animation is what you want.
If you want to run a custom animation inside a view then you should use OpenGLES for the best performance.
You can do both at once.