本文整理汇总了C++中ActionObject::play方法的典型用法代码示例。如果您正苦于以下问题:C++ ActionObject::play方法的具体用法?C++ ActionObject::play怎么用?C++ ActionObject::play使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ActionObject
的用法示例。
在下文中一共展示了ActionObject::play方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: menuCloseCallback
void HelloWorld::menuCloseCallback(CCObject* pSender)
{
//#if (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) || (CC_TARGET_PLATFORM == CC_PLATFORM_WP8)
// CCMessageBox("You pressed the close button. Windows Store Apps do not implement a close button.","Alert");
//#else
// CCDirector::sharedDirector()->end();
//#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
// exit(0);
//#endif
//#endif
int t = g_layoutcnt%2;
if( t == 0)
{
m_pLayout = dynamic_cast<UILayout *>(GUIReader::shareReader()->widgetFromJsonFile("level_select_1.json"));
if(m_pLayout)
{
m_pLayout->setPosition(ccp(-200,0));
this->addChild(m_pLayout);
ActionObject* act = NULL;
act = ActionManager::shareManager()->getActionByName("level_select_1.json","texiao");
if(NULL != act)
act->play();
act = ActionManager::shareManager()->getActionByName("level_select_1.json","shuibodonghua");
if(NULL != act)
act->play();
}
}
else
{
//ActionManager::shareManager()->stopAllActionByJson("level_select_1.json");
//ActionManager::shareManager()->stopAllActionByJson("level_select.json");
ActionObject* act = NULL;
act = ActionManager::shareManager()->getActionByName("level_select_1.json","texiao");
if(NULL != act)
act->stop();
act = ActionManager::shareManager()->getActionByName("level_select_1.json","shuibodonghua");
if(NULL != act)
act->stop();
ActionManager::shareManager()->releaseActions();
if(m_pLayout)
{
m_pLayout->removeFromParent();
m_pLayout = NULL;
}
//CCTextureCache::sharedTextureCache()->removeUnusedTextures();
}
g_layoutcnt++;
}
示例2: playActionByName
ActionObject* ActionManagerEx::playActionByName(const char* jsonName,const char* actionName, CallFunc* func)
{
ActionObject* action = getActionByName(jsonName,actionName);
if (action)
{
action->play(func);
}
return action;
}
示例3: playActionByName
ActionObject* ActionManager::playActionByName(const char* jsonName,const char* actionName)
{
ActionObject* action = getActionByName(jsonName,actionName);
if (action)
{
action->play();
}
return action;
}
示例4: delayAnimation
void AheadChapter::delayAnimation()
{
ActionObject *action = ActionManager::shareManager()->getActionByName("AheadChapterUI.ExportJson", "map_animation");
if (action != NULL)
{
EffectSoundPlayController *effectSound = EffectSoundPlayController::create();
effectSound->setEffect(PULL_EFFECT, 0, 0, 0.5);
this->addChild(effectSound);
action->play();
}
}
示例5: onEnterTransitionDidFinish
void AheadChapter::onEnterTransitionDidFinish()
{
//播放动作
ActionObject *action = ActionManager::shareManager()->getActionByName("AheadChapterUI.ExportJson", "title_panel_animation");
if (action != NULL)
{
EffectSoundPlayController *effectSound = EffectSoundPlayController::create();
effectSound->setEffect(DU_EFFECT, 1, 0.9, 0.1);
this->addChild(effectSound);
action->play();
}
this->scheduleOnce(schedule_selector(AheadChapter::delayAnimation), 1.2);
}
示例6: init
// on "init" you need to initialize your instance
bool HelloWorld::init()
{
m_pLayout = NULL;
//////////////////////////////
// 1. super init first
if ( !CCLayer::init() )
{
return false;
}
CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
/////////////////////////////
// 2. add a menu item with "X" image, which is clicked to quit the program
// you may modify it.
// add a "close" icon to exit the progress. it's an autorelease object
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
this,
menu_selector(HelloWorld::menuCloseCallback));
pCloseItem->setPosition(ccp(origin.x + visibleSize.width - pCloseItem->getContentSize().width/2 ,
origin.y + pCloseItem->getContentSize().height/2));
// create menu, it's an autorelease object
CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
pMenu->setPosition(CCPointZero);
this->addChild(pMenu, 1);
/////////////////////////////
// 3. add your codes below...
// add a label shows "Hello World"
// create and initialize a label
//CCLabelTTF* pLabel = CCLabelTTF::create("Hello World", "Arial", TITLE_FONT_SIZE);
//
//// position the label on the center of the screen
//pLabel->setPosition(ccp(origin.x + visibleSize.width/2,
// origin.y + visibleSize.height - pLabel->getContentSize().height));
//// add the label as a child to this layer
//this->addChild(pLabel, 1);
//// add "HelloWorld" splash screen"
//CCSprite* pSprite = CCSprite::create("HelloWorld.png");
//// position the sprite on the center of the screen
//pSprite->setPosition(ccp(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y));
//// add the sprite as a child to this layer
//this->addChild(pSprite, 0);
Layout *pLayout = dynamic_cast<UILayout *>(GUIReader::shareReader()->widgetFromJsonFile("level_select.json"));
if(pLayout)
{
pLayout->setPosition(ccp(-200,0));
this->addChild(pLayout);
ActionObject* act = NULL;
act = ActionManager::shareManager()->getActionByName("level_select.json","texiao");
if(NULL != act)
act->play();
act = ActionManager::shareManager()->getActionByName("level_select.json","shuibodonghua");
if(NULL != act)
act->play();
}
return true;
}