#include "TestWallFlower.h"
#include "cocos2d.h"
#include "CCWebSprite.h"
#include "extensions/cocos-ext.h"
#include "ui/CocosGUI.h"
#include "network/HttpClient.h"
#include <string>
using namespace cocos2d::network;
USING_NS_CC;
USING_NS_CC_EXT;
using namespace ui;
TestWallFlower::TestWallFlower():
maxRow(0)
{
}
TestWallFlower::~TestWallFlower()
{
HttpClient::destroyInstance();
}
Scene* TestWallFlower::creaScene()
{
auto scene=Scene::create();
auto layer=TestWallFlower::create();
scene->addChild(layer);
return scene;
}
bool TestWallFlower::init()
{
if(!Layer::init()){
return false;
}
ListView* listView = ListView::create();
// set list view ex direction
listView->setDirection(SCROLLVIEW_DIR_HORIZONTAL);
listView->setTouchEnabled(true);
listView->setBounceEnabled(true);
listView->setSize(Size(640, 9
cocos2dx下载网络图片保存在本地
最新推荐文章于 2019-03-22 17:00:08 发布
这篇博客展示了如何在cocos2dx项目中下载网络图片并将其保存到本地。通过创建ListView展示多个图片,并在后台异步下载图片,完成下载后将图片保存到可写路径下,然后添加到场景中显示。
摘要由CSDN通过智能技术生成