• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ callfuncND_selector函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: App42StorageResponse

void StorageService::DeleteDocumentsById(string dbName, string collectionName, string docId, CCObject* pTarget, cocos2d::SEL_CallFuncND pSelector)
{
    App42StorageResponse *response = new App42StorageResponse(pTarget,pSelector);
    
    try
    {
        Util::throwExceptionIfStringNullOrBlank(dbName, "Database Name");
        Util::throwExceptionIfStringNullOrBlank(collectionName, "Collection Name");
        Util::throwExceptionIfStringNullOrBlank(docId, "Doc ID");
        Util::throwExceptionIfTargetIsNull(pTarget, "Callback's Target");
        Util::throwExceptionIfCallBackIsNull(pSelector, "Callback");
    }
    catch (App42Exception *e)
    {
        std::string ex = e->what();
        response->httpErrorCode = e->getHttpErrorCode();
        response->appErrorCode  = e->getAppErrorCode();
        response->errorDetails  = ex;
        response->isSuccess = false;
        if (pTarget && pSelector)
        {
            (pTarget->*pSelector)((cocos2d::CCNode *)pTarget, response);
        }
        delete e;
        e = NULL;
        return;
    }
    
    string resource = "storage/deleteDocById/dbName/";
	resource.append(dbName+ "/collectionName/");
	resource.append(collectionName+ "/docId/");
	resource.append(docId);
    
	string url = getBaseUrl(resource);
	string timestamp = Util::getTimeStamp();
    
    map<string, string> getMap;
	Util::BuildGetSigningMap(apiKey, timestamp, VERSION, getMap);
    getMap["dbName"] = dbName;
    getMap["collectionName"] = collectionName;
    getMap["docId"] = docId;
	string signature = Util::signMap(secretKey, getMap);
    url.append("?");
    
    std::vector<std::string> headers;
    map<string, string> metaHeaders;
    populateMetaHeaderParams(metaHeaders);
    Util::BuildHeaders(metaHeaders, headers);
    
    Util::BuildHeaders(apiKey, timestamp, VERSION, signature, headers);
    
    Util::executeDelete(url,headers, response, callfuncND_selector(App42StorageResponse::onComplete));
    
}
开发者ID:asmodehn,项目名称:App42_Cocos2DX_SDK,代码行数:54,代码来源:StorageService.cpp


示例2: HS_GET_BattleLayer

void HSBalloonSprite::PlayDestroyBalloonEffect()
{
	this->setVisible(false);

	CCParticleSystemQuad* pParticle = CCParticleSystemQuad::create("Particle/DestroyBalloon.plist");
	pParticle->setPosition(m_destroyPos);
	HS_GET_BattleLayer()->addChild(pParticle,1100);
	CCDelayTime* pDelayTime = CCDelayTime::create(1.f);
	CCCallFuncND* pCall_01 = CCCallFuncND::create(this,callfuncND_selector(HSBalloonSprite::Call_PlayDestroyBalloonEffect),NULL);
	
	pParticle->runAction(CCSequence::create(pDelayTime,pCall_01,NULL));
}
开发者ID:wanggan768q,项目名称:GameWork,代码行数:12,代码来源:HSBalloonSprite.cpp


示例3: callfuncND_selector

void CJMultimedia::playEffectWithDelay(CCNode* sender, std::string fileName, float delay)
{
    if (delay != 0) {
        
        sender->runAction(CCSequence::create(CCDelayTime::create(delay),
                                             CCCallFuncND::create(sender, callfuncND_selector(CJMultimedia::_playEffectWithDelayCallfunc),new CCString(fileName)),
                                             NULL));
    }
    else{
        playEffect(fileName);
    }
}
开发者ID:JeonJonguk,项目名称:e002_c010,代码行数:12,代码来源:CJMultimedia.cpp


示例4: memcpy

void RCDataCenter::handleMessage(void* data, int length)
{
    RCDataNode* dataNode = RCDataNode::create();
    dataNode->retain();
    
    memcpy(dataNode->getMessageStruct(), data, length);
    dataNode->setDataLength(length);
    
    CCCallFuncND* callback = CCCallFuncND::create(this, callfuncND_selector(RCDataCenter::processMessage), dataNode);
    CCFiniteTimeAction* seq = CCSequence::create(CCDelayTime::create(PROCESS_MESSAGE_DELAY), callback, NULL);
    CCDirector::sharedDirector()->getRunningScene()->runAction(seq);
}
开发者ID:ryanflees,项目名称:TileMapDemo,代码行数:12,代码来源:RCDataCenter.cpp


