cocos2dx ImageView使用

1:
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile(“*.plist”);
ImageView* image = ImageView::create();
image->loadTexture(“*.png”, TextureResType::UI_TEX_TYPE_PLIST);
image->setPosition(ccp(2, 100));
image->setZOrder(3);
widget->addChild(image);
2:
引用头文件:#include “ui/UIImageView.h”
using namespace cocos2d::ui;
auto img = ImageView::create(filename);
if (img != nullptr)
{
img->setPosition(ccp(1,1));
this->addchild(filename);
}

你可能感兴趣的:(cocos2d-x)