本文整理汇总了C++中TableViewCell::addChild方法的典型用法代码示例。如果您正苦于以下问题:C++ TableViewCell::addChild方法的具体用法?C++ TableViewCell::addChild怎么用?C++ TableViewCell::addChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TableViewCell
的用法示例。
在下文中一共展示了TableViewCell::addChild方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tableCellAtIndex
TableViewCell* TableViewTestLayer::tableCellAtIndex(TableView *table, unsigned int idx)
{
String *string = String::createWithFormat("%d", idx);
TableViewCell *cell = table->dequeueCell();
if (!cell) {
cell = new CustomTableViewCell();
cell->autorelease();
Sprite *sprite = Sprite::create("Images/Icon.png");
sprite->setAnchorPoint(Point::ZERO);
sprite->setPosition(Point(0, 0));
cell->addChild(sprite);
LabelTTF *label = LabelTTF::create(string->getCString(), "Helvetica", 20.0);
label->setPosition(Point::ZERO);
label->setAnchorPoint(Point::ZERO);
label->setTag(123);
cell->addChild(label);
}
else
{
LabelTTF *label = (LabelTTF*)cell->getChildByTag(123);
label->setString(string->getCString());
}
return cell;
}
示例2: tableCellAtIndex
TableViewCell* TableViewTest::tableCellAtIndex(TableView *table, ssize_t idx)
{
auto string = String::createWithFormat("%ld", idx);
TableViewCell *cell = table->dequeueCell();
if (!cell) {
cell = new (std::nothrow) CustomTableViewCell();
cell->autorelease();
auto sprite = Sprite::create("Images/Icon.png");
sprite->setAnchorPoint(Vec2::ZERO);
sprite->setPosition(Vec2(0, 0));
cell->addChild(sprite);
auto label = Label::createWithSystemFont(string->getCString(), "Helvetica", 20.0);
label->setPosition(Vec2::ZERO);
label->setAnchorPoint(Vec2::ZERO);
label->setTag(123);
cell->addChild(label);
}
else
{
auto label = (Label*)cell->getChildByTag(123);
label->setString(string->getCString());
}
return cell;
}
示例3: tableCellAtIndex
TableViewCell* SkillTableView::tableCellAtIndex(TableView *table, ssize_t idx)
{
CCString* str = CCString::createWithFormat("ui/skill/skill_%d.png",2001 + (int)idx);
TableViewCell* cell = table->dequeueCell();
if (!cell)
{
cell = new TableViewCell();
cell->autorelease();
Scale9Sprite* bg = Scale9Sprite::create("ui/cell.png");
bg->setAnchorPoint(Point::ZERO);
bg->setPosition(Point::ZERO);
bg->setPreferredSize(Size(420, 80));
cell->addChild(bg);
Sprite* skill = Sprite::create(str->getCString());
skill->setPosition(Point(50, 40));
cell->addChild(skill, 0, 123);
m_skillVec.push_back(skill);
}
else
{
Sprite* skill = (Sprite*)cell->getChildByTag(123);
Texture2D* texture = Director::getInstance()->getTextureCache()->addImage(str->getCString());
skill->setTexture(texture);
}
cell->setTag(2001+(int)idx);
return cell;
}
示例4: tableCellAtIndex
TableViewCell* SelectMissionScene::tableCellAtIndex(TableView *table, ssize_t idx)
{
log("%d:geted!", idx);
GameManager *manager = GameManager::getInstance();
MissionInfoItem *info = MissionInfoItem::create(manager->getMissionStatus()[idx]);
TableViewCell *cell = table->dequeueCell();
if(!cell)
{
cell = TableViewCell::create(); //or cell = new TTableViewCell(); cell->autorelease()
}
else
{
MissionInfoItem *tmp = static_cast<MissionInfoItem *>(cell->getChildByTag(100));
tmp->removeFromParent();
}
info->setAnchorPoint(Vec2::ZERO);
info->setPosition(Vec2::ZERO);
info->setTag(100);
cell->addChild(info);
#ifdef TEST
/************ Test TableView ******************/
auto index_text = __String::createWithFormat("%ld",idx + 1);
if(!cell)
{
Label *label = Label::create(index_text->getCString(), "Marker Felt.ttf", 18);
label->setPosition( 80, 50 );
label->setTag(150);
cell = TableViewCell::create();
Sprite *sprite = Sprite::create("lock.png");
sprite->setPosition(270, 50);
sprite->setTag(100);
cell->addChild(label );
cell->addChild(sprite);
}
else
{
Label *label = static_cast<Label *>(cell->getChildByTag(150));
label->setString(index_text->getCString());
}
#endif // TEST
return cell;
}
示例5: tableCellAtIndex
//生成列表每一项的内容
TableViewCell* RankScene::tableCellAtIndex(TableView *table, ssize_t idx)
{
Size mysize = Director::getInstance()->getVisibleSize();
Vec2 origin = Director::getInstance()->getVisibleOrigin();
//读取数据
string str = opt + "_" + Global::shareGlobal()->iToS(idx + 1, 0);
TableViewCell* cell = table->cellAtIndex(idx);
if (!cell)
{
cell = new TableViewCell();
cell->autorelease();
Sprite *item = Sprite::create("tb.png");
item->setPosition(Vec2(origin.x + 180, 15));
cell->addChild(item);
string data = CCUserDefault::sharedUserDefault()->getStringForKey(str.c_str(), "");
//cocos2d::CCMessageBox(t.c_str(),num.c_str());
//return cell;
if (data != "")
{
string t = "";
string num = "";
string score = "";
int i = 0;
while (data[i] != ' ') t += data[i++]; i++; //时间
while (data[i] != ' ') num += data[i++]; i++; //步数
while (i < (int)data.length()) score += data[i++]; //分数
Label *item1 = Label::createWithTTF(Global::shareGlobal()->iToS(idx + 1, 0).c_str(), "fonts/arial.ttf", 18);
Label *item2 = Label::createWithTTF(t.c_str(), "fonts/arial.ttf", 18);
Label *item3 = Label::createWithTTF(num.c_str(), "fonts/arial.ttf", 18);
Label *item4 = Label::createWithTTF(score.c_str(), "fonts/arial.ttf", 18);
item1->setPosition(Vec2(origin.x + 30, 15));
item2->setPosition(Vec2(origin.x + 120, 15));
item3->setPosition(Vec2(origin.x + 210, 15));
item4->setPosition(Vec2(origin.x + 300, 15));
cell->addChild(item1);
cell->addChild(item2);
cell->addChild(item3);
cell->addChild(item4);
}
}
return cell;
}
示例6: tableCellAtIndex
TableViewCell* GameChallengeMap::tableCellAtIndex(TableView* table,ssize_t idx)
{
std::string id = StringUtils::format("%d", idx+1);
TableViewCell *cell = table->dequeueCell();
if (1) {
cell = new TableViewCell();
cell->autorelease();
Sprite* bg = Sprite::create(RESOURCE("map_002.png"));
if (idx%2) {
bg->setTexture(RESOURCE("map_001.png"));
}
bg->setFlippedX(fileMap);
bg->setAnchorPoint(Point(0, 0));
bg->setTextureRect(Rect(0,0,window_size.width,window_size.height));
cell->addChild(bg);
// ID部分
auto *label = Label::createWithSystemFont(id.c_str(), "Arial", 20);
label->setAnchorPoint(Point(0, 0));
label->setPosition(Point(50, 0));
label->setColor(Color3B(0,0,0));
cell->addChild(label);
if (idx>=(12-ci_NormalMissionNum/10)) //如果130关,就是13,但必须是10的整数倍
{
int missionId=120-idx*10; //本单元最大关卡ID
for (int i=0;i<10;++i)
{
GameChallengeMission* mission = GameChallengeMission::create();
mission->setTag(missionId);
mission->setAnchorPoint(Vec2::ZERO);
//取得关卡ID对应的坐标
Vec2 temp=GameUIData::getInstance()->getNormalMissionPos(missionId);
mission->setPosition(temp);
cell->addChild(mission);
mission->setMissionPorperty(missionId);
mission->missionShow(missionId);
--missionId;
}
}
}
return cell;
}
示例7: tableCellAtIndex
// セルの内容を設定
TableViewCell* Overview::tableCellAtIndex(TableView *table, ssize_t idx){
std::string id = StringUtils::format("%zd", idx);
std::string text = StringUtils::format("Line %zd", idx);
TableViewCell *cell = table->dequeueCell();
cell = new TableViewCell();
cell->autorelease();
// セルの背景
auto background_color = Color3B(255,255,255);
if (idx%2) {
background_color = Color3B(200,200,200);
}
Sprite* bg = Sprite::create();
bg->setAnchorPoint(Point(0, 0));
bg->setTextureRect(Rect(0, 0, window_size.width, 24));
bg->setColor(background_color);
bg->setTag(100);
cell->addChild(bg, 0);
// ボーダーライン
Sprite* line = Sprite::create();
line->setAnchorPoint(Point(0, 0));
line->setTextureRect(Rect(0, 0, window_size.width, 1));
line->setColor(Color3B(0,0,0));
cell->addChild(line, 1);
//Story取得
auto story = story_list.begin() + idx;
// ID部分
auto *label_1 = LabelTTF::create(story.operator*()->getTitle().c_str(), "Arial", 16);
label_1->setAnchorPoint(Point(0, 0));
label_1->setPosition(Point(10, 0));
label_1->setColor(Color3B(0,0,0));
cell->addChild(label_1, 1);
return cell;
}
示例8: tableCellAtIndex
TableViewCell* MainScene::tableCellAtIndex(TableView *table, ssize_t idx)
{
TableViewCell *cell = cell = new (std::nothrow) CustomTableViewCell();
cell->autorelease();
auto sprite = Sprite::create(menuImages[idx%length]);
sprite->setAnchorPoint(Vec2::ZERO);
sprite->setPosition(Vec2(0, 0));
cell->addChild(sprite);
cell->setContentSize(Size(100,200));
sprite->setContentSize(Size(110,200));
Size cellSize = cell->getContentSize();
auto label = Label::createWithSystemFont(menuTitile[idx%length], "微软雅黑", 16);
Size lableSize = label->getContentSize();
label->setPosition(50, 30);
label->setTag(123);
cell->addChild(label);
return cell;
}
示例9: tableCellAtIndex
/**
* a cell instance at a given index
*
* @param idx index to search for a cell
* @return cell found at idx
*/
TableViewCell* RTChatList::tableCellAtIndex(TableView *table, ssize_t idx)
{
TableViewCell* cell = table->dequeueCell();
if (!cell) {
cell = TableViewCell::create();
}
if (cell) {
cell->removeAllChildren();
auto n = _sayNodeList.at(idx);
n->removeFromParent();
cell->setContentSize(Size(table->getContentSize().width, Default_Cell_Offset_Height + n->getContentSize().height + Default_Cell_Offset_Height));
#if COCOS2D_DEBUG
if (idx % 2 == 0) {
DbgHelper::colorRect(cell,
Point(cell->getContentSize().width / 2.0, cell->getContentSize().height / 2.0), cell->getContentSize(),
Color4F::RED);
}
else {
DbgHelper::colorRect(cell,
Point(cell->getContentSize().width / 2.0, cell->getContentSize().height / 2.0), cell->getContentSize(),
Color4F::YELLOW);
}
#endif
if (n->getFormType() == RTChatNode::FormType::BORDERED) {
if (n->getOwnType() == RTChatNode::OwnType::SELF) {
n->setPosition(Point(cell->getContentSize().width / 2.0 + Default_Cell_Offset_Width, cell->getContentSize().height / 2.0));
}
else {
n->setPosition(Point(cell->getContentSize().width / 2.0 - Default_Cell_Offset_Width, cell->getContentSize().height / 2.0));
}
}
else {
n->setPosition(Point(cell->getContentSize().width / 2.0, cell->getContentSize().height / 2.0));
}
cell->addChild(n);
}
return cell;
}
示例10: tableCellAtIndex
TableViewCell* GCScoreTable::tableCellAtIndex(cocos2d::extension::TableView *table, ssize_t idx)
{
TableViewCell* cell = table->dequeueCell();
if(!cell)
{
cell = new TableViewCell();
cell->autorelease();
}
cell->removeAllChildrenWithCleanup(true);
log("idx = %zd",idx);
Ref* data = _result->getData().at(idx);
Layer* item = this->createCell(data, idx);
cell->addChild(item);
return cell;
}
示例11: tableCellAtIndex
TableViewCell* HelloWorld::tableCellAtIndex(cocos2d::extension::TableView *table, ssize_t idx){
TableViewCell *cell = table->dequeueCell();
LabelTTF *label;
if(cell == NULL){
cell = TableViewCell::create();
label = LabelTTF::create();
label->setTag(2);
cell->addChild(label);
label->setFontSize(30);
label->setAnchorPoint(Point(0,0));
}
else {
label = (LabelTTF*)cell->getChildByTag(2);
}
label->setString(StringUtils::format("Label %ld",idx));
return cell;
};
示例12: tableCellAtIndex
TableViewCell* TaskDialog::tableCellAtIndex(cocos2d::extension::TableView *table, ssize_t idx)
{
TableViewCell *cell = table->dequeueCell();
if (!cell)
{
cell = new TableViewCell();
cell->autorelease();
if (tableViewCellNode)
{
tableViewCellNode->setTag(10);
int h = tableViewCellNode->getContentSize().height;
h = h>tableViewSize.height?h:tableViewSize.height;
tableViewCellNode->setPosition(ccp(0, h));
cell->addChild(tableViewCellNode);
}
}
else
{
int h = tableViewCellNode->getContentSize().height;
h = h>tableViewSize.height?h:tableViewSize.height;
tableViewCellNode->setPosition(ccp(0, h));
}
return cell;
}
示例13: tableCellAtIndex
TableViewCell* CMyTableView::tableCellAtIndex(TableView *table, ssize_t idx)
{
const int tagLabel = 666;
const int tagSprite = 777;
bool hasData = true;
TableViewCell *pCell = table->dequeueCell();
if( !pCell )
{
pCell = new TableViewCell();
pCell->autorelease();
hasData = false;
}
else
{
pCell->removeChildByTag( tagSprite );
if( idx != m_lastTouchIdx && pCell->getChildByTag(E_Tag_SelectBg) )
{
pCell->removeChildByTag( E_Tag_SelectBg );
}
}
if( idx >= m_viewData.size() )
{
CCLog( "[CMyTableView::tableCellAtIndex]Error. idx(%d) greater than data.Size(%d)", (int)idx, (int)m_viewData.size() );
return NULL;
}
int off = 5;
int x = off;
CCSprite *pSprite = NULL;
if( m_viewData[idx].useRect )
{
pSprite = CCSprite::create( m_viewData[idx].icon.c_str(), m_viewData[idx].iconRect );
}
else
{
pSprite = CCSprite::create( m_viewData[idx].icon.c_str() );
}
if( pSprite )
{
CCSize sz = pSprite->getContentSize();
float scale = m_cellSz.height / sz.height;
sz = sz * scale;
pSprite->setScale( scale );
pSprite->setPosition(
ccp( sz.width/2 + off, m_cellSz.height/2) );
pCell->addChild( pSprite, 1, tagSprite );
x += (pSprite->getContentSize().width * scale) + off;
}
else
{
CCLog( "[CMyTableView::tableCellAtIndex]Error. can not load sprite:%s", m_viewData[idx].icon.c_str() );
}
CCLabelTTF *pLabel = NULL;
if( hasData )
{
pLabel = (CCLabelTTF*)pCell->getChildByTag( tagLabel );
CCAssert( pLabel, "get label child error" );
pLabel->setString( m_viewData[idx].text.c_str() );
}
else
{
pLabel = CCLabelTTF::create( m_viewData[idx].text.c_str(), "Arial", 20.0 );
pCell->addChild( pLabel, 1 );
}
if( pLabel )
{
pLabel->setAnchorPoint( ccp(0.5, 0.5) );
pLabel->setPosition( ccp(x + pLabel->getContentSize().width/2, m_cellSz.height/2) );
pLabel->setTag( tagLabel );
pLabel->setColor( ccBLACK );
}
// 判断是否要重新加上选中的背景
if( idx == m_lastTouchIdx && !pCell->getChildByTag(E_Tag_SelectBg) )
{
_AddSelectBg( pCell );
m_lastTouchCell = pCell;
}
pCell->setUserData( m_viewData[idx].data );
return pCell;
}
示例14: tableCellAtIndex
//设计单元格内容;
TableViewCell* OverTableView::tableCellAtIndex(TableView *table,ssize_t idx)
{
CCLOG(" ~(^OO^)~ %d",idx);
std::string id = StringUtils::format("%ld", idx+1);
TableViewCell *cell = table->dequeueCell();
cell = new TableViewCell();
cell->autorelease();
cell->setLocalZOrder(idx+1);
string filename = StringUtils::format("mapbg/map_00%ld.png",ci_MapNum-(idx)%ci_MapNum);
Sprite* bg_left = Sprite::create(RESOURCE(filename));
bg_left->setFlippedX(false);
bg_left->setAnchorPoint(Point(0, 0));
bg_left->setPosition(Vec2::ZERO);
cell->addChild(bg_left);
if (!idx)
{
Sprite* expect = Sprite::create(RESOURCE("mapbg/map_jqqd.png"));
expect->setAnchorPoint(Vec2(0.5f,0.5f));
expect->setPosition(Vec2(GLB_SIZE.width*0.5,GLB_SIZE.height-300));
bg_left->addChild(expect,Z_First);
}
Sprite* bg_right = Sprite::create(RESOURCE(filename));
bg_right->setFlippedX(true);
bg_right->setAnchorPoint(Point(0, 0));
bg_right->setPosition(Vec2(639,0));
cell->addChild(bg_right);
if (!idx)
{
Sprite* expect = Sprite::create(RESOURCE("mapbg/map_jqqd.png"));
expect->setAnchorPoint(Vec2(0.5f,0.5f));
expect->setPosition(Vec2(GLB_SIZE.width*0.5,GLB_SIZE.height-300));
bg_right->addChild(expect,Z_First);
}
// ID部分
auto *label_left = Label::createWithSystemFont(id.c_str(),"Arial",20);
label_left->setAnchorPoint(Point(0, 0));
label_left->setPosition(Point(50, 0));
label_left->setColor(Color3B(0,0,0));
//cell->addChild(label_left);
auto *label_right = Label::createWithSystemFont(id.c_str(),"Arial",20);
label_right->setAnchorPoint(Point(0, 0));
label_right->setPosition(Point(50+639, 0));
label_right->setColor(Color3B(0,0,0));
//cell->addChild(label_right);
// vec_normalMissionBack.clear();
// for (int i=0;i<vec_normalMission.size();i++)
// {
// vec_normalMissionBack.push_back(vec_normalMission.at(i));
// }
vec_normalMission.clear();
m_mapNormalMission[idx].clear();
//布置普通关卡;
if (idx>=ci_MapNum-ci_NormalMissionNum/10) //如果130关,就是13,但必须是10的整数倍;
{
int missionId=10*ci_MapNum-idx*10; //本单元最大关卡ID;
for (int i=0;i<10;++i)
{
GameNormalMission* mission_left = GameNormalMission :: create();
mission_left->m_nMissionId = missionId;
mission_left->setTag(missionId);
mission_left->setAnchorPoint(Vec2::ZERO);
//取得关卡ID对应的坐标;
Vec2 temp=GameUIData::getInstance()->getNormalMissionPos(missionId);
mission_left->setPosition(temp);
cell->addChild(mission_left);
vec_normalMission.push_back(mission_left);
mission_left->setMissionPorperty(missionId);
mission_left->missionShow(missionId);
--missionId;
}
m_mapNormalMission[ci_MapNum-1-idx]=vec_normalMission;
}
// 特殊关卡蒙灰;
m_pMengBan = Sprite :: create(RESOURCE("overlay_map.png"));
m_pMengBan->setAnchorPoint(Vec2::ZERO);
m_pMengBan->setPosition(Vec2(GLB_SIZE.width,0));
m_pMengBan->setOpacity(120);
cell->addChild(m_pMengBan,Z_Second);
// 设置混合模式;
BlendFunc cbl = {GL_DST_COLOR,GL_ONE_MINUS_SRC_ALPHA};
m_pMengBan->setBlendFunc(cbl);
auto pFog = Sprite::create(RESOURCE("wuqi_ddt.png"));
pFog->setAnchorPoint(Vec2::ZERO);
pFog->setPosition(Vec2(GLB_SIZE.width,0));
cell->addChild(pFog,Z_Third);
//布置特殊关卡;
//.........这里部分代码省略.........
示例15: tableCellAtIndex
TableViewCell* FriendListScene::tableCellAtIndex(TableView *table, ssize_t idx)
{
int index = idx;
EziFacebookFriend* myFriend = (EziFacebookFriend*)_friendList.at(index);
std::string friendName = myFriend->getName();
//const char* photoPath = myFriend->getPhotoPath().c_str();
bool toRequestForPhoto = false;
if (myFriend->getPhoto() == nullptr)
{
toRequestForPhoto = true;
//EziSocialObject::sharedObject()->getProfilePicForID(this, myFriend->getFBID(), SCALED_VALUE(85.0f), SCALED_VALUE(85.0f), false);
}
// Build the table cell.
TableViewCell *cell = table->cellAtIndex(idx);
if (cell == NULL)
{
cell = new TableViewCell();
cell->autorelease();
LayerColor* colorLayer = LayerColor::create(Color4B(100, 100, 100, 200),
AppDelegate::SCREEN_WIDTH - SCALED_VALUE(20.0f),
SCALED_VALUE(124.0f));
//cell->addChild(colorLayer);
LayerColor* photoLayer = LayerColor::create(Color4B(255, 255, 255, 255),
SCALED_VALUE(100.0f),
SCALED_VALUE(100.0f));
photoLayer->setPosition(SCALED_VALUE(40.0f), SCALED_VALUE(12.0f));
cell->addChild(photoLayer);
Sprite* userPhotoSprite = NULL;
if (toRequestForPhoto)
{
userPhotoSprite = Sprite::create();
userPhotoSprite->setContentSize(Size(SCALED_VALUE(85.0f), SCALED_VALUE(85.0f)));
}
else
{
userPhotoSprite = myFriend->getPhoto(CC_CALLBACK_2(FriendListScene::applyPhoto, this),
false,
SCALED_VALUE(85.0f),
SCALED_VALUE(85.0f));
if (userPhotoSprite == nullptr) { userPhotoSprite = Sprite::create(); }
}
cell->addChild(userPhotoSprite);
userPhotoSprite->setAnchorPoint(Point(0.0f, 0.0));
userPhotoSprite->cocos2d::CCNode::setPosition(SCALED_VALUE(47.0f), SCALED_VALUE(18.0f));
userPhotoSprite->setTag(TAG_PHOTO);
auto message = LabelTTF::create(friendName.c_str(), "Arial", SCALED_VALUE(30.0f));
message->setAnchorPoint(Point(0, 0.5));
message->setPosition(Point(photoLayer->getContentSize().width + photoLayer->getPositionX() + SCALED_VALUE(20.0f),
colorLayer->getContentSize().height/2));
cell->addChild(message);
message->setTag(TAG_MESSAGE);
/*
Sprite* consumedIcon = Sprite::createWithSpriteFrameName("green_tick");
consumedIcon->setAnchorPoint(Point(1.0, 0.5));
cell->addChild(consumedIcon);
consumedIcon->setPosition(Point(colorLayer->getContentSize().width - SCALED_VALUE(20.0f),
colorLayer->getContentSize().height/2));
message->setTag(TAG_CONSUMED_ICON);
MenuItemImage* useButton = MenuItemImage::create();
useButton->setSelectedSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName("btn_use_prd"));
useButton->setNormalSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName("btn_use_nrl"));
useButton->setAnchorPoint(Point(1.0, 0.5));
useButton->setTarget(this, menu_selector(FriendListScene::useRequest));
Menu* useMenu = Menu::create(useButton, NULL);
cell->addChild(useMenu);
useMenu->setPosition(Point(colorLayer->getContentSize().width - SCALED_VALUE(20.0f),
colorLayer->getContentSize().height/2));
useButton->setTag(index);
useMenu->setTag(TAG_USE_MENU);
*/
}
else
{
Sprite* cellProfilePic = (Sprite*)cell->getChildByTag(TAG_PHOTO);
if (toRequestForPhoto == false)
{
//cellProfilePic->setTexture(Sprite::create(myFriend->getPhotoPath())->getTexture());
Sprite* tempSprite = myFriend->getPhoto();
if (myFriend->getPhoto() != nullptr)
{
cellProfilePic->setTexture(tempSprite->getTexture());
}
//.........这里部分代码省略.........