开发者

Cocos2d - Should I use ccDrawLine or OpenGL for touchable "lines"

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 开发者_JAVA技巧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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