Hi, does anyone have a working sample project showing how can a user can draw simple sketches on the iPhone, with his finger? Something like the GLPaint, but easier, without Open GL. Something just with the basic drawing functions. I know there was a FingerSketches sample time ago, but it appears it's no longer available.
+2
A:
You're right, there was a FingerSketch example; I'm not sure whether it still works, and I don't think it's a good idea to publish the entire example here. But I think you can use the Touches or MoveMe samples as a starting point to learn how to react to touches.
Basically, you have to remember the last position on each touch event, and draw a line from the last to the current position in touchesMoved and touchesEnded. As usual, FingerSketch doesn't draw directly to the screen, but to a separate drawing context, and then calls [self setNeedsDisplay]
to redraw itself.
oefe
2009-03-07 19:35:46