We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
Reload a picture though it is cached in TextureCache
Reload a picture though it is cached in TextureCache
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.
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.
- Assignee changed from dabingnn to zhangbin@cocos2d-x.org
- Target version changed from Candidate to 3.0-rc0
- Status changed from New to Closed
- % Done changed from 0 to 100
Applied in changeset commit:d87bc7c7cd2c8eb3f8f5cbdc3e3f15ee99844edf.
Status: | Closed | |
---|---|---|
Start date: | 2014-02-11 | |
Priority: | Normal | |
Due date: | ||
Assignee: | ||
% Done: | 100% |
|
Category: | all | |
Target version: | 3.0-rc0 |
Related issues
There is a requirement from CocoStudio, when a picture is modified, it should take effect without re-start the editor.