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 about 9 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 https://github.com/cocos2d/cocos2d-x/pull/5388, it is working on 3.x branch, we need to migrate it to V2.x.

zhangbin@cocos2d-x.org 2014-02-19 06:50
  • Assignee changed from dabingnn to zhangbin@cocos2d-x.org
zhangxm 2014-02-28 01:19
  • Target version changed from 3.0-rc0 to Candidate
zhangbin@cocos2d-x.org 2014-03-06 09:25
  • Target version changed from Candidate to 3.0-rc0
zhangbin@cocos2d-x.org 2014-03-07 08:35
  • Status changed from New to Closed
  • % Done changed from 0 to 100

Applied in changeset commit:d87bc7c7cd2c8eb3f8f5cbdc3e3f15ee99844edf.

Atom PDF

Status:Closed
Start date:2014-02-11
Priority:Normal
Due date:
Assignee:zhangbin@cocos2d-x.org
% Done:

100%

Category:all
Target version:3.0-rc0

Related issues

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