示例5: callfuncND_selector

void ChessBoard::ccTouchesMoved(CCSet *pTouches, CCEvent *pEvent)
{
	CCPoint pos;
	CCSetIterator i;
	CCTouch* touch;
	ChessBall* sprite;

	_cancelling = true;

	if (_roundEnd)
	{
		return;
	}
	int count = _chessArray->count();

	for (i = pTouches->begin(); i != pTouches->end(); i++)
	{
		touch = (CCTouch*)(*i);
		if (touch != NULL)
		{
			pos = touch->getLocation();
			_pickedChess->setPositionX(pos.x);
			_pickedChess->setPositionY(pos.y + _chessYOffset);

			for (int j = 0; j < count; j++)
			{
				sprite = (ChessBall*)_chessArray->objectAtIndex(j);
				if (sprite->boundingBox().containsPoint(pos))
				{
				//	sprite->setOpacity(128);
					if (_activeCell->ball != NULL && _activeCell->ball != sprite)
					{
						CCMoveTo * move = CCMoveTo::create(0.1f, _activeCell->ball->getPosition());
						CCCallFuncND * end = CCCallFuncND::create(this, callfuncND_selector(ChessBoard::chessMoveEnd), _activeCell->ball);
						CCAction * action = CCSequence::create(move, end,NULL);
						_moveChess->setVisible(true);
						_moveChess->setChessProperty(sprite->getChessProperty());
						_moveChess->setPosition(sprite->getPosition());
						_moveChess->runAction(action);

						_activeCell->ball->setOpacity(0);
						_activeCell->ball->setChessProperty(sprite->getChessProperty());

						_activeCell->ball = sprite;
						_activeCell->ball->setOpacity(128);
						_activeCell->ball->setChessProperty(_pickedChess->getChessProperty());
					}
				}
			}
		}
	}
	
}
开发者ID:luozhonghai,项目名称:puzzle,代码行数:53,代码来源:ChessBoard.cpp


示例6: ceil

void ChatFacingDialog::init(int dummy)
{
    float fw,fh,iw,ih;
    int colnum,rownum;
    fw = fh = 80;
    iw = ih = 60;
    UiThemeDef *uiDef = UiThemeMgrProxy::getInstance()->getThemeByName(m_theme);
    const std::vector<std::string> &hasFacing = uiDef->getFacing();

    CCSize winSize = CCDirector::sharedDirector()->getWinSize();
    colnum = winSize.width / (fw + 2);
    m_size.width = winSize.width;
    rownum = ceil(hasFacing.size() * 1.0 / colnum);
    m_size.height = rownum * (fh + 2);

    setWidth(m_size.width);
    setHeight(m_size.height);
    int index = 0;
    std::string facebg;
    uiDef->getNormalData()->getImg(m_facingBg,facebg);
    for(int i = 0;i < rownum;i++){
        for(int k = 0;k < colnum;k++,index++){
            if(index >= hasFacing.size())
                break;
            const std::string &name = hasFacing[index];
            std::string firstFrame = name;
            if(UiThemeMgrProxy::getInstance()->getThemeMgr()->getFrameSpriteFirstFrame(firstFrame)){
                CCSprite *bg = CCSprite::createWithSpriteFrameName(facebg.data());
                CCSprite *frame = CCSprite::createWithSpriteFrameName(firstFrame.data());
                CCSize bgsize = bg->getContentSize();
                bg->addChild(frame);
                frame->setAnchorPoint(ccp(0.5,0.5));
                frame->setPosition(ccp(bgsize.width/2,bgsize.height/2));
                CCSize fsize = frame->getContentSize();
                frame->setScaleX(iw / fsize.width);
                frame->setScaleY(ih / fsize.height);
                BasButton *button = new BasButton;
                button->setName(name);
                button->setButtonInfo("","","",CCSizeMake(fw,fh));
                button->setClickCB(this,callfuncND_selector(ChatFacingDialog::onFaceClicked));
                this->addChild(button);
                button->CCNode::addChild(bg);
                bg->setAnchorPoint(ccp(0.5,0.5));
                bg->setPosition(ccp(fw/2,fh/2));
                button->setHorizontal("parent",(2*k + 1) * 1.0 / (colnum * 2));
                button->setVertical("parent",(2*i + 1) * 1.0 / (rownum * 2));
            }
        }
    }
    layout(true);
    setAnchorPoint(ccp(0,0));
    setPosition(ccp(0,m_pos.y));
}
开发者ID:firedragonpzy,项目名称:DirectFire-android,代码行数:53,代码来源:chatfacingdialog.cpp


