Hi… i try use this example:
// Generate a nice image
unsigned char* pData = new unsigned char[width * height * bytesPerComponent];
for (int x=0; xinitWithMemoryData(pData, width, height, (bytesPerComponent == 4) ? true : false);
// Add to CCTextureCache and start using it as a texture
CCTexture2D* tex = CCTextureCache::sharedTextureCache()->addUIImage(img, "key_name");
// Yeay, we've got a blue texture now, show it on a sprite
CCSprite* sprite = CCSprite::spriteWithTexture(tex, size_argument);
But, the method initWithMemoryData dont exist :S ….
My idea is to send a byte array from java to cocos2d-x and converts it into an image to be loaded by this CCSprite. The two days I’m trying to do this but can not find solution.
I also tried in java, save the image on the SD Card and the cocos2d (c++) to load the image, but without success. This is all because I can not work with CCImage.
Please tell me if you can do what I’m trying to do, if you can upload an image sent by JNI or charge via SD card, without the assets.
Thank you. (Sorry for my bad English)