Home > Database > Mysql Tutorial > cocos2dx 复杂动作 (BezierTo & BezierBy)贝塞尔曲线运动

cocos2dx 复杂动作 (BezierTo & BezierBy)贝塞尔曲线运动

不言
Release: 2018-05-26 16:48:58
Original
4613 people have browsed it

//创建一个精灵 Sprite * sprite = Sprite::create(CloseNormal.png); sprite-setPosition(Point(50,180)); this-addChild(sprite,1); //创建贝塞尔曲线曲线 ccBezierConfig bezier; bezier.controlPoint_1 = Point(100, 0);//波谷偏向 bezier.controlPoint_2
 
//创建一个精灵Sprite * sprite = Sprite::create("CloseNormal.png");sprite->setPosition(Point(50,180));this->addChild(sprite,1);//创建贝塞尔曲线曲线ccBezierConfig bezier;bezier.controlPoint_1 = Point(100, 0);//波谷偏向值bezier.controlPoint_2 = Point(200, 250);//波峰偏向值bezier.endPosition = Point(300, 50);//动作终点//创建BezierTo动作对象
BezierTo * bezierto = BezierTo::create(4.0f, bezier);
//创建BezierBy动作对象BezierBy * bezierby = BezierBy::create(4.0f, bezier);
sprite->runAction(bezierto);
Copy after login


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template