@q734809128 写道:
android里在上面路径保存了一张图片,然后使用这个图片创建sprite失败,报Get Image from file(/data/data/com.sgcraft/files/headSelf.jpg) failed!错误
使用下面代码创建的CCImage* img = new CCImage();
img->initWithImageFile(fullpath.c_str());
CCTexture2D* texture = new CCTexture2D();
texture->initWithImage(img);CCSprite *sprite = CCSprite::create(); sprite->initWithTexture(texture); sprite->setPosition(ccp(10,320)); CCDirector::sharedDirector()->getRunningScene()->addChild(sprite);
fullpath = /data/data/com.sgcraft/files/headSelf.jpg
帖子: 1
参与者: 1