1 CCAction动作

CCAction作为一个基类。事实上质是一个接口(即抽象类),由它派生的实现类(如运动和转动等)才是我们实际使用的动作。CCAction
的绝大多数实现类都派生自CCFiniteTimeAction。由CCFiniteTimeAction
派生出的两个主要类各自是瞬时动作(CCActionInstant)和持续性动作(CCActionInterval)。


CCActionInstant瞬时动作

A 总述

瞬时动作是指能立马完毕的动作,是CCFiniteTimeAction
中动作持续

时间为0
的特例。

更准确地说,这类动作是在下一帧会立马运行并完毕的

动作,如设定位置、设定缩放等。

这些动作原本能够通过简单地对CCNode

赋值完毕,可是把它们包装为动作后。能够方便地与其它动作类组合为复杂

动作。


组成

C
具体解释

//设置位置

CCPlace * place = CCPlace::create(ccp(300,200));

//设置x
反转

CCAction *flipy =
CCFlipY::create(true);

//设置y
反转

CCAction *flipx = CCFlipX::create(true);

CCShow * show = CCShow::create();

CCDelayTime *dt = CCDelayTime::create(2.0f);

CCHide * hide = CCHide::create();

//显示或隐藏

CCSequence *seq = CCSequence::create(show, dt, hide, dt, show, NULL);

CCToggleVisibility * togglev = CCToggleVisibility::create();

//触发显示或隐藏

CCSequence *seq = CCSequence::create(togglev, dt, togglev, dt,togglev,NULL);

3
 CCPlace案例

#include
"T13Action.h"

#include
"AppMacros.h"

CCScene *T13Action::scene()

{

CCScene *
scene =
CCScene::create();

T13Action *
layer =
T13Action::create();

scene->addChild(layer);

return
scene;

}

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

addChild(man);

CCDelayTime *
dt =
CCDelayTime::create(0.4);

//将图像显示到指定的位置

CCPlace *place
= CCPlace::create(ccp(50,160));

man->runAction(place);

return
true;

}

执行结果:

4
CCFlipX沿着Y轴反转

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

addChild(man);

//这是延时

CCDelayTime *
dt =
CCDelayTime::create(2.0f);

//将图像显示到指定的位置

CCPlace
*place =
CCPlace::create(ccp(50,160));

CCFlipY *
flip =
CCFlipY::create(true);

//这里是一个动作序列

CCSequence *
seq =
CCSequence::create(place,
dt,
flip,
NULL);

man->runAction(seq);

return
true;

}

执行结果:


CCToggleVisibility

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

man->setPosition(ccp(100,
160));

addChild(man);

//这是延时

CCDelayTime *
dt =
CCDelayTime::create(1.0f);

CCPlace *place
= CCPlace::create(ccp(50,
160));

//让sprite显示

CCToggleVisibility *
tv =
CCToggleVisibility::create();

CCSequence *
seq =
CCSequence::create(place,dt,
tv,
dt,
tv,
NULL);

man->runAction(seq);

return
true;

}

CCActionInterval延时动作

A
总述

持续性动作是在持续的一段时间里逐渐完毕的动作。也就是要跨多个帧循环来完毕。如精灵从一个点连续地移动到还有一个点,每一帧内移动一点,我们看到的是帧循环的累积效应。

与瞬时动作相比。持续性动作的种类更丰富。因为这些动作将持续一段时间,所以大多数的持续性动作都会带有一个用于控制动作运行时间的实型參数duration。

每一种持续性动作通常都存在两个不同的变种动作,分别具有To和By后缀:后缀为To的动作描写叙述了节点属性的绝对变化。比如CCMoveTo将对象移动到一个特定的位置;而后缀By的动作则属性值相对的变化,如CCMoveBy将对象移动一段相对位移。


组成

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdG90b3R1enVvcXVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">

C
具体解释

CCMoveTo * to = CCMoveTo::create(2, ccp(300, 160));

CCMoveBy * by = CCMoveBy::create(2, ccp(300, 160));

CCMoveBy * by2 = CCMoveBy::create(2, ccp(200,0));

//第一个參数为,动作持续的时间,第二个參数为。To
目标坐标点。By
为偏移坐标

CCJumpTo * to = CCJumpTo::create(2, ccp(300, 160), 50, 1);

CCJumpBy * by = CCJumpBy::create(2, ccp(200, 0), 50, 1);