示例7: CCHttpRequest

void HttpClientTest::onMenuPostTestClicked(cocos2d::CCObject *sender)
{
    // test 1
    {
        CCHttpRequest* request = new CCHttpRequest();
        request->setUrl("http://www.httpbin.org/post");
        request->setRequestType(CCHttpRequest::kHttpPost);
        request->setResponseCallback(this, callfuncND_selector(HttpClientTest::onHttpRequestCompleted));
        
        // write the post data
        const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest";
        request->setRequestData(postData, strlen(postData)); 
        
        request->setTag("POST test1");
        CCHttpClient::getInstance()->send(request);
        request->release();
    }
    
    // test 2: set Content-Type
    {
        CCHttpRequest* request = new CCHttpRequest();
        request->setUrl("http://www.httpbin.org/post");
        request->setRequestType(CCHttpRequest::kHttpPost);
        std::vector<std::string> headers;
        headers.push_back("Content-Type: application/json; charset=utf-8");
        request->setHeaders(headers);
        request->setResponseCallback(this, callfuncND_selector(HttpClientTest::onHttpRequestCompleted));
        
        // write the post data
        const char* postData = "visitor=cocos2d&TestSuite=Extensions Test/NetworkTest";
        request->setRequestData(postData, strlen(postData)); 
        
        request->setTag("POST test2");
        CCHttpClient::getInstance()->send(request);
        request->release();
    }
    
    // waiting
    m_labelStatusCode->setString("waiting...");
}
开发者ID:louhao,项目名称:iWAgame,代码行数:40,代码来源:HttpClientTest.cpp


示例8: catch

void RewardService::CreateReward(string rewardName,string description, cocos2d::CCObject* pTarget, cocos2d::SEL_CallFuncND pSelector)
{
    
    App42RewardResponse *response = new App42RewardResponse::App42RewardResponse(pTarget,pSelector);
    
    try
    {
        Util::throwExceptionIfStringNullOrBlank(description, "Description");
        Util::throwExceptionIfStringNullOrBlank(rewardName, "Reward Name");
        Util::throwExceptionIfTargetIsNull(pTarget, "Callback's Target");
        Util::throwExceptionIfCallBackIsNull(pSelector, "Callback");
    }
    catch (App42Exception *e)
    {
        std::string ex = e->what();
        response->httpErrorCode = e->getHttpErrorCode();
        response->appErrorCode  = e->getAppErrorCode();
        response->errorDetails  = ex;
        response->isSuccess = false;
        if (pTarget && pSelector)
        {
            (pTarget->*pSelector)((cocos2d::CCNode *)pTarget, response);
        }
        delete e;
        e = NULL;
        return;
    }

    
    map<string, string> postMap;
    populateSignParams(postMap);
    string rewardbody = BuildCreateRewardBody(rewardName, description);
    postMap["body"] = rewardbody;
    
    string signature = Util::signMap(secretKey, postMap);
    
    string baseUrl = getBaseUrl("game/reward");
    baseUrl.append("?");
    //Util::app42Trace("\n baseUrl = %s",baseUrl.c_str());
    //Util::app42Trace("\n createRewardbody = %s",rewardbody.c_str());
    
    std::vector<std::string> headers;
    map<string, string> metaHeaders;
    populateMetaHeaderParams(metaHeaders);
    Util::BuildHeaders(metaHeaders, headers);
    
    string timestamp = Util::getTimeStamp();
    Util::BuildHeaders(apiKey, timestamp, VERSION, signature, headers);
    
    Util::executePost(baseUrl, headers, rewardbody.c_str(), response, callfuncND_selector(App42RewardResponse::onComplete));
    
}
开发者ID:asmodehn,项目名称:App42_Cocos2DX_SDK,代码行数:52,代码来源:RewardService.cpp


