2012-09-17 18:49:05 +08:00
|
|
|
#include "AnimationsTestLayer.h"
|
|
|
|
|
|
|
|
USING_NS_CC;
|
|
|
|
USING_NS_CC_EXT;
|
|
|
|
|
|
|
|
AnimationsTestLayer::AnimationsTestLayer()
|
|
|
|
: mAnimationManager(NULL)
|
|
|
|
{}
|
|
|
|
|
|
|
|
AnimationsTestLayer::~AnimationsTestLayer()
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(mAnimationManager);
|
|
|
|
}
|
|
|
|
|
2012-11-26 22:00:25 +08:00
|
|
|
SEL_MenuHandler AnimationsTestLayer::onResolveCCBCCMenuItemSelector(CCObject * pTarget, const char * pSelectorName)
|
2012-09-17 18:49:05 +08:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2012-11-26 22:00:25 +08:00
|
|
|
SEL_CCControlHandler AnimationsTestLayer::onResolveCCBCCControlSelector(CCObject *pTarget, const char*pSelectorName) {
|
2012-09-17 18:49:05 +08:00
|
|
|
CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onCCControlButtonIdleClicked", AnimationsTestLayer::onCCControlButtonIdleClicked);
|
|
|
|
CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onCCControlButtonWaveClicked", AnimationsTestLayer::onCCControlButtonWaveClicked);
|
|
|
|
CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onCCControlButtonJumpClicked", AnimationsTestLayer::onCCControlButtonJumpClicked);
|
|
|
|
CCB_SELECTORRESOLVER_CCCONTROL_GLUE(this, "onCCControlButtonFunkyClicked", AnimationsTestLayer::onCCControlButtonFunkyClicked);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2012-11-26 22:00:25 +08:00
|
|
|
bool AnimationsTestLayer::onAssignCCBMemberVariable(CCObject * pTarget, const char * pMemberVariableName, CCNode * pNode) {
|
2012-09-17 18:49:05 +08:00
|
|
|
CCB_MEMBERVARIABLEASSIGNER_GLUE(this, "mAnimationManager", CCBAnimationManager *, this->mAnimationManager);
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void AnimationsTestLayer::setAnimationManager(cocos2d::extension::CCBAnimationManager *pAnimationManager)
|
|
|
|
{
|
|
|
|
CC_SAFE_RELEASE_NULL(mAnimationManager);
|
|
|
|
mAnimationManager = pAnimationManager;
|
|
|
|
CC_SAFE_RETAIN(mAnimationManager);
|
|
|
|
}
|
|
|
|
|
|
|
|
void AnimationsTestLayer::onCCControlButtonIdleClicked(CCObject *pSender, CCControlEvent pCCControlEvent) {
|
2012-11-29 18:04:33 +08:00
|
|
|
mAnimationManager->runAnimationsForSequenceNamedTweenDuration("Idle", 0.3f);
|
2012-09-17 18:49:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void AnimationsTestLayer::onCCControlButtonWaveClicked(CCObject *pSender, CCControlEvent pCCControlEvent) {
|
2012-11-29 18:04:33 +08:00
|
|
|
mAnimationManager->runAnimationsForSequenceNamedTweenDuration("Wave", 0.3f);
|
2012-09-17 18:49:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void AnimationsTestLayer::onCCControlButtonJumpClicked(CCObject *pSender, CCControlEvent pCCControlEvent) {
|
2012-11-29 18:04:33 +08:00
|
|
|
mAnimationManager->runAnimationsForSequenceNamedTweenDuration("Jump", 0.3f);
|
2012-09-17 18:49:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void AnimationsTestLayer::onCCControlButtonFunkyClicked(CCObject *pSender, CCControlEvent pCCControlEvent) {
|
2012-11-29 18:04:33 +08:00
|
|
|
mAnimationManager->runAnimationsForSequenceNamedTweenDuration("Funky", 0.3f);
|
2012-09-17 18:49:05 +08:00
|
|
|
}
|