CCJumpBy * by2 = CCJumpBy::create(2, ccp(0, 0), 50, 1);

//第二个參考为 
表示跳跃的终点或距离,第三个參数为 
表示最大高度,第四个參数为表示跳跃次数

6
CCMoveTo
CCMoveBy

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

man->setPosition(ccp(100,
160));

addChild(man);

//这是延时

CCDelayTime *
dt =
CCDelayTime::create(1.0f);

//3秒中将位置移动到ccp(300,160)

CCMoveTo *
to =
CCMoveTo::create(2,
ccp(300,160));

//通过moveby方式得到的,后面的是一个相对偏移量

//CCMoveBy * by = CCMoveBy::create(2, ccp(200, 0));

man->runAction(to);

return
true;

}

执行结果:

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdG90b3R1enVvcXVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">

7
CCJumpTo
CCJumpBy

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

man->setPosition(ccp(100,
160));

//2秒钟。跳到(400,160),跳的高度是100,跳3次

CCJumpTo *
to =
CCJumpTo::create(2,
ccp(400, 160), 100, 3);

//以下的by相同是相对的偏移位置

CCJumpBy
*
by =
CCJumpBy::create(2,ccp(300,0),100,3);

man->runAction(by);

addChild(man);

return
true;

}


Bezier具体解释

每一条贝塞尔曲线都包括一个起点和一个终点。

在一条曲线中。起点和终点都各自包括一个控制点,而控制点到端点的连线称作控制线。控制线决定了从端点发出的曲线的形状。包括角度和长度两个參数:角度决定了它所控制的曲线的方向。即这段曲线在这一控制点的切线方向;长度控制曲线的曲率。控制线越长,它所控制的曲线离控制线越近。

ccBezierConfig bc;

bc.controlPoint_1 = ccp(200,300);

bc.controlPoint_2 = ccp(300, 20);

bc.endPosition = ccp(400, 160);

CCBezierTo * to = CCBezierTo::create(2, bc);

案例:

在头文件里加入draw()函数的声明

void
draw();

#include
"T13Action.h"

#include
"AppMacros.h"

CCScene *T13Action::scene()

{

CCScene *
scene =
CCScene::create();

T13Action *
layer =
T13Action::create();

scene->addChild(layer);

return
scene;

}

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

man->setPosition(ccp(100,
160));

//開始的位置100,160

ccBezierConfig
c;

//控制点 (200,300)这是一个实际的位置点

c.controlPoint_1
= ccp(200, 300);

c.controlPoint_2
= ccp(300,20);

c.endPosition
= ccp(400,160);

CCBezierTo *
to =
CCBezierTo::create(2,
c);

man->runAction(to);

addChild(man);

return
true;

}

//原生画图,每一帧都会画图

void
T13Action::draw()

{

//第一个參数为起始点

//第二个參数为控制点

//第三个參数为控制点

//第四个为终止点

//第五个为段

ccDrawCubicBezier(

ccp(100, 160),

ccp(200, 300),

ccp(300, 20),

ccp(400, 160),

100);

}

执行结果:

通过by的方式要达到上面的效果的代码是:

#include
"T13Action.h"

#include
"AppMacros.h"

CCScene *T13Action::scene()

{

CCScene *
scene =
CCScene::create();

T13Action *
layer =
T13Action::create();

scene->addChild(layer);

return
scene;

}

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

man->setPosition(ccp(100,
160));

//開始的位置100,160

ccBezierConfig
c;

//以下的是偏移(100,160)的距离。全部点都是相对起始点的

c.controlPoint_1
= ccp(100, 140);

c.controlPoint_2
= ccp(200,-140);

c.endPosition
= ccp(300,0);

CCBezierBy *
by =
CCBezierBy::create(2,
c);

man->runAction(by);

addChild(man);

return
true;

}

//原生画图,每一帧都会画图

void
T13Action::draw()

{

//第一个參数为起始点

//第二个參数为控制点

//第三个參数为控制点

//第四个为终止点

//第五个为段

ccDrawCubicBezier(

ccp(100, 160),

ccp(200, 300),

ccp(300, 20),

ccp(400, 160),

100);

}

放大倍数

CCScaleTo * to = CCScaleTo::create(2, 3);  
//2秒钟放大3被

CCScaleBy * by = CCScaleBy::create(2, 3);