示例9: CCHttpRequest

void GameState::sendGetHttp(CCObject* sender)
{
	CCHttpRequest* request = new CCHttpRequest();
	request->setUrl("http://deploydjango1.herokuapp.com/?text=32");

	request->setRequestType(CCHttpRequest::kHttpGet);

	CCHttpClient::getInstance()->send(request); //보내고 나서

	request->setResponseCallback(this,callfuncND_selector(GameState::onHttpRequestCompleted));//받습니다

	request->release();
}
开发者ID:CicadaKim,项目名称:ZombieHunter,代码行数:13,代码来源:GameState.cpp


示例10: callfuncND_selector

void MoreDiamondDialog::shareCallback( CCObject* pSender )
{
	PLAY_BUTTON_EFFECT;

	bool isLogIn = DataManager::sharedDataManager()->GetFbIsLogIn();
	if (isLogIn)
	{
		NDKHelper::AddSelector("MoreDiamondDialog",
			"onPublishFeedCompleted",
			callfuncND_selector(MoreDiamondDialog::onPublishFeedCompleted),
			this);

		string message = "Game này được, có bạn chơi cùng thì khỏi chê!";
		string name = "The Croods";
		string caption = "Thánh thức cùng bạn bè";
		string description = "Game hay, thuộc thể loại này nọ...";
		string picture = "http://vfossa.vn/tailen/news/2012_01/knowledge.jpg";
		string link = "https://play.google.com/store/apps/details?id=com.supercell.hayday";

		CCDictionary* prms = CCDictionary::create();
		prms->setObject(CCString::create(message), "message");
		prms->setObject(CCString::create(name), "name");
		prms->setObject(CCString::create(caption), "caption");
		prms->setObject(CCString::create(description), "description");
		prms->setObject(CCString::create(picture), "picture");
		prms->setObject(CCString::create(link), "link");

		SendMessageWithParams(string("PublishFeed"), prms);
	} 
	else
	{
		m_curOperator = string("share");
		NDKHelper::AddSelector("MoreDiamondDialog",
			"onLogInCompleted",
			callfuncND_selector(MoreDiamondDialog::onLogInCompleted),
			this);
		SendMessageWithParams(string("LogIn"), NULL);
	}	
}
开发者ID:doanhtdpl,项目名称:dau-truong-tri-thuc,代码行数:39,代码来源:MoreDiamondDialog.cpp


示例11: while

void HallPage::onSendMsgClicked()
{
    if(m_sendMsgDialog != 0){
        m_sendMsgDialog->destroy();
        m_sendMsgDialog = 0;
    }
    CCNode *root = this->getParent();
    while(root->getParent())
        root = root->getParent();
    if(m_sendMsgDialog == 0){
        m_sendMsgDialog = new SendMsgDialog(root,ccc4(0,0,0,128));
        m_sendMsgDialog->setCloseCB(this,callfuncND_selector(HallPage::onSendMsgCloseClicked));
        m_sendMsgDialog->setSendCB(this,callfuncND_selector(HallPage::onSendMsgSendClicked));
        m_sendMsgDialog->setInitShowPage(true);
        m_sendMsgDialog->setInitPage(true,false);
        std::string name = m_headNick;
        if(name.empty())
            mailToNickName(m_headMail,name);
        m_sendMsgDialog->setRecInfo(m_headId,name,"");
        m_sendMsgDialog->exec();
    }
}
开发者ID:firedragonpzy,项目名称:DirectFire-android,代码行数:22,代码来源:hallpage.cpp


示例12: CCLOG

