本文整理汇总了C++中CCMenuItemFont::getPositionY方法的典型用法代码示例。如果您正苦于以下问题:C++ CCMenuItemFont::getPositionY方法的具体用法?C++ CCMenuItemFont::getPositionY怎么用?C++ CCMenuItemFont::getPositionY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCMenuItemFont
的用法示例。
在下文中一共展示了CCMenuItemFont::getPositionY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
bool FriendList::init()
{
if ( !CCLayer::init())
{
return false;
}
mEnableHighScoreDisplay = false;
mEnableInstalledDisplay = false;
mReadyForNextDownload = false;
mPhotoLoadIndex = 0;
EziSocialObject::sharedObject()->setFacebookDelegate(this);
CCSize winSize = CCDirector::sharedDirector()->getVisibleSize();
SCREEN_WIDTH = winSize.width;
SCREEN_HEIGHT = winSize.height;
CCLayerColor *backgroundLayer = CCLayerColor::create(ccc4(20, 100, 100, 255), SCREEN_WIDTH, SCREEN_HEIGHT);
this->addChild(backgroundLayer);
MENU_FONT_SCALE = SCREEN_HEIGHT/320;
// Back Menu
CCMenuItemFont *itemBack = CCMenuItemFont::create("Back", this, menu_selector(FriendList::showHomePage));
itemBack->setPosition(ccp(SCREEN_WIDTH/2, (itemBack->getContentSize().height/2 + 2) * MENU_FONT_SCALE));
CCMenuItemFont *itemHighScore = CCMenuItemFont::create("High Scores", this, menu_selector(FriendList::showHighScoreList));
itemHighScore->setAnchorPoint(ccp(1, 0.5));
itemHighScore->setPosition(ccp((SCREEN_WIDTH-10), itemBack->getPositionY()));
CCMenuItemFont *allFriends = CCMenuItemFont::create("All Friends", this, menu_selector(FriendList::showAllFriendsList));
allFriends->setAnchorPoint(ccp(0, 0.5));
allFriends->setPosition(ccp((10), itemBack->getPositionY()));
CCMenuItemFont *installedOnly = CCMenuItemFont::create("Installed Only", this, menu_selector(FriendList::showInstalledList));
installedOnly->setAnchorPoint(ccp(0, 1));
installedOnly->setPosition(ccp((10), SCREEN_HEIGHT - 2));
CCMenuItemFont *notPlaying = CCMenuItemFont::create("Friends Not Playing", this, menu_selector(FriendList::showNotInstalledList));
notPlaying->setAnchorPoint(ccp(1, 1));
notPlaying->setPosition(ccp((SCREEN_WIDTH-10), SCREEN_HEIGHT - 2));
itemBack->setScale(MENU_FONT_SCALE);
itemHighScore->setScale(MENU_FONT_SCALE);
allFriends->setScale(MENU_FONT_SCALE);
installedOnly->setScale(MENU_FONT_SCALE);
notPlaying->setScale(MENU_FONT_SCALE);
CCMenu *menuBack = CCMenu::create(itemBack, itemHighScore, allFriends, installedOnly, notPlaying, NULL);
menuBack->setPosition(CCPointZero);
addChild(menuBack);
float gap = itemBack->getContentSize().height * 2 * MENU_FONT_SCALE + (10 * MENU_FONT_SCALE);
mFriendList = NULL;
PHOTO_SCALE = SCREEN_HEIGHT/1536;
if (PHOTO_SCALE <= 0.5 && PHOTO_SCALE > 0.25)
{
FB_DEFAULT_PHOTO = "fb_user_icon_half.jpg";
}
else if (PHOTO_SCALE < 0.25)
{
FB_DEFAULT_PHOTO = "fb_user_icon_quater.jpg";
}
CCSprite *sprite = CCSprite::create(FB_DEFAULT_PHOTO);
CELL_HEIGHT = (sprite->getContentSize().height) + (40 * PHOTO_SCALE);
mTableView = CCTableView::create(this, CCSizeMake(SCREEN_WIDTH, SCREEN_HEIGHT - gap));
mTableView->setDirection(kCCScrollViewDirectionVertical);
mTableView->setPosition(ccp(0, gap/2));
mTableView->setDelegate(this);
this->addChild(mTableView);
mTableView->reloadData();
ALL_DOWNLOAD_COMPLETE = true;
mLoadingImage = CCSprite::create("ball.png");
mLoadingImage->setPosition(ccp(SCREEN_WIDTH/2, SCREEN_HEIGHT/2));
mLoadingImage->retain();
this->addChild(mLoadingImage);
this->hideLoadingAction();
return true;
}