#include
"T13Action.h"

#include
"AppMacros.h"

CCScene *T13Action::scene()

{

CCScene *
scene =
CCScene::create();

T13Action *
layer =
T13Action::create();

scene->addChild(layer);

return
scene;

}

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

man->setPosition(ccp(100,
160));

//属性相关的。将图片放大

CCScaleTo *
to =
CCScaleTo::create(2,
2);

CCScaleBy *
by =
CCScaleBy::create(2,
2);

man->runAction(by);

addChild(man);

return
true;

}

//原生画图。每一帧都会画图

void
T13Action::draw()

{

//第一个參数为起始点

//第二个參数为控制点

//第三个參数为控制点

//第四个为终止点

//第五个为段

ccDrawCubicBezier(

ccp(100, 160),

ccp(200, 300),

ccp(300, 20),

ccp(400, 160),

100);

}

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdG90b3R1enVvcXVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">

CCRotateTo * to = CCRotateTo::create(2, 30); 
//2秒钟顺时针旋转30度

CCRotateBy * by = CCRotateBy::create(2, 30);

#include
"T13Action.h"

#include
"AppMacros.h"

CCScene *T13Action::scene()

{

CCScene *
scene =
CCScene::create();

T13Action *
layer =
T13Action::create();

scene->addChild(layer);

return
scene;

}

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

man->setPosition(ccp(100,
160));

//表示2秒钟逆时针旋转30度

CCRotateTo *to
= CCRotateTo::create(2,
-30);

CCRotateBy *by
= CCRotateBy::create(2,
-30);

man->runAction(by);

addChild(man);

return
true;

}

//原生画图,每一帧都会画图

void
T13Action::draw()

{

//第一个參数为起始点

//第二个參数为控制点

//第三个參数为控制点

//第四个为终止点

//第五个为段

ccDrawCubicBezier(

ccp(100, 160),

ccp(200, 300),

ccp(300, 20),

ccp(400, 160),

100);

}

执行结果:

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdG90b3R1enVvcXVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">

CCSkewTo * to = CCSkewTo::create(2, 20, 40);

CCSkewBy * by = CCSkewBy::create(2, 20, 40);

#include
"T13Action.h"

#include
"AppMacros.h"

CCScene *T13Action::scene()

{

CCScene *
scene =
CCScene::create();

T13Action *
layer =
T13Action::create();

scene->addChild(layer);

return
scene;

}

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

man->setPosition(ccp(100,
160));

//2秒。x上扭曲20度。y上30

CCSkewTo *
to =
CCSkewTo::create(2,
20, 30);

CCSkewBy *
by =
CCSkewBy::create(2,
20, 30);

man->runAction(by);

addChild(man);

return
true;

}

//原生画图。每一帧都会画图

void
T13Action::draw()

{

//第一个參数为起始点

//第二个參数为控制点

//第三个參数为控制点

//第四个为终止点

//第五个为段

ccDrawCubicBezier(

ccp(100, 160),

ccp(200, 300),

ccp(300, 20),

ccp(400, 160),

100);

}

执行结果:

CCTintTo * to = CCTintTo::create(2, 123, 123, 123);

CCTintBy * by = CCTintBy::create(2, 23, 45, 90);

#include
"T13Action.h"

#include
"AppMacros.h"

CCScene *T13Action::scene()

{

CCScene *
scene =
CCScene::create();

T13Action *
layer =
T13Action::create();

scene->addChild(layer);

return
scene;

}

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

man->setPosition(ccp(100,
160));

//第一个參数表示的是时间,后面3个分别表示的是RGB颜色

//以下会使图片由亮色变成暗色

CCTintTo *
to =
CCTintTo::create(2,
123, 123, 122);

CCTintTo *
by =
CCTintTo::create(2,
123, 123, 122);

man->runAction(to);

addChild(man);

return
true;

}

//原生画图,每一帧都会画图

void
T13Action::draw()

{

//第一个參数为起始点

//第二个參数为控制点

//第三个參数为控制点

//第四个为终止点

//第五个为段

ccDrawCubicBezier(

ccp(100, 160),

ccp(200, 300),

ccp(300, 20),

ccp(400, 160),

100);

}

执行结果:

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdG90b3R1enVvcXVhbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">

CCFadeIn CCFadeOut
淡入淡出

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

man->setPosition(ccp(100,
160));

//渐近显示

