问题
I want to draw a Cubic/Quad Bezier with Cocos2d v3. I looked at CCDrawNode but no change. Does anyone know a way around? Thanks!!
回答1:
finally, I found the solution: https://github.com/njt1982/CCDrawNode-Bezier
回答2:
This is how I did it in Cocos2d 3.3:
// blue test
auto bluN = DrawNode::create();
//Draw a blue quadratic bezier curve
Color4F blue(0, 0, 1, 1);
bluN->drawCubicBezier(Vec2(0.0, 0.0), Vec2(_visibleSize.height, 0.0), Vec2(_visibleSize.height, _visibleSize.height), Vec2(0.0,_visibleSize.height), 18, blue);
_hudLayer->addChild(bluN);
This creates a perfect semi-circle (half-circle).
Chris
来源:https://stackoverflow.com/questions/25143084/draw-quad-and-cubic-bezier-in-cocos2d-v3-on-ios