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


C++ CButton::runAction方法代码示例

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


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

示例1: heroCall

void CSharpTollgate::heroCall(CCNode* pNode)
{
	CTableViewCell *node = (CTableViewCell*)pNode;
	CButton *btn = (CButton*)node->getChildByTag(1);
	//人物会动
	CCScaleTo *tobig = CCScaleTo::create(0.55f,1.0*btn->getScaleX(),1.0*btn->getScaleY());
	CCScaleTo *toSmall = CCScaleTo::create(0.55f,0.96*btn->getScaleX(), 0.96*btn->getScaleY());
	btn->runAction(CCRepeatForever::create(CCSequence::create(toSmall,tobig,nullptr)));
}
开发者ID:54993306,项目名称:Classes,代码行数:9,代码来源:SharpTollgate.cpp

示例2: checkShowActivity

void CMainCityUI::checkShowActivity( CCObject* pObj )
{
	if(DataCenter::sharedData()->getUser()->getUserData()->getFirstLogin())
	{
		CButton *btn = (CButton*)m_ui->getChildByTag(Activity_Btn);
		btn->runAction(CCCallFuncN::create(this, callfuncN_selector(CMainCityUI::onTimeWaitCityAction)));
		DataCenter::sharedData()->getUser()->getUserData()->setFirstLogin(false);
	}
}
开发者ID:54993306,项目名称:Classes,代码行数:9,代码来源:mainCityUI.cpp

示例3: initLogin

void LoginLayerUC::initLogin()
{
	CCLOG("LoginLayerUC::initLogin");

	if(m_ui!=nullptr)
	{
		return;
	}

	//播放背景音乐
	PlayBackgroundMusic(BGM_Login,true);

	m_ui = LoadComponent("EnterGameUC.xaml");
	m_ui->setTag(1);
	m_ui->setPosition(VCENTER);
	m_LayoutRoot->addChild(m_ui, 2);

	//自己的登陆框隐藏
	m_pLoginLay = (CLayout *)m_ui->getChildByTag(10);
	m_pLoginLay->setVisible(false);

	//选择好的服务器列表
	m_pCurrentServerUI = (CLayout *)m_ui->findWidgetById("current_server");
	m_pCurrentServerUI->setVisible(true);


	//默认服务器
	updateSelectServer();

	//服务器选区
	CLayout* pLayout = (CLayout*)m_ui->findWidgetById("serverCell");
	pLayout->retain();
	m_ui->removeChild(pLayout);
	m_pCell = pLayout;

	//获取空的滑动列表Scroll
	m_pTableView = (CTableView*)m_ui->findWidgetById("serverScroll");
	m_pTableView->setDirection(eScrollViewDirectionVertical);
	m_pTableView->setSizeOfCell(m_pCell->getContentSize());
	m_pTableView->setCountOfCell(m_serverInfo.server_list().size());
	m_pTableView->setBounceable(true);
	m_pTableView->setDataSourceAdapter(this, ccw_datasource_adapter_selector(LoginLayerUC::tableviewDataSource));
	m_pTableView->reloadData();


	//按钮打开服务器列表
	CImageView* pBtnServer = (CImageView*)m_ui->findWidgetById("serverBtn");


	//快速登录按钮
	CButton * pQuickLogin = (CButton *)m_ui->getChildByTag(1);
	pQuickLogin->setOnClickListener(this,ccw_click_selector(LoginLayerUC::onQuickLogin));
	CCActionInterval *scaleSmall = CCScaleTo::create(0.9f,0.98f);
	CCFadeTo *out = CCFadeTo::create(0.9f,60);
	CCSpawn *spawn = CCSpawn::createWithTwoActions(scaleSmall,out);
	CCActionInterval *scaleBig = CCScaleTo::create(1.2f,1.0f);
	CCFadeTo *in = CCFadeTo::create(1.2f,255);
	CCSpawn *spawn1 = CCSpawn::createWithTwoActions(scaleBig,in);
	CCSequence *seque = CCSequence::createWithTwoActions(spawn,spawn1);
	CCRepeatForever *action = CCRepeatForever::create(seque);
	pQuickLogin->runAction(action);
	pQuickLogin->setVisible(true);

	//清除用户信息
	DataCenter::sharedData()->getUser()->clear();

	//版本做相对位置处理
	CLabel* pLabel = (CLabel *)m_ui->findWidgetById("version");
	pLabel->setAnchorPoint(ccp(1.0f, 0.0f));
	pLabel->setPosition(ccp(VRIGHT-20, VBOTTOM+20));
	CC_SAFE_RETAIN(pLabel);
	pLabel->removeFromParentAndCleanup(true);
	this->addChild(pLabel);
	CC_SAFE_RELEASE(pLabel);
	pLabel->setString(CCString::createWithFormat("Version:%s", m_serverInfo.game_version().c_str())->getCString());


	//隐藏服务器列表
	showServerList();
	hideServerList();


	//TODO
	//初始化UC_SDK?-放在最前面
	//还是点击登录再初始化?
	//点击登录再初始化吧
	//初始化完直接请求登录


	//先连接连接服务器
	const Server& gameServer = m_serverInfo.server_list().Get(m_iSelectServerIndex);

	//检查服务器是否可用
	if(!checkServerStatus(gameServer))	
	{
		return;
	}

	LinkedGameServer(gameServer);
}
开发者ID:54993306,项目名称:Classes,代码行数:100,代码来源:LoginLayerUC.cpp

