Thanks Lucio > Having many canvas seems expensive, but its what you expec canvas to > do for you transparently, so it cant be that bad. > > And having canvas smart enough fro that is something i havent tried to > do yet, and maybe its not worth it. (its easy to do it when using > canvas and you have more information that canvas doesnt need to infer)
Doubt it is worth it, this works fine. It also gives me scope for a few extra features, once I get it all going, as well. > > >> 4) Draw a few lines, preferably with shart direction changes, and > >> you'll see that there are gaps generated in either the endcaps or > >> discontinuities on the joins. > > Playing with your code i see that the problem is that draw wont draw a > join when the line length is too short. this shows the problem: > line_width = 50 > self.set_color( (255,255,0,50) ) > self.set_stroke_width( line_width ) > > self.set_join( draw.ROUND_JOIN ) > self.move_to((100,100)) > self.line_to((150,100)) > self.line_to((150, 124)) > > If we increase the last 124 to 125 it will work. > > The problem is that draw needs to cut 25 pixels from the second > segment to draw the join. but it doesnt have enough pixels, so it does > weird things. > > It is a bug, and a very nasty one. A workaround would be to only add > lines is the movement is bigger than half the line width. ugly, i > know. Ugly but bearable. I can probably modify the code to change the movement as you suggest as mostly the line width will be quite small. > > There are still issues with sharp turns. > > Summing it up, cocos.Draw is not ready for prime time. This may be true but it is way, way better than the primitive code I'd put together to do a similar thing. So I'll keep using it. Regards john --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cocos2d discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cocos-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