CCFadeIn *in =
CCFadeIn::create(2);

//渐出显示

CCFadeOut *out
= CCFadeOut::create(2);

man->runAction(in);

addChild(man);

return
true;

}

CCFadeTo 渐进到某个透明度上去

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

man->setPosition(ccp(100,
160));

//第一个表示时间,第二个參数为透明度

CCFadeTo * in =
CCFadeTo::create(2,
120);

man->runAction(in);

addChild(man);

return
true;

}

9 CCCardinalSplineTo
具体解释

CCPointArray * array = CCPointArray::create(5);

array->addControlPoint(ccp(100,160));

array->addControlPoint(ccp(200, 160));

array->addControlPoint(ccp(200, 250));

array->addControlPoint(ccp(300, 250));

array->addControlPoint(ccp(300, 160));

array->addControlPoint(ccp(450, 160));

CCCardinalSplineTo * to = CCCardinalSplineTo::create(2, array,1);

#include
"T13Action.h"

#include
"AppMacros.h"

CCScene *T13Action::scene()

{

CCScene *
scene =
CCScene::create();

T13Action *
layer =
T13Action::create();

scene->addChild(layer);

return
scene;

}

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

man->setPosition(ccp(100,
160));

//以下表示6个点

CCPointArray *array =
CCPointArray::create(6);

//一下表示每一个点的坐标

array->addControlPoint(ccp(100,160));

array->addControlPoint(ccp(200,
160));

array->addControlPoint(ccp(200,
250));

array->addControlPoint(ccp(300,
250));

array->addControlPoint(ccp(300,
160));

array->addControlPoint(ccp(450,
160));

//array->addControlPoint(ccp(0,0)); 
//100 160

//array->addControlPoint(ccp(100, 0));

//array->addControlPoint(ccp(100, 90));

//array->addControlPoint(ccp(200, 90));

//array->addControlPoint(ccp(200, 0));

//array->addControlPoint(ccp(450, 0));

CCCardinalSplineTo *
to =
CCCardinalSplineTo::create(5,
array, 1);

CCCardinalSplineTo *
toRev = (CCCardinalSplineTo
*)to->reverse();

CCSequence *
seq =
CCSequence::create(to,
toRev,
NULL);

//CCCardinalSplineBy * by = CCCardinalSplineBy::create(5, array, 1);

//CCCardinalSplineBy * byRev = (CCCardinalSplineBy 
*)by->reverse();

//CCSequence * seq = CCSequence::create(by, byRev, NULL);

//man->runAction(to);

man->runAction(seq);

addChild(man);

return
true;

}

//原生画图。每一帧都会画图

void
T13Action::draw()

{

CCPointArray *array =
CCPointArray::create(6);

array->addControlPoint(ccp(100,
160));

array->addControlPoint(ccp(200,
160));

array->addControlPoint(ccp(200,
250));

array->addControlPoint(ccp(300,
250));

array->addControlPoint(ccp(300,
160));

array->addControlPoint(ccp(450,
160));

ccDrawCardinalSpline(array, 1, 100);

}

执行结果:

CCPointArray * array = CCPointArray::create(5);

//以下的坐标是相对位置的坐标

array->addControlPoint(ccp(0, 0));

array->addControlPoint(ccp(100, 0));

array->addControlPoint(ccp(100, 90));

array->addControlPoint(ccp(200, 90));

array->addControlPoint(ccp(200, 0));

array->addControlPoint(ccp(350, 0));

CCCardinalSplineBy * by = CCCardinalSplineBy::create(2, array, 1);

通过这样的方式实现有来有去

CCCardinalSplineBy * byRev = (CCCardinalSplineBy *)by->reverse();

CCSequence * seq = CCSequence::create(by, byRev, NULL);

CCBlink * blink = CCBlink::create(2,10);

CCSpawn * spa = CCSpawn::create(seq,blink,NULL);

CCBlink CCSpawn

#include
"T13Action.h"

#include
"AppMacros.h"

CCScene *T13Action::scene()

{

CCScene *
scene =
CCScene::create();

T13Action *
layer =
T13Action::create();

scene->addChild(layer);

return
scene;

}

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

man->setPosition(ccp(100,
160));

//5秒钟闪烁10次

CCBlink *
blink =
CCBlink::create(5,
10);

man->runAction(blink);

addChild(man);

return
true;

}

