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


C++ ActionObject类代码示例

本文整理汇总了C++中ActionObject的典型用法代码示例。如果您正苦于以下问题:C++ ActionObject类的具体用法?C++ ActionObject怎么用?C++ ActionObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ActionObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: new

 void ActionManagerEx::initWithBinary(const char* file,
                                      cocos2d::Ref *root,
                                      CocoLoader* cocoLoader,
                                      stExpCocoNode*	pCocoNode)
 {
     std::string path = file;
     ssize_t pos = path.find_last_of("/");
     std::string fileName = path.substr(pos+1,path.length());
     cocos2d::Vector<ActionObject*> actionList;
     
     stExpCocoNode *stChildArray = pCocoNode->GetChildArray(cocoLoader);
     stExpCocoNode *actionNode = nullptr;
     for (int i=0; i < pCocoNode->GetChildNum(); ++i) {
         std::string key = stChildArray[i].GetName(cocoLoader);
         if (key == "actionlist") {
             actionNode = &stChildArray[i];
             break;
         }
     }
     if (nullptr != actionNode)
     {
         int actionCount = actionNode->GetChildNum();
         for (int i = 0; i < actionCount; ++i) {
             ActionObject* action = new (std::nothrow) ActionObject();
             action->autorelease();
             
             action->initWithBinary(cocoLoader, &actionNode->GetChildArray(cocoLoader)[i], root);
             
             actionList.pushBack(action);
         }
     }
     _actionDic[fileName] = actionList;
     
 }
开发者ID:114393824,项目名称:Cocos2dxShader,代码行数:34,代码来源:CCActionManagerEx.cpp

示例2: getActionByName

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: while

BOOL CCalculator::CompareDocs(CMCPforNTDoc* pDoc1,CMCPforNTDoc* pDoc2)
{
	BOOL EQUAL = TRUE;
	CString TheObject1[100];
	CString TheObject2[100];
	USHORT	Channels1[100];
	USHORT	Channels2[100];
	USHORT i,j;

	POSITION pos;


	if(!pDoc1->ActionObjList.IsEmpty())
	{
		i=0;
		ActionObject* pActionObj = (ActionObject*)pDoc1->ActionObjList.GetHead();
		pos = pDoc1->ActionObjList.GetHeadPosition();
		do
		{
			pActionObj = (ActionObject*)pDoc1->ActionObjList.GetNext(pos);
			if (pActionObj!=NULL)
			{
				TheObject1[i]	= pActionObj->GetName();
				Channels1[i]	= pActionObj->pTrack->Channels;
				i++;
			}
		}
		while (pos!=NULL);
	}


	if(!pDoc2->ActionObjList.IsEmpty())
	{
		i=0;
		ActionObject* pActionObj = (ActionObject*)pDoc2->ActionObjList.GetHead();
		pos = pDoc2->ActionObjList.GetHeadPosition();
		do
		{
			pActionObj = (ActionObject*)pDoc2->ActionObjList.GetNext(pos);
			if (pActionObj!=NULL)
			{
				TheObject2[i]	= pActionObj->GetName();
				Channels2[i]	= pActionObj->pTrack->Channels;
				i++;
			}
		}
		while (pos!=NULL);
	}

	for(j=0;j<i;j++)
	{
		if((TheObject2[j]!=TheObject1[j])||
			(Channels2[j]!=Channels1[j]))
			EQUAL = FALSE;
	}
	return EQUAL;
}
开发者ID:skappert,项目名称:mcp,代码行数:57,代码来源:Calculator.cpp

示例4: getActionByName

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

示例5: 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

示例6: 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

示例7: releaseActions

void ActionManagerEx::releaseActions()
{
    for (auto& iter : _actionDic)
    {
        cocos2d::Vector<ActionObject*> objList = iter.second;
        ssize_t listCount = objList.size();
        for (ssize_t i = 0; i < listCount; i++) {
            ActionObject* action = objList.at(i);
            if (action != nullptr) {
                action->stop();
            }
        }
        objList.clear();
    }

    _actionDic.clear();
}
开发者ID:c0i,项目名称:cocos2dx-lite,代码行数:17,代码来源:CCActionManagerEx.cpp

示例8: releaseActions

void ActionManagerEx::releaseActions()
{
    std::unordered_map<std::string, cocos2d::Vector<ActionObject*>>::iterator iter;
    for (iter = _actionDic.begin(); iter != _actionDic.end(); iter++)
    {
        cocos2d::Vector<ActionObject*> objList = iter->second;
        ssize_t listCount = objList.size();
        for (ssize_t i = 0; i < listCount; i++) {
            ActionObject* action = objList.at(i);
            if (action != nullptr) {
                action->stop();
            }
        }
        objList.clear();
    }
    
    _actionDic.clear();
}
开发者ID:114393824,项目名称:Cocos2dxShader,代码行数:18,代码来源:CCActionManagerEx.cpp

示例9: getActionByName

ActionObject* ActionManagerEx::getActionByName(const char* jsonName,const char* actionName)
{
	auto iterator = _actionDic.find(jsonName);
	if (iterator == _actionDic.end())
	{
		return nullptr;
	}
	auto actionList = iterator->second;
	for (int i = 0; i < actionList.size(); i++)
	{
		ActionObject* action = actionList.at(i);
		if (strcmp(actionName, action->getName()) == 0)
		{
			return action;
		}
	}
	return nullptr;
}
开发者ID:ElvisQin,项目名称:genius-x,代码行数:18,代码来源:CCActionManagerEx.cpp

