Where can I find examples of Quartz 2D drawing on the iPhone?

19,040

Solution 1

There are a number of very nice Quartz2D and CoreAnimation animation examples in this project, from the 360iDev conference session on Core Animation:

http://github.com/neror/CA360

Solution 2

I think you might be confusing a few things here. Quartz lets you do static 2-D vector drawing, but this is different from the QuartzCore framework, which you import into a project if you wish to use Core Animation. Core Animation is what you're looking for when it comes to 2-D animation on the Mac or iPhone (if you aren't going to go the way of OpenGL ES). You really do not want to use Quartz to redraw a moving scene, because you will get terrible display performance.

This does get confusing, because you can use Quartz to draw 2-D vector or raster art into UIViews or CALayers, and then animate those around using Core Animation. For a good introduction to Quartz, I recommend the Quartz 2D Programming Guide. For Core Animation, there is the Core Animation Programming Guide, as well as the Core Animation book by Bill Dudney.

You're right, there is a lot of sample code out there for Quartz on the Mac, as well as for Core Animation, but the nice thing is that Quartz and Core Animation use almost identical APIs on the Mac and iPhone. There are a few small differences, but for the most part code written for one runs on the other. As an example, we designed the Core Plot framework around Core Animation, using Quartz drawing, because we can have an almost identical codebase between our Mac and iPhone versions of the framework. That's at least one large piece of sample code that you can look at.

Finally, Opacity is a really neat utility that lets you draw vector artwork and generate the Quartz drawing code to reproduce that artwork within your application. It's a great way to try things out.

Solution 3

You should read the Quartz 2D Programming Guide. After reading the guide, take a look at QuartzDemo.

Share:
19,040
babak
Author by

babak

I am working as the Sr. Tech lead.I am always ready to learn new tools and technology. I have many years of experience in developing software,in-depth knowledge on design part. I always take challenges for daily work and come to the solution.

Updated on September 16, 2022

Comments

  • babak
    babak over 1 year

    I am going to develope the 2D game in Iphone using Quartz.

    what is the main Difference between Quartz and QuartzCore?

    I have searched a lot over the internet, but only able to find out the MAC OS with Quartz Examples.

    If any body has any Link/URL for Examples of Quartz(2D) using Iphone Developement,which would be run in the Real Iphone Device? Also if possible than give the Link for Bunch of examples/repository for Quartz Iphone.

    Thanks,

    Mishal Shah

  • babak
    babak over 14 years
    Thanks for Help and right direction. But can you pls give me any URL/Link which suggest me examples for the Quartz and its animation?(In which it should be imported as the library in the files).
  • meersmans
    meersmans over 13 years
    I am looking for example projects to.. any links?
  • Brad Larson
    Brad Larson over 13 years
    @meersmans - See my answer to a newer question here: stackoverflow.com/questions/3463256/…
  • mmccomb
    mmccomb about 13 years
    Great final thought there with the link to Opacity - it's a very handy tool