//原生画图。每一帧都会画图

void
T13Action::draw()

{

CCPointArray *array =
CCPointArray::create(6);

array->addControlPoint(ccp(100,
160));

array->addControlPoint(ccp(200,
160));

array->addControlPoint(ccp(200,
250));

array->addControlPoint(ccp(300,
250));

array->addControlPoint(ccp(300,
160));

array->addControlPoint(ccp(450,
160));

ccDrawCardinalSpline(array, 1, 100);

}

CCSpawn
让两个动作同一时候进行

#include
"T13Action.h"

#include
"AppMacros.h"

CCScene *T13Action::scene()

{

CCScene *
scene =
CCScene::create();

T13Action *
layer =
T13Action::create();

scene->addChild(layer);

return
scene;

}

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

man->setPosition(ccp(100,
160));

CCPointArray * array =
CCPointArray::create(6);

array->addControlPoint(ccp(100,160));

array->addControlPoint(ccp(200,
160));

array->addControlPoint(ccp(200,
250));

array->addControlPoint(ccp(300,
250));

array->addControlPoint(ccp(300,
160));

array->addControlPoint(ccp(450,
160));

CCCardinalSplineTo *
to =
CCCardinalSplineTo::create(5,
array, 1);

//5秒钟闪烁10次

CCBlink *
blink =
CCBlink::create(5,
2);

//通过spawn的方式实现两个动过同一时候进行

CCSpawn *
spawn =
CCSpawn::create(to,
blink ,
NULL);

man->runAction(spawn);

addChild(man);

return
true;

}

//原生画图。每一帧都会画图

void
T13Action::draw()

{

CCPointArray *array =
CCPointArray::create(6);

array->addControlPoint(ccp(100,
160));

array->addControlPoint(ccp(200,
160));

array->addControlPoint(ccp(200,
250));

array->addControlPoint(ccp(300,
250));

array->addControlPoint(ccp(300,
160));

array->addControlPoint(ccp(450,
160));

ccDrawCardinalSpline(array, 1, 100);

}

CCRepeat CCRepeatForever
(关于跳转)

#include
"T13Action.h"

#include
"AppMacros.h"

CCScene *T13Action::scene()

{

CCScene *
scene =
CCScene::create();

T13Action *
layer =
T13Action::create();

scene->addChild(layer);

return
scene;

}

bool
T13Action::init()

{

TBack::init();

CCSprite *
man =
CCSprite::create("man.png");

CCSprite *
woman =
CCSprite::create("woman.png");

man->setPosition(ccp(100,
160));

//2秒内条1次

CCJumpBy *
by =
CCJumpBy::create(2,
ccp(0,0),100,1);

//反复10个2秒

CCRepeat *
repeat =
CCRepeat::create(by,10);

//man->runAction(CCRepeatForever::create(by));

man->runAction(repeat);

addChild(man);

return
true;

}

//原生画图。每一帧都会画图

void
T13Action::draw()

{

CCPointArray *array =
CCPointArray::create(6);

array->addControlPoint(ccp(100,
160));

array->addControlPoint(ccp(200,
160));

array->addControlPoint(ccp(200,
250));

array->addControlPoint(ccp(300,
250));

array->addControlPoint(ccp(300,
160));

array->addControlPoint(ccp(450,
160));

ccDrawCardinalSpline(array, 1, 100);

}

版权声明:本文博客原创文章,博客,未经同意,不得转载。