示例4: onEnter


//.........这里部分代码省略.........
	vip->setTouchEnabled(true);
	vip->setOnClickListener(this,ccw_click_selector(CMainCityUI::onVip));

	//添加签到,充值等其他入口
	CAccessLayer* pAccess = CAccessLayer::create();
	this->addChild(pAccess, 99);

	CSceneManager::sharedSceneManager()->addMsgObserver(UPDATE_HERO,this,GameMsghandler_selector(CMainCityUI::updateRoleProperty));
	CSceneManager::sharedSceneManager()->addMsgObserver(TASK_NOTICE,this,GameMsghandler_selector(CMainCityUI::updateTaskNotice));
	CSceneManager::sharedSceneManager()->addMsgObserver(MAIL_NOTICE,this,GameMsghandler_selector(CMainCityUI::updateMailNotice));
	CSceneManager::sharedSceneManager()->addMsgObserver(UPDATE_FUNCTIONOPEN,this,GameMsghandler_selector(CMainCityUI::updateFuctionOpen));
	CSceneManager::sharedSceneManager()->addMsgObserver(UPDATE_GAMETIP,this,GameMsghandler_selector(CMainCityUI::updateGameTip));
	CSceneManager::sharedSceneManager()->addMsgObserver(SHOW_HEAD,this,GameMsghandler_selector(CMainCityUI::showHead));

	CCSprite *red = (CCSprite*)(m_ui->findWidgetById("redPoint"));

	CCSprite *mailPoint = (CCSprite*)(m_ui->findWidgetById("mailPoint"));

	if (user->getRoleAction()<user->getActionLimit())
	{
		this->schedule(schedule_selector(CMainCityUI::updateActionTime),user->getInterval()*60);
	}
    GetTcpNet->registerMsgHandler(FriendReqNumMsg,this,CMsgHandler_selector(CMainCityUI::processNetMsg));
	GetTcpNet->registerMsgHandler(CBExchangeMsg,this,CMsgHandler_selector(CMainCityUI::exchangeMsg));

	//正在引导,不自动弹窗
	if(user->getNewStep()==2||user->getNewStep()==17/*CGuideManager::getInstance()->getIsRunGuide()*/)
	{
		DataCenter::sharedData()->setCityActionType(CA_None);
	}
	else if(user->getNewStep()<=0 || user->getNewStep()>=100)
	{
		//自动弹签到
		runAction(CCSequence::createWithTwoActions(CCDelayTime::create(0.7f), CCCallFunc::create(this, callfunc_selector(CMainCityUI::autoShowSign))));
	}

	switch (DataCenter::sharedData()->getCityActionType())
	{
	case CA_Levelup:
		{
			CButton *btn = (CButton*)m_ui->getChildByTag(HeroInfo_Btn);
			btn->runAction(CCSequence::create(CCDelayTime::create(0.6f),
				CCCallFuncN::create(this, callfuncN_selector(CMainCityUI::onTimeWaitCityAction)),
				NULL));
			DataCenter::sharedData()->setCityActionType(CA_None);
		}
		break;
	case CA_GoToChapater:
		{
			CButton *btn = (CButton*)m_ui->getChildByTag(Battle_Btn);
			btn->runAction(CCSequence::create(CCDelayTime::create(0.2f),
				CCCallFuncN::create(this, callfuncN_selector(CMainCityUI::onTimeWaitCityAction)),
				NULL));
			m_bShowChapterFlag = true;
			DataCenter::sharedData()->setCityActionType(CA_None);
		}
		break;
	case CA_GoToStage:
		{
			this->runAction(CCSequence::create(CCDelayTime::create(0.8f),
				CCCallFunc::create(this, callfunc_selector(CMainCityUI::runTollgatepreviewCallBack)),
				NULL));
			DataCenter::sharedData()->setCityActionType(CA_None);
		}break;
	default:
		break;
开发者ID:54993306,项目名称:Classes,代码行数:67,代码来源:mainCityUI.cpp


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