Cocos2d-x get texture from image
CCTexture2D* Global::getTextureFromImage(const char* imageName) {
CCTexture2D *texture;
string filePath = CCFileUtils::sharedFileUtils()->fullPathForFilename(imageName);
texture = CCTextureCache::sharedTextureCache()->addImage(imageName);
return texture;
}
CCTexture2D *texture;
string filePath = CCFileUtils::sharedFileUtils()->fullPathForFilename(imageName);
texture = CCTextureCache::sharedTextureCache()->addImage(imageName);
return texture;
}
Comments
Post a Comment