CCPlace,CCFlip*,CCToggleVisibility,CCMoveTo*,CCJumpTo*,CCScale*,CCRotate*,CCSkew*,fade,CCCardinalSp*的更多相关文章

  1. CCMoveTo 等函数理解

    CCMoveTo: 使用CCMoveTo action来让对象从右侧屏幕外移动到屏幕左侧.注意可以通过指定duration参数控制这一过程需要多久,这里我们随机给他2-4秒的时间. CCCallFun ...

  2. [一位菜鸟的COCOS-2D编程之路]COCOS2D中得动作,特效和动画

    一,CCActionManager 管理所有节点动作的对象 来看看打飞机里面的一个onEnter 方法 - (void)onEnter { [super onEnter]; //一定要注意添加此方法, ...

  3. cocos2dx进阶学习之CCAction

    CCAction在cocos2dx中,抽象了节点的动作.它由CCObject派生,因此它不是渲染节点. 它经常的用法是,创建一个action,然后让某个CCNode对象(一般是精灵),去执行它. 在马 ...

  4. 九、cocos2dx之Actions

    本文由qinning199原创,转载请注明:http://www.cocos2dx.net/?p=86 Action是CCNode对象的一种顺序.这些动作经常改变对象的一些属性,比如位置,旋转,缩放等 ...

  5. cocos2d-x开发记录:二,基本概念(动作,动画,坐标系统)

    既然我们选择用cocos2d,那么他里面的一些基本概念我们肯定是要熟悉下的,以下资料来源于官网,英语好的可以直接去官网看. 一.Actions(动作) 动作都由于CCNode对象发出.这些动作通常修改 ...

  6. CCAction详解

    http://blog.csdn.net/bailongvip/article/details/7895370 转载自雨松MOMO程序研究院 上一章我们了解了CCNode的实现原理,这次我跟大家探讨一 ...

  7. cocos2dx基础篇(19) 基本动作CCAction

    [3.x]     (1)去掉"CC"     (2)新增了一些动作:(精力有限,新增的动作请自行摸索) > EaseBezierAction > EaseQuadra ...

  8. cocos2d-x CCAction:动作(转)

    透明度变化的功能挺不错.   瞬时动作 瞬时动作不需要时间,立即完成 [cpp]   //放置,=setPosition()   pRole->runAction(CCPlace::create ...

  9. cocos2d-x高级学习

    弱联网开发技术: libcurl 添加lib文件:libcurl_imp.lib  pthreadVCE2.lib 添加头文件:#include"curl/curl.h" curl ...

随机推荐

  1. (十四)RabbitMQ消息队列-启用SSL安全通讯

    原文:(十四)RabbitMQ消息队列-启用SSL安全通讯 如果RabbitMQ服务在内网中,只有内网的应用连接,我们认为这些连接都是安全的,但是个别情况我们需要让RabbitMQ对外提供服务.这种情 ...

  2. sed学习总结

    sed学习总结 sed工作流 测试文件:cat employee.txt 101,John Doe,CEO 102,Jason Smith,IT Manager 103,Raj Reddy,Sysad ...

  3. C语言实现字符串截取函数left、mid和right

    作者:iamlaosong C语言字符串截取须要自己编程实现,只是.网络时代,自然不用自己从头写了.网上各种方法的实现代码已经多如牛毛了,这儿抄录一个感觉不错的备案. #include <std ...

  4. 多校第六场 HDU 4927 JAVA大数类+模拟

    HDU 4927 −ai,直到序列长度为1.输出最后的数. 思路:这题实在是太晕了,比赛的时候搞了四个小时,从T到WA,唉--对算组合还是不太了解啊.如今对组合算比較什么了-- import java ...

  5. JNI_Android 项目中调用.so动态库实现详解

    转自:http://www.yxkfw.com/?p=7223 1. 在Eclipse中创建项目:TestJNI 2. 新创建一个class:TestJNI.java package com.wwj. ...

  6. php实现把数组排成最小的数(核心是排序)(看别人的代码其实也没那么难)(把php代码也看一下)(implode("",$numbers);)(usort)

    php实现把数组排成最小的数(核心是排序)(看别人的代码其实也没那么难)(把php代码也看一下)(implode("",$numbers);)(usort) 一.总结 核心是排序 ...

  7. 谈谈JavaEE的mvc模式及典型的三层架构

    首先,向读者介绍一下mvc架构,mvc是一种源于桌面程序的架构模式,它的基本思想是把程序界面和业务逻辑分开,这样便于软件的后期维护,同时也方便开发时期分工及管理,mvc有很多有点所以现在已经被广泛的应 ...

  8. 定义变量let,const

    1.块级作用域let 声明变量,作用域是最近的"{}": 'use strict'; { let test = '1'; } console.log(test);//test is ...

  9. 混合使用C++语言和Objective-C语言

    如果你的源文件扩展名是.m的,你还需要改成.mm,这样编译器才知道你将会在该文件中混合使用C++语言和Objective-C语言.

  10. 12个被滥用的Android应用程序权限

    Android应用程序须要权限才干正常运作,只是网络犯罪分子会将其用在个人私利上.来看看最常被要求的权限以及它们会怎样被滥用. .网络定位功能 这代表什么:同意应用程序通过网络定位(像是基地台或无线网 ...