cocos2d开发学习三:节点的动作(Action)介绍
一:动作Actions
从上一篇我们看到菜单场景中菜单layer加载进来有个从上滑入的动作效果
CCCallFunc* func = [CCCallFunc actionWithTarget:self selector:@selector(onCallFunc)]; CCCallFuncN* funcN = [CCCallFuncN actionWithTarget:self selector:@selector(onCallFuncN:)];CCCallFuncND* funcND = [CCCallFuncND actionWithTarget:self selector:@selector(onCallFuncND:data:) data:(void*)self];CCSequence* seq = [CCSequence actions:tint1, func, tint2, funcN, tint3, funcND, nil]; [label runAction:seq];
同步操作
CCSpawn,这个就没什么说的,相信做个一些动画效果的都知道比如一个圆一边颜色渐变,一边从小变大。
只不过要明白点,同步执行最后的完成时间由基本动作中用时最大者决定。