Projects > cpp > Issues > Feature #3991

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

Reload a picture though it is cached in TextureCache

Feature #3991 [Closed]
zhangxm 2014-02-11 13:08 . Updated over 2 years ago

There is a requirement from CocoStudio, when a picture is modified, it should take effect without re-start the editor.

xiexin 2014-02-12 02:50

The requirement come from this situation, one CCSprite use a png file to initialize, for example 1.png, and then user modify the 1.png, normally user want the CCSprite to render with the new 1.png. On the CCSprite class, there's a function setTexture(CCTexture2D texture), but to create a CCTexture2D, usually use CCTextureCache::addImage(const char fileimage) to create one, but if you call this function with the same fileName again, it will just return a reference of a previously loaded image, it will not load the image again. So user can't see the CCSprite update with the new 1.png. That's why we need reload a picture.

zhangxm 2014-02-17 03:00

This issue should be implemented in v2.x too. And it is more ergent in v2.x.

dabingnn 2014-02-19 05:57

I have sent a pr, it is working on 3.x branch, we need to migrate it to V2.x. 2014-02-19 06:50
  • Assignee changed from dabingnn to
zhangxm 2014-02-28 01:19
  • Target version changed from 3.0-rc0 to Candidate 2014-03-06 09:25
  • Target version changed from Candidate to 3.0-rc0 2014-03-07 08:35
  • Status changed from New to Closed
  • % Done changed from 0 to 100

Applied in changeset commit:d87bc7c7cd2c8eb3f8f5cbdc3e3f15ee99844edf.

Atom PDF

Start date:2014-02-11
Due date:
% Done:


Target version:3.0-rc0

Related issues

related to cpp - Feature #4070: Reload a picture though it is cached in TextureCache Closed

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.