views:

322

answers:

2

I want to draw a projectile of a cannon moving and explosive effects (just simple broken bits flying around). How should I approach this using Core Graphics (on iPhone)?

I am using an NSTimer to call a render method and update the animated projectile or explosive effects and I have no problem drawing each individual pieces (such as filled rec, or line) but I found that drawRect always erases the previous content and only render the new stuff.

How would you approach this?

A: 

There's a really good book on this at the Pragmatic Programmers site.

Charlie Martin
I looked at that book at the book store it only has one chapter on iphone? Is coreanimation on iphone and macosx that simmilar?
hhafez
This is not so much an animation issue as it is a rendering issue, so that book won't be of much help (case in point, I have that book so I know).
Boon
A: 

Found the solution, use setNeedsDisplayInRect instead of setNeedsDisplay and limit to the small area I was drawing into (Thanks Erica).

Boon