void Room_Manager::Request_RoomUpdate(Room_Callback *del)
{
    if(curMatchRoom == NULL)
    {
        CCLOG("CurRoom = NULL");
        if(callBack != NULL) callBack->Callback_RoomUpdate();
    }
    
    callBack = del;
    
    WebRequest_RoomInfo(this, callfuncND_selector(Room_Manager::onHttpRequestCompleted_RoomUpdate), "Post RoomUpdate",
                        curMatchRoom->user_ID->getCString(), curMatchRoom->other_user_ID->getCString(), curMatchRoom->room_Index);
}
开发者ID:JongKul,项目名称:Infinity,代码行数:13,代码来源:Room_Manager.cpp


示例13: CCLOG

void MoreDiamondDialog::onGetProfileCompleted( CCNode *sender, void *data )
{
	CCLOG("onGetProfileCompleted");
	if (data != NULL)
	{
		CCDictionary *convertedData = (CCDictionary *)data;
		CCString* s = (CCString*)convertedData->objectForKey("isSuccess");
		if (s->boolValue())
		{
			CCLOG("CPP Get Profile Completed: TRUE");

			string fbId = ((CCString*)convertedData->objectForKey("id"))->getCString();
			string firstName = ((CCString*)convertedData->objectForKey("firstName"))->getCString();
			string name = ((CCString*)convertedData->objectForKey("name"))->getCString();
			string username = ((CCString*)convertedData->objectForKey("username"))->getCString();
			string birthday = ((CCString*)convertedData->objectForKey("birthday"))->getCString();
			string picture50x50 = ((CCString*)convertedData->objectForKey("picture"))->getCString();

			//save

			DataManager::sharedDataManager()->SetFbID(fbId);
			DataManager::sharedDataManager()->SetFbFullName(name);
			DataManager::sharedDataManager()->SetName(name);
			DataManager::sharedDataManager()->SetFbUserName(username);

			//////////////////////////////////////////////////////////////////////////

			NDKHelper::AddSelector("MoreDiamondDialog",
				"onGetAvatarCompleted",
				callfuncND_selector(MoreDiamondDialog::onGetAvatarCompleted),
				this);

			string w = "128";
			string h = "128";

			CCDictionary* prms = CCDictionary::create();
			prms->setObject(CCString::create(fbId), "fbId");
			prms->setObject(CCString::create(w), "width");
			prms->setObject(CCString::create(h), "height");

			SendMessageWithParams(string("GetAvatar"), prms);
		} 
		else
		{
			CCLOG("CPP Get Profile Completed: FALSE");
			CCMessageBox("Không thể kết nối", "Lỗi");
		}

		NDKHelper::RemoveSelector("MoreDiamondDialog", "onGetProfileCompleted");
	}
}
开发者ID:doanhtdpl,项目名称:dau-truong-tri-thuc,代码行数:51,代码来源:MoreDiamondDialog.cpp


示例14: addChild

void RankScene::HeroLevelUpHTTP(int _HeroIndex,int _HeroLevel){
    
    MessageBox = AsMessageBox::createMessageBox("通信中,请稍候", 1, 0);
    MessageBox->setPosition(CCPointZero);
    addChild(MessageBox,1000);
    
    CCHttpRequest* request = new CCHttpRequest();
    string UrlData = "http://115.29.168.228/roles/" + int2string(_HeroIndex) + "?role[level]=" + int2string(_HeroLevel) + "&token=" + MainUser->UserTokenStr;
    request->setUrl(UrlData.c_str());
    request->setRequestType(CCHttpRequest::kHttpPut);
    request->setResponseCallback(this, callfuncND_selector(RankScene::HeroLevelUpRequestCompleted));
    CCHttpClient::getInstance()->send(request);
    request->release();
}
开发者ID:nooboracle,项目名称:ForTest,代码行数:14,代码来源:LevelUpHeroHTTP.cpp


示例15: init

