当前位置: 首页>>代码示例>>C++>>正文


C++ ActionObject::play方法代码示例

本文整理汇总了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++;
}
开发者ID:Ryeeeeee,项目名称:Issue_Memory_Leak_v2.2.2,代码行数:55,代码来源:HelloWorldScene.cpp

示例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;
}
开发者ID:114393824,项目名称:Cocos2dxShader,代码行数:9,代码来源:CCActionManagerEx.cpp

示例3: playActionByName

ActionObject* ActionManager::playActionByName(const char* jsonName,const char* actionName)
{
	ActionObject* action = getActionByName(jsonName,actionName);
	if (action)
	{
		action->play();
	}
	return action;
}
开发者ID:vincentRain,项目名称:cocos2d-x-qt-2,代码行数:9,代码来源:CCActionManager.cpp

示例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();
    }
}
开发者ID:GHunique,项目名称:CrazyGeography1,代码行数:12,代码来源:AheadChapter.cpp

示例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);
}
开发者ID:GHunique,项目名称:CrazyGeography1,代码行数:16,代码来源:AheadChapter.cpp

示例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;
}
开发者ID:Ryeeeeee,项目名称:Issue_Memory_Leak_v2.2.2,代码行数:74,代码来源:HelloWorldScene.cpp


注:本文中的ActionObject::play方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。