本文整理汇总了C++中callfuncO_selector函数的典型用法代码示例。如果您正苦于以下问题:C++ callfuncO_selector函数的具体用法?C++ callfuncO_selector怎么用?C++ callfuncO_selector使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了callfuncO_selector函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: setTouchMode
void EquipInfoView::onEnter()
{
CCNode::onEnter();
setTouchMode(Touch::DispatchMode::ONE_BY_ONE);
setTouchEnabled(true);
//CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this, 1, false);
CCSafeNotificationCenter::sharedNotificationCenter()->addObserver(this, callfuncO_selector(EquipInfoView::refreashData), EQUIP_BAG_SHOW_DES, NULL);
if (m_isAni) {
playBombEff();
this->getAnimationManager()->runAnimations("FadeIn");
}
}
开发者ID:ourgames,项目名称:dc208,代码行数:13,代码来源:EquipInfoView.cpp
示例2: callfuncO_selector
void Light::setIsConnectToSwitch(bool bConnectToSwitch)
{
m_bConnected = bConnectToSwitch;
if (m_bConnected)
{
CCNotificationCenter::sharedNotificationCenter()->addObserver(this, callfuncO_selector(Light::switchStateChanged), MSG_SWITCH_STATE, NULL);
}
else
{
CCNotificationCenter::sharedNotificationCenter()->removeObserver(this, MSG_SWITCH_STATE);
}
updateLightState();
}
开发者ID:0309,项目名称:cocos2d-x,代码行数:13,代码来源:NotificationCenterTest.cpp
示例3: CCLOG
void MessageManager::sendStrenghtenInfoMessage(int pid,int petid,int typeids){
CSJson::FastWriter writer;
CSJson::Value root;
root["pid"]=pid;
root["petid"]=petid;
root["typeid"]=typeids;
std::string str=writer.write(root);
CCLOG("%s",str.c_str());
Message * msg= g_pSocket->constructMessage(str, CMID_STRENGTHPET);
CCNotificationCenter::sharedNotificationCenter()->addObserver(this, callfuncO_selector(MessageManager::receiveStrengthenInfoMessage), "1402", NULL);
g_pSocket->sendMessage_(msg, false);
}
开发者ID:9miao,项目名称:Pocket-Warriors,代码行数:13,代码来源:MessageManager.cpp
示例4: if
void ChuanqiduanzaoItem::menuItemClicked_DuanZao(CCObject* pObj)
{
int tag = ((CCMenuItem*)pObj)->getTag();
bool bShici = false;
if (tag == Tag_MenuItem_Yici) bShici = false;
else if(tag == Tag_MenuItem_Shici) bShici = true;
else return;
int profId = (int)((CCMenuItem*)pObj)->getUserData();
CCNotificationCenter::sharedNotificationCenter()->addObserver(this, callfuncO_selector(ChuanqiduanzaoItem::rsp_DuanZao), MSG_DuanzaoRsp_F, NULL);
CmdHelper::getHelper()->cmdDuanzao(bShici, profId);
}
开发者ID:longguai,项目名称:game-DarkWar,代码行数:13,代码来源:ChuanqiduanzaoLayerScrollView.cpp
示例5: CC_SAFE_RETAIN
KDbool CCTextureAtlas::initWithTexture ( CCTexture2D* pTexture, KDuint uCapacity )
{
// CCAssert ( pTexture != KD_NULL, "texture should not be null" );
m_uCapacity = uCapacity;
m_uTotalQuads = 0;
// retained in property
m_pTexture = pTexture;
CC_SAFE_RETAIN ( m_pTexture );
// Re-initialization is not allowed
CCAssert ( m_pQuads == KD_NULL && m_pIndices == KD_NULL, "" );
m_pQuads = (ccV3F_C4B_T2F_Quad *) kdCalloc ( 1, sizeof ( ccV3F_C4B_T2F_Quad ) * m_uCapacity );
m_pIndices = (GLushort *) kdCalloc ( 1, sizeof ( GLushort ) * m_uCapacity * 6 );
if ( !( m_pQuads && m_pIndices ) && m_uCapacity > 0 )
{
//CCLOG ( "XMCocos2D : CCTextureAtlas: not enough memory" );
CC_SAFE_FREE ( m_pQuads );
CC_SAFE_FREE ( m_pIndices );
// release texture, should set it to null, because the destruction will
// release it too. see cocos2d-x issue #484
CC_SAFE_RELEASE ( m_pTexture );
return KD_FALSE;
}
#if CC_ENABLE_CACHE_TEXTURE_DATA
// listen the event when app go to background
CCNotificationCenter::sharedNotificationCenter ( )->addObserver
(
this, callfuncO_selector ( CCTextureAtlas::listenBackToForeground ),
EVENT_COME_TO_FOREGROUND, KD_NULL
);
#endif
this->setupIndices ( );
#if CC_TEXTURE_ATLAS_USE_VAO
setupVBOandVAO ( );
#else
setupVBO ( );
#endif
m_bDirty = KD_TRUE;
return KD_TRUE;
}
开发者ID:mcodegeeks,项目名称:OpenKODE-Framework,代码行数:51,代码来源:CCTextureAtlas.cpp
示例6: CCLog
void FlySystemUpdateHint::onEnter(){
CCNode::onEnter();
CCLog("FlySystemUpdateHint onEnter" );
setTouchMode(Touch::DispatchMode::ONE_BY_ONE);
setTouchEnabled(true);
//hujiuxing 2015.12.17
if( m_type == FLY_HINT_SERVER_STOP )
{
CCLog("FlySystemUpdateHint FLY_HINT_SERVER_STOP run" );
this->stopAllActions();
auto action = CCSequence::create(CCCallFunc::create(this, callfunc_selector(FlySystemUpdateHint::showUIQuestNode))
,CCScaleTo::create(0.01, 1, 1)
, CCCallFunc::create(this, callfunc_selector(FlySystemUpdateHint::rollText))
, CCDelayTime::create(m_rollTime)
, CCScaleTo::create(0.01, 1, 1)
, CCCallFunc::create(this, callfunc_selector(FlySystemUpdateHint::hideUIQuestNode))
, NULL
);
if (CCCommonUtils::isIosAndroidPad() && CCCommonUtils::getIsHDViewPort())
{
action = CCSequence::create(CCCallFunc::create(this, callfunc_selector(FlySystemUpdateHint::showUIQuestNode))
,CCScaleTo::create(0.01, 2, 2)
, CCCallFunc::create(this, callfunc_selector(FlySystemUpdateHint::rollText))
, CCDelayTime::create(m_rollTime)
, CCScaleTo::create(0.01, 2, 2)
, CCCallFunc::create(this, callfunc_selector(FlySystemUpdateHint::hideUIQuestNode))
, NULL);
}
auto forever = CCRepeatForever::create( action );
this->runAction(forever);
}
else
{
CCSafeNotificationCenter::sharedNotificationCenter()->addObserver(this, callfuncO_selector(FlySystemUpdateHint::removeSelf), "remove_hint", NULL);
this->schedule(schedule_selector(FlySystemUpdateHint::loop), 1);
}
// m_time = m_countDown;
//CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this, Touch_Default, true);
}
开发者ID:ourgames,项目名称:dc208,代码行数:51,代码来源:FlySystemUpdateHint.cpp
示例7: callfuncO_selector
bool OtherLayer::init()
{
if (!Layer::init())
{
return false;
}
NotificationCenter::getInstance()->addObserver(
this,
callfuncO_selector(OtherLayer::testMsg),
"test",
NULL
);
return true;
}
开发者ID:cci8go,项目名称:Chapter9_7_Notifivation,代码行数:14,代码来源:OtherLayer.cpp
示例8: removeChild
void GAMEUI_Scene::transitionOutUiDone(GAMEUI_Window *ui)
{
if (!m_dialog) {
// [self switchUi:ui toUi:m_ui];
}
GUI_WINDOW_STATE state = ui->getState();
if (state == GUI_WINDOW_IDLE) {
//nextWindow:
removeChild(ui, false);
}
else if (state == GUI_WINDOW_ABANDON) {
//prevWindow:
if (ui->isCached()) {
removeChild(ui, false);
}
else {
removeChild(ui, true);
}
ui->release();
}
if (m_ui) {
// transition next window in.
m_transitionUi = m_ui;
addChild(m_ui);
CCCallFuncO * actionCallback = CCCallFuncO::create(this, callfuncO_selector(GAMEUI_Scene::transitionInUiDone), m_transitionUi);
m_transitionUi->setVisible(true);
m_transitionState = WINDOW_TRANSITION_IN;
m_transitionUi->transitionIn(actionCallback);
}
else {
m_transitionUi = NULL;
m_transitionState = WINDOW_STATABLE;
if (!m_dialog) {
if (m_noUiCallback) {
noUiCallback(NULL);
}
CCCallFunc * callback = CCCallFunc::create(this, callfunc_selector(GAMEUI_Scene::hideMask));
CCFadeTo * fade = CCFadeTo::create(0.2f, 0);
CCSequence * seq = CCSequence::create(fade, callback, NULL);
m_windowMask->setOpacity(0x80);
m_windowMask->runAction(seq);
}
else {
m_dialog->resume();
}
}
}
开发者ID:rockingdice,项目名称:IceCreamJam,代码行数:50,代码来源:GAMEUI_Scene.cpp
示例9: T_LOG
void TexturePreLoad::loadTexture(string file,bool async)
{
#ifdef DEBUG_ENABLE_TEXTURE_LOAD_LOG
T_LOG("TexturePreLoad::loadTexture ----> to load texture : [%s]",file.c_str());
#endif
if (async)
{
cache->addImageAsync(file.c_str(), this, callfuncO_selector(TexturePreLoad::textureLoadedCallback));
}else
{
cache->addImage(file.c_str());
}
}
开发者ID:SongCF,项目名称:game-LostStar,代码行数:14,代码来源:TexturePreLoad.cpp
示例10: callfuncO_selector
void NetworkPackageDispatch::initNode()
{
CCNode::init();
// EventListenerCustom *listener = EventListenerCustom::create(MSG_WAIT_TIME_OUT, std::bind(&NetworkPackageDispatch::onTimeOut, this, std::placeholders::_1));
// Director::getInstance()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(listener, this);
CCNotificationCenter *_sharedCenter = CCNotificationCenter::sharedNotificationCenter();
_sharedCenter->addObserver(this, callfuncO_selector(NetworkPackageDispatch::onTimeOut), MSG_WAIT_TIME_OUT, NULL);
// Let's running
this->onEnter();
this->onEnterTransitionDidFinish();
}
开发者ID:SongCF,项目名称:game-LostStar,代码行数:14,代码来源:NetworkPackageDispatch.cpp
示例11: setTouchMode
void PropSpeedupView::onEnter(){
CCNode::onEnter();
setTouchMode(Touch::DispatchMode::ONE_BY_ONE);
// this->setModelLayerDisplay(true);
setTouchEnabled(true);
if (getParent() && (getParent()->getChildByTag(BUILDINGVIEW_TAG) || getParent()->getChildByTag(YESNODLG_TAG))){
}else{
setTag(YESNODLG_TAG);
}
CCSafeNotificationCenter::sharedNotificationCenter()->addObserver(this, callfuncO_selector(PropSpeedupView::checkClose), MSG_QUEUE_REMOVE, NULL);
onUpBtn1Click(NULL,CCControlEventTouchUpInside);
}
开发者ID:ourgames,项目名称:dc208,代码行数:14,代码来源:PropSpeedupView.cpp
示例12: callfuncO_selector
void SpriteMask::setMask(const char *pMaskFile)
{
if (_isSetMask) return;
_maskTexture = CCTextureCache::sharedTextureCache()->addImage(pMaskFile);
//_maskTexture->setAliasTexParameters();
_maskTexture->retain();
CCNotificationCenter::sharedNotificationCenter()->addObserver(this, callfuncO_selector(SpriteMask::listenBackToForeground), EVNET_COME_TO_FOREGROUND, NULL);
initProgram();
_isSetMask = true;
}
开发者ID:ado137,项目名称:shader_cocos2dx,代码行数:14,代码来源:HelloWorldScene.cpp
示例13: m_nNumberOfSprites
TextureCacheTest::TextureCacheTest()
: m_nNumberOfSprites(20)
, m_nNumberOfLoadedSprites(0)
{
CCSize size = CCDirector::sharedDirector()->getWinSize();
m_pLabelLoading = CCLabelTTF::create("loading...", "Arial", 15);
m_pLabelPercent = CCLabelTTF::create("%0", "Arial", 15);
m_pLabelLoading->setPosition(CCPointMake(size.width / 2, size.height / 2 - 20));
m_pLabelPercent->setPosition(CCPointMake(size.width / 2, size.height / 2 + 20));
this->addChild(m_pLabelLoading);
this->addChild(m_pLabelPercent);
// load textrues
CCTextureCache::sharedTextureCache()->addImageAsync("Images/HelloWorld.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/grossini.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/grossini_dance_01.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/grossini_dance_02.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/grossini_dance_03.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/grossini_dance_04.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/grossini_dance_05.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/grossini_dance_06.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/grossini_dance_07.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/grossini_dance_08.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/grossini_dance_09.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/grossini_dance_10.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/grossini_dance_11.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/grossini_dance_12.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/grossini_dance_13.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/grossini_dance_14.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/background1.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/background2.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/background3.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
CCTextureCache::sharedTextureCache()->addImageAsync("Images/blocks.png", this, callfuncO_selector(TextureCacheTest::loadingCallBack));
}
开发者ID:csdnnet,项目名称:hiygame,代码行数:37,代码来源:TextureCacheTest.cpp
示例14: CC_SAFE_RETAIN
bool CCTextureAtlas::initWithTexture(CCTexture2D *texture, unsigned int capacity)
{
// CCAssert(texture != NULL, "texture should not be null");
m_uCapacity = capacity;
m_uTotalQuads = 0;
// retained in property
this->m_pTexture = texture;
CC_SAFE_RETAIN(m_pTexture);
// Re-initialization is not allowed
CCAssert(m_pQuads == NULL && m_pIndices == NULL, "");
m_pQuads = (ccV3F_C4B_T2F_Quad*)malloc( m_uCapacity * sizeof(ccV3F_C4B_T2F_Quad) );
m_pIndices = (GLushort *)malloc( m_uCapacity * 6 * sizeof(GLushort) );
if( ! ( m_pQuads && m_pIndices) && m_uCapacity > 0)
{
//CCLOG("cocos2d: CCTextureAtlas: not enough memory");
CC_SAFE_FREE(m_pQuads);
CC_SAFE_FREE(m_pIndices);
// release texture, should set it to null, because the destruction will
// release it too. see cocos2d-x issue #484
CC_SAFE_RELEASE_NULL(m_pTexture);
return false;
}
memset( m_pQuads, 0, m_uCapacity * sizeof(ccV3F_C4B_T2F_Quad) );
memset( m_pIndices, 0, m_uCapacity * 6 * sizeof(GLushort) );
// listen the event when app go to background
extension::CCNotificationCenter::sharedNotificationCenter()->addObserver(this,
callfuncO_selector(CCTextureAtlas::listenBackToForeground),
EVNET_COME_TO_FOREGROUND,
NULL);
this->setupIndices();
#if CC_TEXTURE_ATLAS_USE_VAO
setupVBOandVAO();
#else
setupVBO();
#endif
m_bDirty = true;
return true;
}
开发者ID:136446529,项目名称:book-code,代码行数:49,代码来源:CCTextureAtlas.cpp
示例15: _dict
void BaoZangView::afterGetFriendsInfo(CCObject* param){
GameController::getInstance()->removeWaitInterface();
CCArray* friends = dynamic_cast<CCArray*>(param);
if (friends) {
m_data->removeAllObjects();
m_friendDatas->removeAllObjects();
m_installDatas->removeAllObjects();
int num = friends->count();
string ids = "";
for (int i=0; i<num; i++) {
auto dic = _dict(friends->objectAtIndex(i));
if(dic){
dic->setObject(CCString::create("1"), "flag");
FBFriendInfo* info = FBFriendInfo::create();
info->id = dic->valueForKey("id")->getCString();
info->name = dic->valueForKey("name")->getCString();
info->url = CCString::createWithFormat("https://graph.facebook.com/%s/picture?type=square",dic->valueForKey("id")->getCString())->getCString();
m_data->addObject(info);
m_friendDatas->addObject(info);
if(ids!=""){
ids += ",";
}
ids += info->id;
m_installDatas->addObject(dic);
}
}
int gapNum = 5 - m_data->count();
if(gapNum<=0){
gapNum = 1;
}
for(int i=0;i<gapNum;i++){
FBFriendInfo* info = FBFriendInfo::create();
info->id = CC_ITOA(12241111+i);
info->name = "";
info->url = "";
info->add = true;
m_data->addObject(info);
}
if(ids!="" && ActivityController::getInstance()->baozangHelpArr && ActivityController::getInstance()->baozangHelpArr->count()<=0){
FBMineFriendsCommand* fbCmd = new FBMineFriendsCommand(ids);
fbCmd->setSuccessCallback(CCCallFuncO::create(this, callfuncO_selector(BaoZangView::updateServerData), NULL));
fbCmd->sendAndRelease();
}
if(m_friendDatas->count()>0){
refreshHelpData();
}
CCLOG("friends count=%d",friends->count());
}
}
开发者ID:ourgames,项目名称:dc208,代码行数:49,代码来源:BaoZangView.cpp
示例16: setCleanFunction
bool KingBattleRewardView::init()
{
if (!PopupBaseView::init()) {
return false;
}
CCLoadSprite::doResourceByCommonIndex(8, true);
setCleanFunction([](){
CCLoadSprite::doResourceByCommonIndex(8, false);
});
setIsHDPanel(true);
auto ccb = CCBLoadFile("KingdomThroneActivityReward",this,this);
this->setContentSize(ccb->getContentSize());
m_labelTitle->setString(_lang("170036"));
m_tab1->setString(_lang("170044"));
m_tab2->setString(_lang("170043"));
m_tab3->setString(_lang("170037"));
m_attackPrizeLabel->setString(_lang("170038"));
m_defensePrizeLabel->setString(_lang("170038"));
m_attackWinLabel->setString(_lang("170039"));
//Hide other function
// this->setModelLayerTouchCallback([&](cocos2d::CCTouch *pTouch){
// this->touchPressed(pTouch->getLocation());
// });
m_btnNode->setVisible(false);
bannerType=3;
attackRewardArr = NULL;
defenseRewardArr = NULL;
singleRewardArr = NULL;
m_attackScrollView=NULL;
m_defenseScrollView=NULL;
m_singleScrollView=NULL;
CTFGetRewardCommand* cmd = new CTFGetRewardCommand();
cmd->setCallback(CCCallFuncO::create(this, callfuncO_selector(KingBattleRewardView::getRewardDataCallBack), NULL));
cmd->sendAndRelease();
return true;
}
开发者ID:ourgames,项目名称:dc208,代码行数:49,代码来源:KingBattleRewardView.cpp
示例17: Point
bool ControllerPlayer::init()
{
rocker = HRocker::createHRocker("yao2.png", "yao1.png", Point(60, 60));
rocker->startlistener(); // ×¢²á¼àÌý
this->addChild(rocker);
NotificationCenter::getInstance()->addObserver(this, callfuncO_selector(ControllerPlayer::stopFunc), "stop", NULL);
NotificationCenter::getInstance()->addObserver(this, callfuncO_selector(ControllerPlayer::is_startlistener), "startlistener", NULL);
NotificationCenter::getInstance()->addObserver(this, callfuncO_selector(ControllerPlayer::is_stoplistener), "stoplistener", NULL);
auto UI_1 = cocostudio::GUIReader::getInstance()->widgetFromJsonFile("fight_1.ExportJson");
UI_1->setPosition(Point(0, 0));
UI_1->setSwallowTouches(false);
this->addChild(UI_1, 2);
attack = (Button*)Helper::seekWidgetByName(UI_1, "Button_4");
attack->addTouchEventListener(this, toucheventselector(ControllerPlayer::attackEvent));
skill = (Button*)Helper::seekWidgetByName(UI_1, "Button_1");
skill->addTouchEventListener(this, toucheventselector(ControllerPlayer::skillEvent));
shangxian = (Button*)Helper::seekWidgetByName(UI_1, "Button_3");
shangxian->addTouchEventListener(this, toucheventselector(ControllerPlayer::sxEvent));
bigskill = (Button*)Helper::seekWidgetByName(UI_1, "Button_2");
bigskill->addTouchEventListener(this, toucheventselector(ControllerPlayer::bigskillEvent));
this->scheduleUpdate();
return true;
}
开发者ID:LuowenVirus,项目名称:MyFirstGame,代码行数:36,代码来源:Controllplayer.cpp
示例18: b2Sprite
Platform::Platform (GameLayer * game) : b2Sprite (game) {
//create body
b2BodyDef bodyDef;
bodyDef.type = b2_staticBody;
_body = game->getWorld()->CreateBody(&bodyDef);
_body->SetSleepingAllowed(true);
_body->SetUserData(this);
//register game notifications
CCNotificationCenter::sharedNotificationCenter()->addObserver(this, callfuncO_selector(Platform::onGravityChanged), NOTIFICATION_GRAVITY_SWITCH, NULL);
}
开发者ID:pdpdds,项目名称:cocos2dx-dev,代码行数:15,代码来源:Platform.cpp
示例19: CardConfirm
void CardShop::showChooseCard(int idx)
{
m_iSelNo = idx;
CShopCardInfo* pShopCard = pShopCardsArr->getObjectAtIndex(idx);
if (m_cfmLayer == NULL)
{
m_cfmLayer = new CardConfirm(this, callfuncO_selector(CardShop::cbCfm), pShopCard);
addChild(m_cfmLayer);
m_cfmLayer->setPosition(CCPointMake(0, -getPosition().y));
m_cfmLayer->release();
}
}
开发者ID:haoliumilan,项目名称:AgainstSango,代码行数:15,代码来源:CardShop.cpp
示例20: setContentSize
bool BattleManagerScreen::init()
{
CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();
//CCPoint origin = CCDirector::sharedDirector()->getVisibleOrigin();
setContentSize( visibleSize );
initAbilities();
m_travelLastSpawnLocation = 0.0f;
m_travelProgess = 0.0f;
m_travelDistance = 100.0f;
float pbMargin = 50;
m_pbTravel = ProgressBar::create( CCRectMake( pbMargin, visibleSize.height - pbMargin, visibleSize.width - pbMargin*2, pbMargin ) );
m_pbTravel->setProgress( m_travelProgess / m_travelDistance );
addChild(m_pbTravel);
//todo: remove listener on destructor
EventBus::game()->addListener("GameEntityDeathEvt", this, callfuncO_selector(BattleManagerScreen::onEntityDeath));
EventBus::game()->addListener("GameEntityLevelupEvt", this, callfuncO_selector(BattleManagerScreen::onEntityLevelup));
EventBus::game()->addListener("GameEntityEffectEvt", this, callfuncO_selector(BattleManagerScreen::onEntityEffectEvent));
CastWorldModel::get()->setPhysicsInterface(this);
initPartyFromJson();
spawnEnemy();
scheduleUpdate();
//setTouchEnabled(true);
return true;
}
开发者ID:keless,项目名称:CastEngine,代码行数:36,代码来源:BattleManagerScreen.cpp
注:本文中的callfuncO_selector函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论