void ChatPhraseDialog::init(int dummy)
{
    UiThemeDef *uiDef = UiThemeMgrProxy::getInstance()->getThemeByName(m_theme);
    m_hasPhrases = uiDef->getPhrase();
    CCSize winSize = CCDirector::sharedDirector()->getWinSize();
    float pw,ph;
    pw = ph = 0;
    std::vector<BasButton *> buttons;
    CCSize size;
    size.width = winSize.width;
    size.height = 40;
    for(unsigned int i = 0;i < m_hasPhrases.size();i++){
        BasButton *button = new BasButton;
        button->setButtonInfo("","","",size);
        button->setButtonIndex(i);
        button->setClickCB(this,callfuncND_selector(ChatPhraseDialog::onPhraseClicked));
        buttons.push_back(button);
        this->addChild(button);
        button->setLeftMargin(6);
        button->setRightMargin(6);
        ph += size.height;
        if(pw < size.width)
            pw = size.width;
        BasLabel *label = new BasLabel();
        label->setLabelInfo(m_hasPhrases[i],"","",CCSizeMake(0,0));
        button->addChild(label);
        label->setLeft("parent",uilib::Left);
        label->setVertical("parent",0.5);
    }
    setWidth(winSize.width);
    setHeight(ph);
    std::string topName;
    for(unsigned int i = 0;i < buttons.size();i++){
        BasButton *button = buttons[i];
        if(topName.empty()){
            button->setLeft("parent",uilib::Left);
            button->setRight("parent",uilib::Right);
            button->setTop("parent",uilib::Top);
        }else{
            button->setLeft("parent",uilib::Left);
            button->setRight("parent",uilib::Right);
            button->setTop(topName,uilib::Bottom);
        }
        topName = button->getName();
    }
    layout(true);
    setAnchorPoint(ccp(0,0));
    setPosition(ccp(0,m_pos.y));
}
开发者ID:firedragonpzy,项目名称:DirectFire-android,代码行数:49,代码来源:chatphrasedialog.cpp


示例16: callfuncND_selector

void FightLayer::playKOAnimation()
{
    atkNumber->setVisible(false);
    
    CCAnimation* pAnimation = AnimationManager::shareInstance()->getAnimationWithName(str_atk_ko);
    CCAnimate* pAnimate = CCAnimate::create(pAnimation);
    CCAction* pAct = CCCallFuncND::create(this, callfuncND_selector(FightLayer::koDidFinished), NULL);
    CCSprite* spr = CCSprite::create("3001.png");
    spr->setAnchorPoint( ccp(0.5f, 0.5f) );
    spr->setPosition( ccp(0, 0) );
    this->addChild(spr);
    spr->runAction(CCSequence::create(pAnimate, pAct, NULL));
    
    GameSoundManager::shareManager()->playKOEffect();
}
开发者ID:zhouxj6112,项目名称:HelloWorld-cocos2d-x-2.2.3,代码行数:15,代码来源:FightLayer.cpp


示例17: SAttackType

//-----------------------------------------------
//
//
void CPet::upMainData( ccTime dt )
{
	if( CPET_STATE_DISTANCE_ATTACK == m_iState )
	{
		//int index = GetCurentIndex();
		CBaseDataPet* pDataPet = g_pClientLoader->GetBaseDataPetFromId(m_PetData.petid);
		CBaseDataSkill* pDataSkill = g_pClientLoader->GetBaseDataSkillFromId(pDataPet->skillfield[m_PetData.skilllevel.skillsLevel[0]-1]);

		if( pDataSkill->attack_frame <= GetCurentIndex())
		{
			CCMoveTo *to1 = CCMoveTo::actionWithDuration( 1.0f, m_pLockTarget->getPosition() );

			SAttackType *pAttackType = new SAttackType();
			pAttackType->Type = 1;
			CCFiniteTimeAction *pCallBack = CCCallFuncND::actionWithTarget( this, callfuncND_selector( CPet::AttackBeginCallBack ), pAttackType );

			std::string effectpath = GetGameParticlePath();
			std::string filename = effectpath + pDataSkill->plist.c_str();
			CCParticleSystemQuad *pEmitter = CCParticleSystemQuad::particleWithFile( filename.c_str() );
			//panda
            if( m_PetData.petid >= 41 && m_PetData.petid <= 50 )
            {
                pEmitter->setPositionType( kCCPositionTypeGrouped );
            }
			if( FIGHT_LEFT_PLAYER_POS == m_iSitId )
			{
				pEmitter->setPosition( ccp( getPosition().x + 32, getPosition().y ) );
			}
			else
			{
				pEmitter->setPosition( ccp( getPosition().x - 16, getPosition().y ) );
			}
            
            if( CCUserDefault::sharedUserDefault()->getBoolForKey( "sound" ) )
            {
                string path = "data/audio/" + pDataSkill->skill_sound;
                CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect(path.c_str(), false);
            }
            
			CCPoint pos = getPosition();
			g_pFightGroundLayer->addChild( pEmitter, 100, FIRE_BALL_TAG );

			pEmitter->runAction( CCSequence::actions( to1, pCallBack, NULL ) );

			m_iState = CPET_STATE_NONE;
		}
	}
}
开发者ID:JoeHu,项目名称:magicpet,代码行数:51,代码来源:CPet.cpp