示例10: CCLOG

void ActionManager::initWithDictionary(const char* jsonName,cs::CSJsonDictionary *dic,CCObject* root)
{
	std::string path = jsonName;
	int pos = path.find_last_of("/");
	std::string fileName = path.substr(pos+1,path.length());
	CCLOG("filename == %s",fileName.c_str());
	CCArray* actionList = CCArray::create();
	int actionCount = DICTOOL->getArrayCount_json(dic, "actionlist");
    for (int i=0; i<actionCount; i++) {
        ActionObject* action = new ActionObject();
		action->autorelease();
        cs::CSJsonDictionary* actionDic = DICTOOL->getDictionaryFromArray_json(dic, "actionlist", i);
        action->initWithDictionary(actionDic,root);
        actionList->addObject(action);
		CC_SAFE_DELETE(actionDic);
    }
	m_pActionDic->setObject(actionList, fileName);
}
开发者ID:vincentRain,项目名称:cocos2d-x-qt-2,代码行数:18,代码来源:CCActionManager.cpp

示例11: _scal

double _scal( double x,... )
{
	POSITION pos;
	CString TheObject;
	double data = 0;
	BOOL FOUND = FALSE;
	double Track;
	CString TrackStr;
	va_list arg_ptr;
	va_start(arg_ptr,x);
	Track	= va_arg(arg_ptr,double);

	if(!pDocument->ActionObjList.IsEmpty())
	{
		ActionObject* pActionObj = (ActionObject*)pDocument->ActionObjList.GetHead();
		pos = pDocument->ActionObjList.GetHeadPosition();
		do
		{
			pActionObj = (ActionObject*)pDocument->ActionObjList.GetNext(pos);
			if (pActionObj!=NULL)
			{
				TheObject = pActionObj->GetName();
				if (TheObject.Find(__PM_SpectrumObj)!=-1)
				{
					PM_SpectrumObj* pScalerObj = (PM_SpectrumObj*)pActionObj;
					if ((pScalerObj->SubRegNo==(int)x)&&
						(pScalerObj->pTrack->MyPosition==(int)Track))
					{
						if(!EVALUATENEXT)data = pScalerObj->y[index];
						else data = pScalerObj->y[index]*(TheScan)/(TheScan-1);
						FOUND = TRUE;
					}
				}
			}
		}
		while ((pos!=NULL)&&(!FOUND));
	}
	return(data);
} 
开发者ID:skappert,项目名称:mcp,代码行数:39,代码来源:EVALUATE.CPP

示例12: PreTranslateMessage

BOOL CCalculator::PreTranslateMessage(MSG* pMsg) 
{
	{
		if (pMsg->message == WM_LBUTTONDBLCLK)
		{
			if(pDoc.GetCount()!=0)
			{
				CMCPforNTDoc* pHeadDoc = (CMCPforNTDoc*)pDoc.GetHead();
				if (!pHeadDoc->ActionObjList.IsEmpty())
				{
					ActionObject* pActionObj = 
						(ActionObject*)m_templview.GetItemData(GetSelectedItem());
					if ((pActionObj!= NULL)&&(pActionObj->SCALER))
					{
						pActionObj->DoDoubleClickAction();
					}
				}
			}
			return TRUE;
		}
	}
	return CDialog::PreTranslateMessage(pMsg);
}
开发者ID:skappert,项目名称:mcp,代码行数:23,代码来源:Calculator.cpp

示例13: 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

示例14: UpdateTree

void CCalculator::UpdateTree(CMCPforNTDoc* pDocument)
{
	int Image;
	int	Position = 0;
	CString TheObject;
	int Track=0;
	char TheString[50];
	POSITION pos;
	m_templview.DeleteAllItems();

	if(!pDocument->ActionObjList.IsEmpty())
	{
		ActionObject* pActionObj = (ActionObject*)pDocument->ActionObjList.GetHead();
		pos = pDocument->ActionObjList.GetHeadPosition();
		do
		{
			pActionObj = (ActionObject*)pDocument->ActionObjList.GetNext(pos);
			if (pActionObj!=NULL)
			{
				if (pActionObj->GetName().Find(_TrackObj)!=-1)
				{	
					++Track;
					m_templview.InsertItem(LVIF_TEXT|LVIF_IMAGE|LVIF_PARAM,Position,pActionObj->GetName(),0,0,2,(LPARAM)pActionObj);
					m_templview.SetItem(Position,1,LVIF_TEXT, pActionObj->GetInfo(),0,0,0,NULL);
				}
				else
				{
					if (pActionObj->TestHardware()) Image=0;
						else Image = 1;
	
					strcpy(TheString,(LPCSTR)TheObject);
					m_templview.InsertItem(LVIF_TEXT|LVIF_IMAGE|LVIF_PARAM,Position,pActionObj->GetName(),0,0,Image,(LPARAM)pActionObj);
					m_templview.SetItem(Position,1,LVIF_TEXT, pActionObj->GetInfo(),0,0,0,NULL);
				}
				
			}
			Position++;
		}
		while (pos!=NULL);
	}
}
开发者ID:skappert,项目名称:mcp,代码行数:41,代码来源:Calculator.cpp

示例15: menu_selector

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