Search code examples
iphoneopengl-esdrawingcore-graphicsquartz-2d

iPhone - Custom dynamic drawing using touch like in "Draw something" game OpenGL or Core Graphics?


I am trying to do dynamic drawing that draws a particle everywhere the finger is moving along the screen, exactly like in the game "Draw Something".

My intention is not to make a game, but I need this behavior for another app I am making.

Basically the behavior I am looking for is what the Apple sample code GLPaint does, simple drawing with the finger.

Now the question, I know that this can be done with OpenGL (GLPaint sample app does this), however I am new to OpenGL and I would like to use Core Graphics instead since it will only be 2D drawing.

Would it be possible to do this using Core Graphics only?, If so would performance be affected?. Some sample code for something like this using Core Graphics would be appreciated.

Is the best way to do this in Core Graphics to keep drawing a particle over and over again?.

Thank you,

Oscar


Solution

  • Have you considered using something like Cocos2D to achieve the OpenGL drawing? It's quite intuitive to pick up.

    I'm sorry, I have no idea how easy/hard/performance hitting using CoreGraphics would be.