0
votes

I'm working on an iOS game, and part of it requires the player to be able to touch and interact with some lines that are drawn on the screen. Essentially, I need to be able to detect whether or not a player has touched a line, and if so, change it's color/thickness etc.

Now, I know I can overwrite the draw method on a custom class with ccDrawLine and render out the line. Is that preferable to using OpenGL to render them?

Thanks

1

1 Answers

0
votes

Sure, it is preferable, because cocos2d takes care of content scaling. I suggest you take a look at ccDrawLine function inside CCDrawingPrimitives.m.