void TargetLayer::hideLetters() { for (int index = 0; index < targets->count(); index++) { CCSprite* target = (CCSprite*)targets->objectAtIndex(index); CCLabelTTF* letter = (CCLabelTTF*)target->getChildByTag(TAG_LETTER); letter->setVisible(false); } }
void TargetLayer::showLetters() { for (int i = 0; i < targets->count(); i++) { CCSprite* target = (CCSprite*)targets->objectAtIndex(i); CCLabelTTF* letter = (CCLabelTTF*)target->getChildByTag(TAG_LETTER); letter->setVisible(true); } }
void IOSStoreLayer::setLeftTopTipStrVisible(bool e) { CCLabelTTF* pTipStr = (CCLabelTTF*)m_pBg->getChildByTag(lefttop_tip_str_tag); if (pTipStr) { pTipStr->setVisible(e); } }
void HudLayer::showTools() { for (int i = 0; i < _tools->count(); i++) { Tool *tool = (Tool *) _tools->objectAtIndex(i); this->addChild(tool); } for (int i = 0; i < _toolLabels->count(); i++) { CCLabelTTF * label = (CCLabelTTF *) _toolLabels->objectAtIndex(i); label->setVisible(true); } }
void HudLayer::hideTools() { for (int i = 0; i < _tools->count(); i++) { Tool *tool = (Tool *) _tools->objectAtIndex(i); this->removeChild(tool); } for (int i = 0; i < _toolLabels->count(); i++) { CCLabelTTF * label = (CCLabelTTF *) _toolLabels->objectAtIndex(i); label->setVisible(false); } }
void GamePan::showHideConfirmPad(bool isShow) { CCLayerColor* pBaseNode = dynamic_cast<CCLayerColor*>(m_pCcbNode->getChildByTag(kTagGamePanConfirmPad)); pBaseNode->setVisible(isShow); CCLabelTTF* pText = dynamic_cast<CCLabelTTF*>(pBaseNode->getChildByTag(1)); pText->setVisible(!_isPlayer); CCMenu* pMenu = dynamic_cast<CCMenu*>(pBaseNode->getChildByTag(0)); pMenu->setVisible(isShow && _isPlayer); pMenu->setTouchPriority(-1000); if(pMenu) { CCMenuItemImage* btn = dynamic_cast<CCMenuItemImage*>(pMenu->getChildByTag(kTagGamePanConfirmPadOkBtn)); btn->setTarget(this,menu_selector(GamePan::ConfirmBtnCallback)); btn = dynamic_cast<CCMenuItemImage*>(pMenu->getChildByTag(kTagGamePanConfirmPadCancelBtn)); btn->setTarget(this,menu_selector(GamePan::ConfirmBtnCallback)); } }
FC_Block * FC_Block::BlockWithFile(char* szFile, int idx, FC_Main* pMainLayer) { FC_Block * pBlock = new FC_Block(); pBlock->initWithFile(szFile); pBlock->autorelease(); pBlock->setTag(idx); char temp[10] = {0,}; sprintf( temp, "%d", idx ); // 블럭위에 라벨을 생성. CCLabelTTF* pLabel = CCLabelTTF::create(temp, "Arial", 40); pLabel->setPosition(ccp(30, 30)); pLabel->setVisible( false ); pLabel->setColor( ccBLUE ); pBlock->addChild(pLabel, 1, 50); pBlock->m_pMainLayer = pMainLayer; return pBlock; }
void RPGBattleMenu::showMenu() { CCTMXTiledMap *bgLayer = (CCTMXTiledMap*)this->m_parentNode->getChildByTag(kRPGBattleMenuTagBg); bgLayer->setVisible(true); CCLabelTTF *nameLab = (CCLabelTTF*)this->m_parentNode->getChildByTag(kRPGBattleMenuTagNameLab); nameLab->setVisible(true); CCSprite *separate = (CCSprite*)this->m_parentNode->getChildByTag(kRPGBattleMenuTagSeparate); separate->setVisible(true); CCMenuItem *menuAttack = (CCMenuItem*)this->getChildByTag(kRPGBattleMenuTagAttack); menuAttack->setVisible(true); CCMenuItem *menuSkill = (CCMenuItem*)this->getChildByTag(kRPGBattleMenuTagSkill); menuSkill->setVisible(true); CCMenuItem *menuItems = (CCMenuItem*)this->getChildByTag(kRPGBattleMenuTagItems); menuItems->setVisible(true); CCMenuItem *menuEscape = (CCMenuItem*)this->getChildByTag(kRPGBattleMenuTagEscape); menuEscape->setVisible(true); }
void Study1::initWords() { if (this->strWords.size() == 0) { return; } CCPoint wordPoint[6] = { ccp(296,110), ccp(383,110), ccp(466,110), ccp(552,110), ccp(636,110), ccp(720,110),}; CCMenu* pMenu = CCMenu::create(); pMenu->setPosition( CCPointZero ); addChild(pMenu); char str[100]; for (int i=0; i<strWords.size(); i++) { CCMenuItemImage *pi = CCMenuItemImage::create( "wkszStudy1/wordbg1.png", "wkszStudy1/wordbg2.png", this, menu_selector(Study1::wordCB) ); if (i == 0) { CCNode *img = CCSprite::createWithTexture(CCTextureCache::sharedTextureCache()->textureForKey("wkszStudy1/wordbg3.png")); pi->setNormalImage(img); } pi->setPosition(wordPoint[i%PAGE_CAPACITY]); pi->setTag(i); pi->setVisible(false); menuWords.push_back(pi); pMenu->addChild(pi); CCLOG("str:%s",strWords[i].c_str()); CCLabelTTF* pLabel = CCLabelTTF::create(strWords[i].c_str(), "Thonburi", 34); pLabel->setPosition( ccp(297+i%PAGE_CAPACITY*85,112) ); pLabel->setColor(ccBLACK); pLabel->setVisible(false); labelWords.push_back(pLabel); this->addChild(pLabel, 9); sprintf(str, "wkszCharacter1/%s.swf",strWords[i].c_str()); CCSWFNode* swf1 = CCSWFNode::create(str); swf1->setPosition(ccp(506,445)); // swf1->setScale(0.8f); // swf1->runAction(); swf1->setRepeat(true); swf1->setVisible(false); swfWords1.push_back(swf1); this->addChild(swf1,9); sprintf(str, "wkszCharacter2/%s.swf",strWords[i].c_str()); CCSWFNode* swf2 = CCSWFNode::create(str); swf2->setPosition(ccp(280,243)); // swf2->setScale(0.8f); // swf2->runAction(); swf2->setRepeat(true); swf2->setVisible(false); swfWords2.push_back(swf2); this->addChild(swf2,9); } }
CCTableViewCell* FriendList::tableCellAtIndex(CCTableView *table, unsigned int idx) { EziFacebookFriend* friendDetails = (EziFacebookFriend*)mFriendList->objectAtIndex(idx); std::string friendID = friendDetails->getFBID(); std::string friendName = friendDetails->getName(); std::string installed = ""; std::string score = ""; CCSprite* profilePic = NULL; // Set the score. long mylong = friendDetails->getScore(); std::stringstream mystream; mystream << mylong; score = mystream.str(); // Set the install status if (friendDetails->isInstalled()) { installed = "Installed"; } else { installed = "Not Installed"; } CCTableViewCell *cell = table->dequeueCell(); if (!cell) // Creation of Cell. { cell = new CCTableViewCell(); cell->autorelease(); CCLayerColor* colorLayer = CCLayerColor::create(ccc4(20, 0, 40, 255), SCREEN_WIDTH, CELL_HEIGHT); cell->addChild(colorLayer); CCSprite *sprite = NULL; if (strcmp(friendDetails->getPhotoPath(), "") != 0) { const char* picPath = friendDetails->getPhotoPath(); sprite = CCSprite::create(picPath); } else { sprite = CCSprite::create(FB_DEFAULT_PHOTO); } if (sprite == NULL) { CCLOG("Sprite is NULL"); } sprite->setAnchorPoint(ccp(0, 0.5)); sprite->setPosition(ccp(20, CELL_HEIGHT/2)); cell->addChild(sprite); //sprite->setScale(0.9); sprite->setTag(FRIEND_PHOTO_TAG); // Friend Facebook ID CCLabelTTF *friendIDLabel = CCLabelTTF::create(friendID.c_str(), "Helvetica", 20.0 * MENU_FONT_SCALE); float gapY = (CELL_HEIGHT - (friendIDLabel->getContentSize().height * 2)) / 3; if (sprite) { friendIDLabel->setPosition(ccp(sprite->getPositionX() + sprite->getContentSize().width + 20, CELL_HEIGHT - gapY)); } friendIDLabel->setAnchorPoint(ccp(0, 1)); friendIDLabel->setTag(FRIEND_ID_LABEL_TAG); cell->addChild(friendIDLabel); // Friend Facebook Name CCLabelTTF *friendNameLabel = CCLabelTTF::create(friendName.c_str(), "Helvetica", 20.0 * MENU_FONT_SCALE); friendNameLabel->setPosition(ccp(friendIDLabel->getPositionX(), friendIDLabel->getPositionY() - friendIDLabel->getContentSize().height - gapY)); friendNameLabel->setAnchorPoint(ccp(0, 1)); friendNameLabel->setTag(FRIEND_NAME_LABEL_TAG); cell->addChild(friendNameLabel); // High Score CCLabelTTF *scoreLabel = CCLabelTTF::create(score.c_str(), "Helvetica", 20.0 * MENU_FONT_SCALE); scoreLabel->setPosition(ccp(SCREEN_WIDTH - 20, friendIDLabel->getPositionY())); scoreLabel->setAnchorPoint(ccp(1, 1)); scoreLabel->setTag(FRIEND_SCORE_LABEL_TAG); cell->addChild(scoreLabel); // Installed String CCLabelTTF *installedLabel = CCLabelTTF::create(installed.c_str(), "Helvetica", 20.0 * MENU_FONT_SCALE); installedLabel->setPosition(ccp(SCREEN_WIDTH - 20, friendNameLabel->getPositionY())); installedLabel->setAnchorPoint(ccp(1, 1)); installedLabel->setTag(FRIEND_INSTALLED_LABEL_TAG); cell->addChild(installedLabel); } else { // Set the Friend ID CCLabelTTF *friendIDLabel = (CCLabelTTF*)cell->getChildByTag(FRIEND_ID_LABEL_TAG); friendIDLabel->setString(friendID.c_str()); // Set the Friend Name CCLabelTTF *friendNameLabel = (CCLabelTTF*)cell->getChildByTag(FRIEND_NAME_LABEL_TAG); friendNameLabel->setString(friendName.c_str()); CCLabelTTF *highScoreLabel = (CCLabelTTF*)cell->getChildByTag(FRIEND_SCORE_LABEL_TAG); if (highScoreLabel != NULL) { highScoreLabel->setString(score.c_str()); } highScoreLabel->setVisible(mEnableHighScoreDisplay); CCLabelTTF *installedLabel = (CCLabelTTF*)cell->getChildByTag(FRIEND_INSTALLED_LABEL_TAG); if (installedLabel != NULL) { installedLabel->setString(installed.c_str()); } installedLabel->setVisible(mEnableInstalledDisplay); CCSprite* cellProfilePic = (CCSprite*)cell->getChildByTag(FRIEND_PHOTO_TAG); if (strcmp("", friendDetails->getPhotoPath()) != 0 ) { const char* picPath = friendDetails->getPhotoPath(); profilePic = CCSprite::create(picPath); } else { profilePic = CCSprite::create(FB_DEFAULT_PHOTO); } cellProfilePic->setTexture(profilePic->getTexture()); } return cell; }
void TanSuoLayer::rsp_query(CCObject *msg) { removeObserver(MSG_queryDiscoverInfoRsp); GameDirector::getDirector()->hideWaiting(); SPCmd_QueryDiscoverInfoRsp* data = (SPCmd_QueryDiscoverInfoRsp*) ((MSG_Rsp*)msg)->getData(); if(data->err_code != Success) { MessageDisplay* layer = MessageDisplay::create(mCmdHlp->getMessage(data->err_code)); CCDirector::sharedDirector()->getRunningScene()->addChild(layer); return; } mMainMenu->setVisible(true); CCString temp; int xunBaoCount = CS::getDiscoverLimitTimes(MyselfManager::getManager()->getMyZhuJueData()->getVipLevel());//寻宝次数上限 //当前剩余次数 /*temp.initWithFormat("%u/%u", data->remainder_times, CS::getDiscoverLimitTimes(MyselfManager::getManager()->getMyZhuJueData()->getVipLevel()));*/ temp.initWithFormat("%u", data->remainder_times); CCLabelTTF *numLabel = CCLabelTTF::create(temp.getCString(), fontStr_BookAntiqua, m_nFontSize); mBg->addChild(numLabel, 1, Tag_Label_CurNum); //numLabel->setAnchorPoint(ccp(0, 0.5)); numLabel->setPosition(ccp(374, mBg->getContentSize().height-762)); numLabel->setColor(ccGREEN); //int shengyuTimes = MAX_TANSUOTIMES - data->discovered_times; int shengyuTimes = MAX_TANSUOTIMES - data->discovered_times; unsigned int serverTime = ServerTime::getTime(); int tm = 360 - (serverTime - data->last_modify_timestamp) % 360; string timeStr = getTimeForString(tm); m_nRefreshTime = tm; CCLabelTTF *timeTTF = CCLabelTTF::create(CCString::createWithFormat("(%s)",timeStr.c_str())->getCString(), fontStr_kaiti, m_nFontSize); mBg->addChild(timeTTF, 1); //haixuNumLabel->setAnchorPoint(ccp(0,0.5)); timeTTF->setPosition(ccp( numLabel->getPositionX() + numLabel->getContentSize().width / 2 + timeTTF->getContentSize().width / 2 + 10, numLabel->getPositionY())); timeTTF->setColor(ccWHITE); m_tRefreshTimeTTF = timeTTF; if (xunBaoCount == data->remainder_times) { timeTTF->setVisible(false); //haixuNumLabel->setPosition(ccp( mBg->getContentSize().width / 2 - 15, 44)); } else { schedule(SEL_SCHEDULE(&TanSuoLayer::refreshTime),1.0f); //str = CCString::createWithFormat("()") } if (data->discovered_times >= MAX_TANSUOTIMES) { temp.initWithFormat(LFStrings::getValue("XunBaoYiJing_DianLiang_String").c_str()); CCLabelTTF *yidianliangLabel = CCLabelTTF::create(temp.getCString(), fontStr_kaiti, m_nFontSize, CCSize(0,0), kCCTextAlignmentCenter); mBg->addChild(yidianliangLabel, 1, Tag_Label_YiDianLiang); //yidianliangLabel->setAnchorPoint(ccp(0,0.5)); //yidianliangLabel->setPosition(ccp(370, 54)); yidianliangLabel->setPosition(ccp( mBg->getContentSize().width / 2, 44)); yidianliangLabel->setColor(fonColor_PuTong); m_tHaixuTTF = NULL; m_nHadCount = data->remainder_times; } else { CCString *str = CCString::createWithFormat("%s %s",LFStrings::getValue("XunBaoHaixu_String").c_str(),LFStrings::getValue("XunBaoDianLiang_String").c_str()); CCLabelTTF *haixuNumLabel1 = CCLabelTTF::create(str->getCString(), fontStr_kaiti, m_nFontSize, CCSize(0,0), kCCTextAlignmentCenter); mBg->addChild(haixuNumLabel1, 1,Tag_Label_ShengyuNum); //haixuNumLabel->setAnchorPoint(ccp(0,0.5)); haixuNumLabel1->setPosition(ccp( mBg->getContentSize().width / 2, 44)); haixuNumLabel1->setColor(fonColor_PuTong); CCLabelTTF *haixuNumLabel = CCLabelTTF::create(CCString::createWithFormat("%d",shengyuTimes)->getCString(), fontStr_kaiti, m_nFontSize, CCSize(0,0), kCCTextAlignmentCenter); mBg->addChild(haixuNumLabel, 1,Tag_Label_Haixu); //haixuNumLabel->setAnchorPoint(ccp(0,0.5)); haixuNumLabel->setPosition(ccp(haixuNumLabel1->getPositionX() - haixuNumLabel1->getContentSize().width / 2 + m_nFontSize * 2 + haixuNumLabel->getContentSize().width / 2, haixuNumLabel1->getPositionY())); haixuNumLabel->setColor(ccWHITE); m_tHaixuTTF = haixuNumLabel; m_nHadCount = data->remainder_times; /* //还需 temp.initWithFormat(LFStrings::getValue("XunBaoHaixu_String").c_str()); CCLabelTTF *haixuNumLabel = CCLabelTTF::create(temp.getCString(), fontStr_kaiti, m_nFontSize, CCSize(0,0), kCCTextAlignmentCenter); mBg->addChild(haixuNumLabel, 1, Tag_Label_Haixu); //haixuNumLabel->setAnchorPoint(ccp(0,0.5)); haixuNumLabel->setPosition(ccp( mBg->getContentSize().width / 2, 44)); haixuNumLabel->setColor(fonColor_PuTong); //右边剩余次数 temp.initWithFormat(" %d ", shengyuTimes); CCLabelTTF *rightnumLabel = CCLabelTTF::create(temp.getCString(), fontStr_BookAntiqua, m_nFontSize, CCSize(40,0), kCCTextAlignmentCenter); mBg->addChild(rightnumLabel, 1, Tag_Label_ShengyuNum); rightnumLabel->setColor(ccGREEN); if (shengyuTimes < 10) { rightnumLabel->setPosition(ccp(haixuNumLabel->getPositionX()+ 60, haixuNumLabel->getPositionY())); } else { rightnumLabel->setPosition(ccp(haixuNumLabel->getPositionX()+ 55, haixuNumLabel->getPositionY())); } //次点亮石碑 temp.initWithFormat(LFStrings::getValue("XunBaoDianLiang_String").c_str()); CCLabelTTF *shibeiLabel = CCLabelTTF::create(temp.getCString(), fontStr_kaiti, m_nFontSize, CCSize(0,0), kCCTextAlignmentLeft); mBg->addChild(shibeiLabel, 1, Tag_Label_DianLiang); shibeiLabel->setAnchorPoint(ccp(0,0.5)); shibeiLabel->setPosition(ccp(haixuNumLabel->getPositionX()+ 80, haixuNumLabel->getPositionY())); shibeiLabel->setColor(fonColor_PuTong);*/ } //恢复提示 /*CCLabelTTF *tishiLabel = CCLabelTTF::create(LFStrings::getValue("XunBaoHuiFuTiShi").c_str(), fontStr_kaiti, m_nFontSize); mBg->addChild(tishiLabel); tishiLabel->setAnchorPoint(ccp(0, 0.5)); tishiLabel->setColor(fonColor_CiYao); tishiLabel->setPosition(ccp(20, mBg->getContentSize().height-802)); */ //fengyin { CCPoint pos[6] = {ccp(319,838-356), ccp(444,838-386), ccp(486,838-464) , ccp(319,838-534), ccp(152,838-464), ccp(194,838-386)}; float scale[6] = {.6f, .75f, .9f, 1.0f, .9f, .75f}; char buf[128]; int i=0; mDestroyCount = data->destroy_seal; for (int count=mDestroyCount; i<count; ++i) { CCSprite *img = CCSprite::create("xunbao_fengyinshi.png"); mBg->addChild(img, 10-(i-3)*(i-3), Tag_Img_FenYing + i); img->setScale(scale[i]); img->setPosition(pos[i]); sprintf(buf, "xunbao_fengyinshi_fuwen_%d.png", i+1); CCSprite *fwImg = CCSprite::create(buf); img->addChild(fwImg); fwImg->setPosition(ccp(img->getContentSize().width/2, img->getContentSize().height/2)); } for (; i<6; ++i) { CCSprite *img = CCSprite::create("xunbao_fengyinshi.png"); mBg->addChild(img, 10-(i-3)*(i-3), Tag_Img_FenYing + i); img->setScale(scale[i]); img->setPosition(pos[i]); } TanSuoManager *manager = TanSuoManager::getManager(); if (manager->canJieFeng()) { m_bIsJieFeng = true; m_nSelectProId = -1; mMainMenu->getChildByTag(Tag_MenuItem_JieFen)->setVisible(true); } else { mMainMenu->getChildByTag(Tag_MenuItem_JieFen)->setVisible(false); } } }
void IOSStoreLayer::initKaibaoxiangNode() { //获取要显示的所有道具的个数 if (m_iBaoxiangCellCount <= 0 ) { return; } //添加道具的tableview CCTableView* tableView = (CCTableView*)m_pKaibaoxiangNode->getChildByTag(kaibaoxiang_node_tableview_tag); if (tableView) { tableView->removeFromParent(); } tableView = CCTableView::create(this, CCSizeMake(230*m_iBaoxiangCellCount, 380)); // tableView->ignoreAnchorPointForPosition(false); // tableView->setAnchorPoint(ccp(0.5f, 0.5f)); tableView->setViewSize(CCSizeMake(920, 380)); tableView->setDirection(kCCScrollViewDirectionHorizontal); tableView->setPosition(ccp(35, 40)); // tableView->setPosition(ccp(m_pBg->getContentSize().width/2, m_pBg->getContentSize().height/2)); tableView->setDelegate(this); tableView->setTag(kaibaoxiang_node_tableview_tag); CCDirector::sharedDirector()->getTouchDispatcher()->removeDelegate(tableView); if (m_iBaoxiangCellCount > 4) { tableView->runAction(CCSequence::create(CCDelayTime::create(0.01f), CCCallFuncN::create(this, callfuncN_selector(IOSStoreLayer::UpTableViewPrioority)), NULL)); } m_pKaibaoxiangNode->addChild(tableView, 2); tableView->reloadData(); if (m_iBaoxiangCellCount > 0 && m_iBaoxiangCellCount <= 2) { tableView->setViewSize(CCSizeMake(230*m_iBaoxiangCellCount, 380)); } if(m_iBaoxiangCellCount == 1) { tableView->setPosition(ccp(m_pBg->getContentSize().width/2 - 115, 40)); } else if (m_iBaoxiangCellCount == 2) { tableView->setPosition(ccp(m_pBg->getContentSize().width/2 - 220, 40)); } else if (m_iBaoxiangCellCount == 3) { tableView->setPosition(ccp(m_pBg->getContentSize().width/2 - 345, 40)); } //右边说明文字背景 CCSprite* pLeftBg = CCSprite::create(ResManager::getManager()->getSharedFilePath(g_storelayerPath+"main_shangdian_daoju_bg_2.png").c_str()); pLeftBg->setPosition(ccp(tableView->getPositionX() - pLeftBg->getContentSize().width/2, tableView->getPositionY()+pLeftBg->getContentSize().height/2)); m_pKaibaoxiangNode->addChild(pLeftBg); pLeftBg->setTag(leftbg_tag); //右边说明文字 CCLabelTTF* pLabel = CCLabelTTF::create("", fontStr_katong, 24, CCSize(180, 0), kCCTextAlignmentLeft); pLabel->setColor(fontColor_Store); pLabel->setPosition(ccp(pLeftBg->getContentSize().width/2, pLeftBg->getContentSize().height/2+10)); pLeftBg->addChild(pLabel, 1); pLabel->setTag(leftbg_string_tag); //下边说明文字背景 CCSprite* pDownBg = CCSprite::create(ResManager::getManager()->getSharedFilePath(g_storelayerPath+"main_shangdian_daoju_bg_3.png").c_str()); pDownBg->setPosition(ccp(pLeftBg->getContentSize().width/2, pLeftBg->getContentSize().height/2)); pLeftBg->addChild(pDownBg, 1, downbg_tag); CCLabelTTF* pDownLabel = CCLabelTTF::create("", fontStr_katong, 24, CCSize(200, 0), kCCTextAlignmentCenter); pDownLabel->setPosition(ccp(pDownBg->getPositionX()-3, 60)); pDownBg->addChild(pDownLabel, 1); pDownLabel->setTag(downbg_string_tag); if (m_enumComeFrom != from_SeasonSelector) { pDownBg->setVisible(false); pDownLabel->setVisible(false); } this->setComefrom(m_enumComeFrom); }
bool TextLayer::init() { if(!CCLayer::init()) { return false; } this->scheduleUpdate(); CCLabelTTF *label = CCLabelTTF::create("DEBUG", FONT_NAME, FONT_SIZE); label->setPosition(ccp(0, 768)); label->setAnchorPoint(ccp(0, 1)); this->addChild(label); label->setVisible(false); int count = 1; positionLabel = CCLabelTTF::create("positon", FONT_NAME, FONT_SIZE); positionLabel->setPosition(ccp(0, 768 - count * LINE_HEIGHT)); positionLabel->setAnchorPoint(ccp(0, 1)); this->addChild(positionLabel); positionLabel->setVisible(false); count++; tileCoordLabel = CCLabelTTF::create("tile coord", FONT_NAME, FONT_SIZE); tileCoordLabel->setPosition(ccp(0, 768 - count * LINE_HEIGHT)); tileCoordLabel->setAnchorPoint(ccp(0, 1)); this->addChild(tileCoordLabel); tileCoordLabel->setVisible(false); count++; hpLabel = CCLabelTTF::create("hp", FONT_NAME, FONT_SIZE); hpLabel->setPosition(ccp(0, 768 - count * LINE_HEIGHT)); hpLabel->setAnchorPoint(ccp(0, 1)); this->addChild(hpLabel); hpLabel->setVisible(false); count++; availCountLabel = CCLabelTTF::create("Avail Count", FONT_NAME, FONT_SIZE); availCountLabel->setPosition(ccp(0, 768 - count * LINE_HEIGHT)); availCountLabel->setAnchorPoint(ccp(0, 1)); this->addChild(availCountLabel); availCountLabel->setVisible(false); for(int i = 0; i < 3; i++) { heartSprite[i] = CCSprite::create("texture/heart.png"); heartSprite[i]->setScale(0.1f); heartSprite[i]->setPosition(ccp((i + 1) * 35 + 12, 600)); this->addChild(heartSprite[i]); } specialBase = CCSprite::create("texture/special_base.png"); specialBase->setPosition(ccp(25, 580)); specialBase->setAnchorPoint(ccp(0,1)); specialBase->setScale(0.4f); this->addChild(specialBase); for(int i = 0; i < 5; i++) { specialGuage[i] = CCSprite::create("texture/special_guage.png"); specialGuage[i]->setAnchorPoint(ccp(0,1)); specialGuage[i]->setScale(0.37f); //specialGuage[i]->setScaleX(0.2f); specialGuage[i]->setPosition(ccp((i + 1) * (specialGuage[i]->getContentSize().width * 0.4f+ 4) + 13, 573)); this->addChild(specialGuage[i]); } preHP = 0; preSpecialCount = 0; return true; }