How do I display that? I mean I've tried assigning a variable to ccDrawLine() and displaying it on the screen using addChild... but that doesn't work because ccDrawLine() is void... How could I display ccDrawLine(ccp(point, point), ccp(point,point)) on the screen?
The function ccDrawLine does not return an object of any kind - it just draws. You should use it inside the draw method of a custom object of your own that inherits from CCSprite or CCNode:
The function ccDrawLine does not return an object of any kind - it just draws. You should use it inside the draw method of a custom object of your own that inherits from CCSprite or CCNode:
Hi, thank you for the quick response, but what is the (ccTime) delta for? Also, do I need to just override this method or do I need to call it or something because sorry if I sound newbish here, but copy and pasting it does not work.
How to avoid continous lines while we use in CCTouches Moved
i have given 4 points. In ccTouches Moved, i want to draw lines between 1 and 2, then from 3 to 4 but not between 2 and 3.
if i touch at first point and then if i move to second point, i want to draw line between 1 and 2. Similarly if i touch at 3rd point and then if i move to 4th point, i want to draw line between 3 and 4.
I have seen the line connecting 2nd and 3rd point. l How to avoid that.
How do I display that? I mean I've tried assigning a variable to ccDrawLine() and displaying it on the screen using addChild... but that doesn't work because ccDrawLine() is void... How could I display ccDrawLine(ccp(point, point), ccp(point,point)) on the screen?