I have been playing around with Cocos2D-X on my computer, and I have got it to build the hello world program on all the devices I would like to be able to build it on.
I know how to make the program display a sprite, and display a label, but I have not been able just to get the program to draw a line. How can I draw a line in Cocos2D-X?
use
void ccDrawLine(const CCPoint& origin, const CCPoint& destination)function declared inCCDrawingPrimitives.hEdit
I’ve never tried using primitives myself. But as I know everything in
cocos2dis rendered visCCNodeor it’s subclass. So you must put your code insidedrawmethod of someCCNodeor it’s subclass.