2

I am developing a puzzle game.

In this game I have to draw custom lines on touch began to touch end points. For this I searched a lot, but all tutorials or links only tell us that how can we use drawLine method for line drawing.

Drawing line on touches moved in COCOS2D is one of them, but I want to draw custom lines over my background sprite. So any one can tell me that is there any method in cocos2d so that i could use my texture image for line drawing.

If this is possible then please refer me link.

vcsjones
  • 138,677
  • 31
  • 291
  • 286
aks.knit1108
  • 1,305
  • 9
  • 20

1 Answers1

0

Try using CCRibbon to draw a textured line

Edit to expand

I thought I'd looked into this previously :-) This code should be adaptable for your needs also non CCRibbon method (Though it won't be as smooth as multiple CCRibbon's)

Community
  • 1
  • 1
davbryn
  • 7,156
  • 2
  • 24
  • 47
  • thanks for your suggestion, but it is not useful for me as i want to draw line each time from touch began to touch end. So every lines should be disconnected. – aks.knit1108 Jul 03 '12 at 04:29
  • That's not a problem - just create a new CCRibbon each time you have a touch began event and terminate it in your touch end? – davbryn Jul 03 '12 at 08:23