本文整理汇总了C++中CCLayer::setAnchorPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ CCLayer::setAnchorPoint方法的具体用法?C++ CCLayer::setAnchorPoint怎么用?C++ CCLayer::setAnchorPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCLayer
的用法示例。
在下文中一共展示了CCLayer::setAnchorPoint方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updatePages
void CCScrollLayer::updatePages()
{
// Loop through the array and add the screens if needed.
int i = 0;
CCObject* object = NULL;
CCARRAY_FOREACH(m_pLayers, object)
{
CCLayer* layer = (CCLayer*)object;
layer->setAnchorPoint(ccp(0,0));
layer->setContentSize(CCDirector::sharedDirector()->getWinSize());
layer->setPosition(ccp((i * (m_tContentSize.width - m_fPagesWidthOffset)), 0));
if (!layer->getParent())
addChild(layer);
i++;
}
示例2: initWithLayers
bool CCScrollLayer::initWithLayers(CCArray *layers, int widthOffset)
{
if (CCLayer::init())
{
// Make sure the layer accepts touches
(CCDirector::sharedDirector()->getTouchDispatcher())->addTargetedDelegate(this,0,false);
// Set up the starting variables
if(!widthOffset)
{
widthOffset = 0;
}
currentScreen = 1;
// offset added to show preview of next/previous screens
scrollWidth = (int)CCDirector::sharedDirector()->getWinSize().width - widthOffset;
scrollHeight = (int)CCDirector::sharedDirector()->getWinSize().height;
startWidth = scrollWidth;
startHeight = scrollHeight;
// Loop through the array and add the screens
unsigned int i;
for (i=0; i<layers->count(); i++)
{
CCLayer* l = (CCLayer*)layers->objectAtIndex(i);
l->setAnchorPoint(ccp(0,0));
l->setPosition(ccp((i*scrollWidth),0));
addChild(l,1,i+2000);
}
// Setup a count of the available screens
totalScreens = layers->count();
return true;
}
else
{
return false;
}
}
示例3: initWithLayers
bool CCScrollLayer::initWithLayers(CCArray * layers, float layerSize, int space)
{
if (CCLayer::init())
{
// Make sure the layer accepts touches
CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this,0,true);
currentScreen = 1;
// offset added to show preview of next/previous screens
scrollWidth = (int)CCDirector::sharedDirector()->getWinSize().width;
scrollHeight = (int)CCDirector::sharedDirector()->getWinSize().height / 2;
CCAssert( (layerSize + space) <= scrollWidth, "Scroll width must be greater then layer width");
int layersInScreen = 0;
unsigned int i = 1;
while ((i<layers->count()) && ((layerSize + space) * i <= scrollWidth)) {
layersInScreen++;
i++;
}
startWidth = space/2;
scrollWidth = layersInScreen * (layerSize + space);
totalScreens = ceil(layers->count() / (float)layersInScreen);
for (i=0; i<layers->count(); i++)
{
CCLayer* l = (CCLayer *)layers->objectAtIndex(i);
l->setAnchorPoint(ccp(0, 0));
l->setPosition(ccp(startWidth + (layerSize + space) * i, scrollHeight-layerSize/2));
addChild(l);
}
return true;
}
else
{
return false;
}
}
示例4: addPage
CCLayer* GiftListView::addPage()
{
CCLayer* page = CCLayer::create();
page->setAnchorPoint(ccp(0,0));
mPages.addObject(page);
page->setContentSize(getContentSize());
float pageX=0;
if (mPageTotal!=0)
pageX = ((CCLayer*)mPages.objectAtIndex(mPageTotal-1))->getPositionX()+page->getContentSize().width + mPageInterval;
page->setPosition(ccp(pageX,0));
addChild(page);
mPageTotal++;
GiftPageMarker* marker = NULL;
if (mMarkerImgPath=="" && mMarkerDisImgPath=="")
marker = GiftPageMarker::create("spot_highlight.png","spot_dark.png");
else
marker = GiftPageMarker::create(mMarkerImgPath.c_str(),mMarkerDisImgPath.c_str());
mPageMarkers.addObject(marker);
for (int i=0;i<(int)mPageMarkers.count();i++)
{
GiftPageMarker* markertmp = (GiftPageMarker*)mPageMarkers.objectAtIndex(i);
int minterval = 7;
int mw = markertmp->mMenuItem->getContentSize().width;
int mx = i*(mw + minterval)+ getContentSize().width/2 - (mPageTotal-1)*(mw + minterval)/2 + mMarkPosOffset.x;
int my = -7 - mItemIntervalV+mMarkPosOffset.y;
markertmp->setPosition(ccp(mx,my));
}
addChild(marker);
setPageMarkerShow(1);
return page;
}
示例5: init
bool LeaderBoard::init()
{
if (!CCLayer::init())
return false;
//float iMenuWidthOffset = 0.55;
SCREEN_WIDTH = CCDirector::sharedDirector()->getWinSize().width;
SCREEN_HEIGHT = CCDirector::sharedDirector()->getWinSize().height;
CCSprite* bgsprite =ThemeManager::sharedInstance()->spriteWithImageFile("leaderboard.png");
bgsprite->setScaleX(SCREEN_WIDTH/bgsprite->getContentSize().width);
bgsprite->setScaleY(SCREEN_HEIGHT/bgsprite->getContentSize().height);
bgsprite->setPosition(ccp(SCREEN_WIDTH/2, SCREEN_HEIGHT/2));
this->addChild(bgsprite,1);
CCSprite* updateNicknamelb =ThemeManager::sharedInstance()->spriteWithImageFile("btn_update_nickname.png");
CCSprite* updateNicknameSelectedlb =ThemeManager::sharedInstance()->spriteWithImageFile("btn_update_nickname.png");
updateNicknameSelectedlb->setScale(1.1);
CCMenuItemSprite* pupdateNicknameItemSpritelb = CCMenuItemSprite::itemWithNormalSprite(updateNicknamelb, updateNicknameSelectedlb, this, menu_selector(LeaderBoard::updateNicknameClick));
pupdateNicknameItemSpritelb->setScale(LL_BUTTON_SCALE_VALUE);
CCMenu* pupdateNicknameMenu = CCMenu::menuWithItems(pupdateNicknameItemSpritelb,NULL);
pupdateNicknameMenu->setPosition(ccp(SCREEN_WIDTH*0.3, SCREEN_HEIGHT*0.15));
this->addChild(pupdateNicknameMenu, 3);
CCSprite* back2menuNormallb =ThemeManager::sharedInstance()->spriteWithImageFile("back2menu.png");
CCSprite* back2menuSelectedlb =ThemeManager::sharedInstance()->spriteWithImageFile("back2menu.png");
back2menuSelectedlb->setScale(1.1);
CCMenuItemSprite* pback2menuItemSpritelb = CCMenuItemSprite::itemWithNormalSprite(back2menuNormallb, back2menuSelectedlb, this, menu_selector(LeaderBoard::back2menuClick));
pback2menuItemSpritelb->setScale(LL_BUTTON_SCALE_VALUE);
CCMenu* pback2menuMenu = CCMenu::menuWithItems(pback2menuItemSpritelb,NULL);
pback2menuMenu->setPosition(ccp(SCREEN_WIDTH*0.7, SCREEN_HEIGHT*0.15));
this->addChild(pback2menuMenu, 3);
CCLayer *bg = CCLayer::create();
bg->setContentSize(CCSizeMake(SCREEN_WIDTH,SCREEN_HEIGHT*0.58));
bg->setAnchorPoint(ccp(0,0));
bg->setPosition(ccp(0,0));
char buff[16];
*buff = 0;
for(int i=0;i<10;i++){
int offsetHeight = SCREEN_HEIGHT*(0.63125-0.0583*i-0.08);
sprintf(buff,"%d ",i+1);
scoreLabel=CCLabelTTF::labelWithString(buff,CCSizeMake(300*LL_SCREEN_SCALE_VALUE,32), kCCTextAlignmentLeft,kCCVerticalTextAlignmentCenter,ThemeManager::sharedInstance()->getFontName(),36*LL_SCREEN_SCALE_VALUE);
scoreLabel->setPosition(ccp(SCREEN_WIDTH*0.43,offsetHeight));
scoreLabel->setColor(ThemeManager::sharedInstance()->getColor());
bg->addChild(scoreLabel, 4);
scoreLabel=CCLabelTTF::labelWithString(getNicknameByRank(i+1),CCSizeMake(300*LL_SCREEN_SCALE_VALUE,32), kCCTextAlignmentLeft,kCCVerticalTextAlignmentCenter,ThemeManager::sharedInstance()->getFontName(),36*LL_SCREEN_SCALE_VALUE);
scoreLabel->setPosition(ccp(SCREEN_WIDTH*0.50,offsetHeight));
scoreLabel->setColor(ThemeManager::sharedInstance()->getColor());
bg->addChild(scoreLabel, 4);
sprintf(buff,"%d ",getScore(i+1));
scoreLabel=CCLabelTTF::labelWithString(buff,CCSizeMake(150*LL_SCREEN_SCALE_VALUE,32), kCCTextAlignmentRight,kCCVerticalTextAlignmentCenter,ThemeManager::sharedInstance()->getFontName(),36*LL_SCREEN_SCALE_VALUE);
scoreLabel->setPosition(ccp(SCREEN_WIDTH*0.78,offsetHeight));
scoreLabel->setColor(ThemeManager::sharedInstance()->getColor());
bg->addChild(scoreLabel, 4);
}
CCScrollView * view = CCScrollView::create(CCSizeMake(SCREEN_WIDTH,SCREEN_HEIGHT*0.35), bg);
view->setDirection(kCCScrollViewDirectionVertical);
view->setContentSize( CCSizeMake(SCREEN_WIDTH,SCREEN_HEIGHT*0.58) );
view->setContentOffset(ccp(0,-SCREEN_HEIGHT*0.226));
view->setAnchorPoint(ccp(0,0));
view->setPosition(0,SCREEN_HEIGHT*0.305);
this->addChild(view,4);
sprintf(buff,"%d ",getBestScore());
scoreLabel=CCLabelTTF::labelWithString(buff,CCSizeMake(150*LL_SCREEN_SCALE_VALUE,32), kCCTextAlignmentRight,kCCVerticalTextAlignmentCenter,ThemeManager::sharedInstance()->getFontName(),36*LL_SCREEN_SCALE_VALUE);
scoreLabel->setPosition(ccp(SCREEN_WIDTH*0.78,SCREEN_HEIGHT*(0.62725-0.0583*6)));
scoreLabel->setColor(ThemeManager::sharedInstance()->getColor());
this->addChild(scoreLabel, 4);
scoreLabel=CCLabelTTF::labelWithString(getNickname(),CCSizeMake(300*LL_SCREEN_SCALE_VALUE,32), kCCTextAlignmentLeft,kCCVerticalTextAlignmentCenter,ThemeManager::sharedInstance()->getFontName(),36*LL_SCREEN_SCALE_VALUE);
scoreLabel->setPosition(ccp(SCREEN_WIDTH*0.51,SCREEN_HEIGHT*(0.62725-0.0583*6)));
scoreLabel->setColor(ThemeManager::sharedInstance()->getColor());
this->addChild(scoreLabel, 4);
/*char buff2[256];
*buff2 = 0;
sprintf(buff2,"%d %s",getUserRank(), getNickname());
scoreLabel=CCLabelTTF::labelWithString(buff2,CCSizeMake(330*LL_SCREEN_SCALE_VALUE,32), kCCTextAlignmentLeft,kCCVerticalTextAlignmentCenter,ThemeManager::sharedInstance()->getFontName(),36*LL_SCREEN_SCALE_VALUE);
scoreLabel->setPosition(ccp(SCREEN_WIDTH*0.43,SCREEN_HEIGHT*(0.63125-0.0583*7)));
scoreLabel->setColor(ThemeManager::sharedInstance()->getColor());
this->addChild(scoreLabel, 4);*/
return true;
}
示例6: init
bool ScrollScene::init()
{
if ( !RecipeBase::init() )
{
return false;
}
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
CCLayer* scrollContainer = CCLayer::create(); // Container for the scroll view
scrollContainer->setAnchorPoint(CCPointZero); // CCScrollView does this too when it's set as the container.
CCLayerColor* panelBg = CCLayerColor::create(ccc4(51, 51, 51, 255),640,2000);
panelBg->setPosition(ccp(0,0));
scrollContainer->addChild(panelBg,2);
// Content for the container
CCSprite *tallContentA = CCSprite::create("image/quest/05ev_210222.png");
tallContentA ->setPosition(ccp(winSize.width*0.5f, 700));
CCSprite *tallContentB = CCSprite::create("image/quest/07ev_210232.png");
tallContentB ->setPosition(ccp(winSize.width*0.5f, 200));
CCSprite *tallContentC = CCSprite::create("image/quest/07ev_210232.png");
tallContentC ->setPosition(ccp(winSize.width*0.5f, 900));
CCSprite *tallContentD = CCSprite::create("image/quest/07ev_210232.png");
tallContentD ->setPosition(ccp(winSize.width*0.5f, 1400));
scrollContainer->addChild(tallContentA, 2);
scrollContainer->addChild(tallContentB, 2);
scrollContainer->addChild(tallContentC, 2);
scrollContainer->addChild(tallContentD, 2);
float scrollContainerHeight = tallContentA->getContentSize().height + tallContentB->getContentSize().height;
scrollContainer->setPosition(CCPointZero);
scrollContainer->setContentSize(CCSizeMake(640, 2000));
// Set up scroll view
cocos2d::extension::CCScrollView* scrollView = cocos2d::extension::CCScrollView::create(ccp(640, 960), scrollContainer);
scrollView->setPosition(ccp(0, 100));
scrollView->setDirection(cocos2d::extension::kCCScrollViewDirectionVertical);
// ScrollView initializes at the (left, bottom). The container also gets positioned relative to that and goes Y-up.
// Pre-set it to the value CCScrollView::minContainerOffset will return when it's scrolled to the top
// (note, this is a negative number, indicating the touch moving downwards, i.e. it's pre-scrolled such that the top of the content is visible when we begin)
scrollView->setContentOffset(ccp(0, 0));
CCLOG("test : %f",winSize.height-scrollContainerHeight*1.05f);
/*
// (StackOverflow Post Edit: This hack is not required.)
// Hack: CCScrollView's maxContainerOffset is (0, 0) and minContainerOffset is (difference between view and content size which is negative)
// It's designed to be (left, bottom) based and positive scrolling means showing stuff above the top of the screen.
// Since we're using it in terms of Window coordinates ((left, top) based), we scale the scroll view
// and it's container's children by -1 and position the children differently
// (eg. Y position winSize.height*0.1f was changed to winSize.height*0.9f)
// We can't just set the scroll view's Y scale to -1 because CCNode::getScale asserts that X and Y scale must be the same.
scrollView->setScale(-1.f);
tallContentA->setScale(-1.f);
tallContentB->setScale(-1.f);
*/
this->addChild(scrollView);
return true;
}
示例7: addOneEmptyPage
void UIScrollPage::addOneEmptyPage(int pageIndex)
{
CCLayer* layer = CCLayer::create();
layer->setAnchorPoint(ccp(0, 0));
{
int deltaX, deltaY;
if(m_cellBinFile == "")
{
m_cellBinFile = KUI_BIN;
}
ASprite *as = AspriteManager::getInstance()->getAsprite(m_cellBinFile);
int idx = getResourceIDByName(m_cellAsfile.c_str());
int selectedId = getResourceIDByName(m_cellSelectedAsfile.c_str());
CCSize buttonSize = as->getframeRect(idx).size;
// float contentScale = CCDirector::sharedDirector()->getContentScaleFactor();
// buttonSize = CCSizeMake(buttonSize.width * contentScale, buttonSize.height * contentScale);
if (m_icolumn <= 1)
deltaX = 0;
else
deltaX = (getContentSize().width - 2 * m_celloffsetX - buttonSize.width) / (m_icolumn - 1);
if (m_irow <= 1)
deltaY = 0;
else
deltaY = (getContentSize().height - 2 * m_celloffsetY - buttonSize.height) / (m_irow - 1);
/////////////////////////////////////////////////////////////////////////////
// row
// row
for(int r = 0; r < (int)m_irow; r++)
{
for(int l = 0; l < (int) m_icolumn; l++)
{
// clone one ccsprite
CCPoint pt;
CCSprite *pEmptyItem = as->getSpriteFromFrame_Middle( idx, 0, pt);
CCSprite *pSelectedItem = as->getSpriteFromFrame_Middle(selectedId ,0,pt);
IconButton * pIcon = new IconButton(pEmptyItem, NULL, pSelectedItem, this,
menu_selector(UIScrollPage::OnItemClicked));
pIcon->autorelease();
int index = pageIndex * m_icolumn * m_irow;
index += r * m_icolumn + l;
pIcon->SetButtonIndex(index+1);
pIcon->setContentSize(pEmptyItem->getContentSize());
if(m_itemType != 0)
{
pIcon->creatDragReceiver((DragHandlerType)m_itemType);
}
pIcon->SetDoubleClickHandler(this,menu_selector(UIScrollPage::OnItemDoubleClicked));
pIcon->SetTappedHandler(this,menu_selector(UIScrollPage::OnTapped),menu_selector(UIScrollPage::OnTapCancel));
pIcon->SetDragFlagTime(150);
m_lstButton.push_back(pIcon);
int x = l * deltaX + m_celloffsetX + buttonSize.width / 2 - getContentSize().width / 2 ;
int y = getContentSize().height / 2 - (r * deltaY + m_celloffsetY + buttonSize.height / 2);
// x /= contentScale;
// y /= contentScale;
pIcon->setPosition(ccp(x, y));
char name[50];
sprintf(name,"%s_%d",this->m_strName.c_str(),index+1);
pIcon->SetButtonName(name);
layer->addChild(pIcon);
}
}
}
addPage(layer);
}
示例8: init
// on "init" you need to initialize your instance
bool HelloWorld::init()
{
//////////////////////////////
// 1. super init first
if ( !CCLayer::init() )
{
return false;
}
/////////////////////////////
// 2. add a menu item with "X" image, which is clicked to quit the program
// you may modify it.
// add a "close" icon to exit the progress. it's an autorelease object
CCMenuItemImage *pCloseItem = CCMenuItemImage::create(
"CloseNormal.png",
"CloseSelected.png",
this,
menu_selector(HelloWorld::menuCloseCallback) );
pCloseItem->setPosition( ccp(CCDirector::sharedDirector()->getWinSize().width - 20, 20) );
// create menu, it's an autorelease object
CCMenu* pMenu = CCMenu::create(pCloseItem, NULL);
pMenu->setPosition( CCPointZero );
this->addChild(pMenu, 1);
/////////////////////////////
// 3. add your codes below...
// add a label shows "Hello World"
// create and initialize a label
pLabel = CCLabelTTF::create("Hello World", "Thonburi", 34);
// ask director the window size
CCSize size = CCDirector::sharedDirector()->getWinSize();
// position the label on the center of the screen
pLabel->setPosition( ccp(size.width / 2, size.height - 20) );
// add the label as a child to this layer
this->addChild(pLabel, 1);
// CCScrollView
scrollView = CCScrollView::create();
CCLayer *layer = CCLayer::create();
CCSprite *sprite1 = CCSprite::create("HelloWorld.png");
CCSprite *sprite2 = CCSprite::create("HelloWorld.png");
layer->setAnchorPoint(CCPointZero);
layer->setPosition(CCPointZero);
// Menu
CCMenuItemSprite *menuItem1 = CCMenuItemSprite::create(sprite1, sprite1, this, menu_selector(HelloWorld::menu1Callback));
menuItem1->setPosition(ccpAdd(CCPointZero, ccp(size.width / 2, size.height / 2)));
menuItem1->setScale(0.4f);
CCMenuItemSprite *menuItem2 = CCMenuItemSprite::create(sprite2, sprite2, this, menu_selector(HelloWorld::menu2Callback));
menuItem2->setPosition(ccpAdd(ccp(480, 0), ccp(size.width / 2, size.height / 2)));
menuItem2->setScale(0.4f);
CCMenu *menu = CCMenu::create(menuItem1, menuItem2, NULL);
menu->setPosition(CCPointZero);
layer->addChild(menu);
scrollView->setPosition(CCPointZero);
scrollView->setContentOffset(CCPointZero);
layer->setContentSize(CCSizeMake(960, 320));
scrollView->setContentSize(CCSizeMake(480, 320));
scrollView->setContainer(layer);
// 设置滚屏属性
scrollView->setDirection(CCScrollViewDirectionHorizontal);
scrollView->setDelegate(this);
this->addChild(scrollView);
return true;
}
示例9: InitSprites
void RankUp::InitSprites()
{
// background
pBackground = CCSprite::create("images/splash/main_background.png");
pBackground->setAnchorPoint(ccp(0, 0));
pBackground->setPosition(ccp(0, 0));
this->addChild(pBackground, 0);
// strap
spriteClass->spriteObj.push_back( SpriteObject::Create(0, "strap_yellow.png", ccp(0, 0), ccp(14, 1506), CCSize(0, 0), "", "RankUp", this, 1) );
spriteClass->spriteObj.push_back( SpriteObject::Create(0, "strap_title_rankup.png", ccp(0.5, 0), ccp(winSize.width/2, 1552), CCSize(0, 0), "", "RankUp", this, 1) );
// pop-up 배경
spriteClass->spriteObj.push_back( SpriteObject::Create(1, "background/bg_board_brown.png", ccp(0, 0), ccp(49, 640), CCSize(982, 623), "", "RankUp", this, 1) );
spriteClass->spriteObj.push_back( SpriteObject::Create(1, "background/bg_board_yellow.png", ccp(0, 0), ccp(76, 678), CCSize(929, 562), "", "RankUp", this, 1) );
//spriteClass->spriteObj.push_back( SpriteObject::Create(0, "background/bg_popup_rightup.png", ccp(0, 0), ccp(809, 1039), CCSize(0, 0), "", "RankUp", this, 1) );
//spriteClass->spriteObj.push_back( SpriteObject::Create(0, "button/btn_x_brown.png", ccp(0, 0), ccp(900, 1132), CCSize(0, 0), "", "RankUp", this, 1) );
// 자랑하기 버튼
spriteClass->spriteObj.push_back( SpriteObject::Create(0, "button/btn_red_mini.png1", ccp(0, 0), ccp(126, 711), CCSize(0, 0), "", "RankUp", this, 5) );
spriteClass->spriteObj.push_back( SpriteObject::Create(0, "letter/letter_boast.png", ccp(0.5, 0), ccp(spriteClass->spriteObj[spriteClass->spriteObj.size()-1]->sprite->getContentSize().width/2-1, 24), CCSize(0, 0), "button/btn_red_mini.png1", "0", NULL, 5, 1) );
// 확인 버튼
spriteClass->spriteObj.push_back( SpriteObject::Create(0, "button/btn_red_mini.png2", ccp(0, 0), ccp(717+5, 711), CCSize(0, 0), "", "RankUp", this, 5) );
spriteClass->spriteObj.push_back( SpriteObject::Create(0, "letter/letter_confirm_mini.png",ccp(0.5, 0), ccp(spriteClass->spriteObj[spriteClass->spriteObj.size()-1]->sprite->getContentSize().width/2, 24), CCSize(0, 0), "button/btn_red_mini.png2", "0", NULL, 5, 1) );
// 내 순위와 점수 찾기
int myRank;
int myScore;
for (int i = 0 ; i < friendList.size() ; i++)
{
if (friendList[i]->GetKakaoId() == myInfo->GetKakaoId())
{
myScore = friendList[i]->GetWeeklyHighScore();
myRank = i+1;
break;
}
}
// 점수
char number[20];
sprintf(number, "%d", myScore);
CCLayer* pScoreLayer = Common::MakeImageNumberLayer(number, 2);
float offset = pScoreLayer->getContentSize().width/2;
pScoreLayer->setAnchorPoint(ccp(0, 0));
pScoreLayer->setPosition(ccp(winSize.width/2-offset, 840));
spriteClass->layers.push_back(pScoreLayer);
this->addChild(pScoreLayer, 6);
// 순위
sprintf(number, "%d위", myRank);
spriteClass->spriteObj.push_back( SpriteObject::CreateLabel(number, fontList[0], 48, ccp(0.5, 0.5), ccp(winSize.width/2, 970), ccc3(78,47,8), "", "RankUp", this, 5) );
// 프로필
CCLayer* profileLayer = CCLayer::create();
spriteClass->layers.push_back(profileLayer);
this->addChild(profileLayer, 6);
int height = 1100;
char name[40];
ProfileSprite* psp = ProfileSprite::GetObj(friendList[myRank]->GetImageUrl());
if (friendList[myRank]->GetImageUrl() != "" && psp->IsLoadingDone())
{
spriteClass->spriteObj.push_back( SpriteObject::CreateFromSprite(0, psp->GetProfile(), ccp(0.5, 0.5), ccp(winSize.width/2, height), CCSize(0,0), "", "Layer", profileLayer, 5, 0, 255, 1.45f*0.95f) );
sprintf(name, "background/bg_profile.png1");
spriteClass->spriteObj.push_back( SpriteObject::Create(0, name, ccp(0.5, 0.5), ccp(winSize.width/2, height), CCSize(0,0), "", "Layer", profileLayer, 6, 1) );
((CCSprite*)spriteClass->FindSpriteByName(name))->setScale(1.45f);
}
else
{
spriteClass->spriteObj.push_back( SpriteObject::CreateFromSprite(0, psp->GetProfile(), ccp(0.5, 0.5), ccp(winSize.width/2, height), CCSize(0,0), "", "Layer", profileLayer, 5, 0, 255, 1.2f) );
}
int dist = 700;
psp = ProfileSprite::GetObj(friendList[myRank-1]->GetImageUrl());
if (friendList[myRank-1]->GetImageUrl() != "" && psp->IsLoadingDone())
{
spriteClass->spriteObj.push_back( SpriteObject::CreateFromSprite(0, psp->GetProfile(), ccp(0.5, 0.5), ccp(winSize.width/2+dist, height), CCSize(0,0), "", "Layer", profileLayer, 5, 0, 255, 1.45f*0.95f) );
sprintf(name, "background/bg_profile.png2");
spriteClass->spriteObj.push_back( SpriteObject::Create(0, name, ccp(0.5, 0.5), ccp(winSize.width/2+dist, height), CCSize(0,0), "", "Layer", profileLayer, 6, 1) );
((CCSprite*)spriteClass->FindSpriteByName(name))->setScale(1.45f);
}
else
{
spriteClass->spriteObj.push_back( SpriteObject::CreateFromSprite(0, psp->GetProfile(), ccp(0.5, 0.5), ccp(winSize.width/2+dist, height), CCSize(0,0), "", "Layer", profileLayer, 5, 0, 255, 1.3f) );
}
pBlackOpen = CCSprite::create("images/ranking_scrollbg.png", CCRectMake(0, 0, winSize.width, winSize.height));
pBlackOpen->setAnchorPoint(ccp(0, 0));
pBlackOpen->setPosition(ccp(0, 0));
pBlackOpen->setColor(ccc3(0,0,0));
this->addChild(pBlackOpen, 4000);
for (int i = 0 ; i < spriteClass->spriteObj.size() ; i++)
spriteClass->AddChild(i);
/*
//.........这里部分代码省略.........