0

I have already stored some images in CCTextureCache using the following line of code :

CCTextureCache.sharedTextureCache().addImage("image.png");

Now I am facing the problem in getting those stored images. Can someone help me with this? Someone please tell me how to fetch these images so that I can display them.

R.R.M
  • 780
  • 4
  • 10
  • try `textureForKey("image.png")` and then after getting the texture - load it in a sprite - [here](http://www.cocos2d-x.org/docs/api-ref/cplusplus/v3x/d3/d5c/classcocos2d_1_1_sprite.html#a90d3dbe1fa3ea566d416ff8edd697dd7) is the method – Shubhank Mar 28 '17 at 06:00
  • Can you please post full line of code. I mean is this function of CCTextureCache ? – R.R.M Mar 28 '17 at 06:03
  • I m not getting this function in CCTextureCache class. – R.R.M Mar 28 '17 at 06:05
  • CCTextureCache.sharedTextureCache().textureForKey("image.png") should work – Nikhil Aneja Mar 28 '17 at 06:21
  • https://stackoverflow.com/questions/10456040/how-to-swap-the-sprite-in-the-ccsprite-object-in-cocos2d-x/10460644#10460644 See my answer – Nikhil Aneja Mar 28 '17 at 06:24

0 Answers0