Hello,
I am new to cocos2d and I faced a problem last night. I want to do something like this: I have a grid with points of fixed gap. I would like to draw a line between those points, when a user selects one. And I would also like to animate the last step, after the user has selected next point. So the line can connect two points of the grid horizontally, vertically or crosswise. Another thing is, that this line should be at least 4 pixel width, two pixels of one color and two of another. Maybe edges pixels should be darker or have a smaller alpha value.
So please, do you have any ideas how to do that? I tried to extend CCNode class and override "draw" method. But I was not able to achieve transparency in my line, nor gradient I want.
My idea was to have a node for every line part between two points of the grid, with a type: horizontal, vertical and four crosswise types. Then in draw method I drawed a line based on type of the node. Next I wanted to put such a node at the current end of the line, and when user selects another point, set the type and run an action on that node, so it will resize such as the line is drawing...
I hope I have made myself clear... :))
Thanks in advance for any help.
Regards,
Przemek