示例18: callfuncND_selector

void Puzzle::lowerBlocks(CCNode* sender, void* pData)
{
	Puzzle *p = (Puzzle *)pData;
	
	//remove cells from layer
	for (int i = 0; i < p->numsprites; i++)
	{
		p->layer->removeChild(p->cell[i], false);
	}
	
	//schedule next cells
	CCFiniteTimeAction *scheduled_action = CCSequence::actions(CCDelayTime::actionWithDuration(((Puzzle *)pData)->t_raise - ((Puzzle *)pData)->t_duration),
															   CCCallFuncND::actionWithTarget(((Puzzle *)pData)->layer, callfuncND_selector(Puzzle::raiseBlocks), pData),
															   NULL);
	((Puzzle *)pData)->layer->runAction(scheduled_action);
}
开发者ID:themoonlitknight,项目名称:PuzzleGuess,代码行数:16,代码来源:Puzzle.cpp


示例19: callfuncND_selector

void EnemyLayer::enemy1Blowup(Enemy* enemy1)
{
	auto sp1 = CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("enemy1_down1.png");
	auto sp2 = CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("enemy1_down2.png");
	auto sp3 = CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("enemy1_down3.png");
	auto animation = CCAnimation::create();
	animation->setDelayPerUnit(0.2f);  
	animation->addSpriteFrame(sp1);  
	animation->addSpriteFrame(sp2);
	animation->addSpriteFrame(sp3);
	CCAnimate* animate = CCAnimate::create(animation); 
	//CCCallFuncND可以回调一个带两个参数的方法,这个参数为消息发送者和自定义附带消息
	auto removeEnemy1 = CCCallFuncND::create(this, callfuncND_selector(EnemyLayer::enemy1Remove), (void*)enemy1);
	auto sequence = CCSequence::create(animate, removeEnemy1, NULL);
	enemy1->getSprite()->runAction(sequence);
}
开发者ID:rzzz,项目名称:cocosAirPlane,代码行数:16,代码来源:EnemyLayer.cpp


示例20: CCLOG

bool QuestionLayer::init()
{
    if (!CCLayer::init()) {
        return false;
    }

    timerTotal = 12;
    rightAnswer = 0;
    errorAnswer = 0;
    rightLimit = 0;
    serialNo = 0;
    CCLOG("queType:%d", queType);

    if (is_realy_fight == false) {
        number_in_group = 1;
    } else {
        number_in_group = 5;
    }

    CCSize size = this->getContentSize();

    //开始显示题型
    const char* str = NULL;
    if (queType == SingleQuestion) {
        str = "单选题";
        timerTotal = 15;
    } else if (queType == JudgeQuestion) {
        str = "判断题";
        timerTotal = 12;
    } else {
        str = "多选题";
        timerTotal = 30;
    }
    CCLabelTTF* ttf = CCLabelTTF::create(str, "STHeitiK-Medium", 36);
    ttf->setAnchorPoint(ccp(0.5f, 0.5f));
    ttf->setPosition(ccp(0, 120));
    this->addChild(ttf, 0, 1234);
    CCScaleTo* scaleTo = CCScaleTo::create(1.0f, 2.0f);
    CCAction* pAction = CCCallFuncND::create(this, callfuncND_selector(QuestionLayer::start), NULL);
    ttf->runAction(CCSequence::create(scaleTo, pAction, NULL));

//    GameSoundManager::shareManager()->playReadyGoEffect();

    isAnswerFinished = false;

    return true;
}
开发者ID:zhouxj6112,项目名称:HelloWorld-cocos2d-x-2.2.3,代码行数:47,代码来源:QuestionLayer.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ callfuncN_selector函数代码示例发布时间:2022-05-30
下一篇:
C++ callee函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap