Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
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.
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?
Replies
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesome-(void)draw
{
glColor4f(0.8, 1.0, 0.76, 1.0);
glLineWidth(6.0f);
ccDrawLine(ccp(0.0, 0.0), ccp(100.0,100.0));
}
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesomeif 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.
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesomehere is an example for using ccdrawpoint and ccdrawline in cocos2d
- Spam
- Abuse
- Troll
0 · Off Topic Insightful Disagree Dislike Like Awesome