mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 01:36:02 +08:00
add example use CCAction classes with CCSkeleton
This commit is contained in:
parent
fc7cc63413
commit
d8ac89b5df
@ -24,6 +24,12 @@ bool ExampleLayer::init () {
|
|||||||
CCSkeleton* skeletonNode = CCSkeleton::create(skeletonData);
|
CCSkeleton* skeletonNode = CCSkeleton::create(skeletonData);
|
||||||
skeletonNode->state->setAnimation(animation, true);
|
skeletonNode->state->setAnimation(animation, true);
|
||||||
skeletonNode->debug = true;
|
skeletonNode->debug = true;
|
||||||
|
|
||||||
|
CCAction* fade = CCRepeatForever::create(CCSequence::create(CCFadeOut::create(1),
|
||||||
|
CCFadeIn::create(1),
|
||||||
|
CCDelayTime::create(5),
|
||||||
|
NULL));
|
||||||
|
skeletonNode->runAction(fade);
|
||||||
|
|
||||||
CCSize windowSize = CCDirector::sharedDirector()->getWinSize();
|
CCSize windowSize = CCDirector::sharedDirector()->getWinSize();
|
||||||
skeletonNode->setPosition(ccp(windowSize.width / 2, 20));
|
skeletonNode->setPosition(ccp(windowSize.width / 2, 20));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user