CCProgressTimer doesn't work with CCSpriteFrameCache

I have all my images loaded in CCSpriteFrameCache. Unfortunately CCProgressTimer class can’t use this texture.
Is there a way of doing this ?

Thanks for your feedback!
I have take a test, and it’s really not work! I think it’s a bug in both cocos2d-iphone and cocos2d-x.

The CCProgressTimer use the whole texture which the sprite used. But not the correct rect of the sprite.
So it’s not work well.

I have create an issue here: #513
Thank you once more!


can you please provide a couple of code lines to see how can I use the sprite sheet with CCProgressTimer ?


I think that this problem is still present.


Does anyone else have this problem ?


Could you paste some demo to reproduce it?


this is a paste from my code:
CCParticleExplosion* emitter = CCParticleExplosion::node();

The texture is not displayed correctly.

The codes are something about particle system, no CCProgressTimer used.

Yes, you’re right. I do have problems with CCProgressTimer and CCParticleExplosion.
I and to use these two classes with CCSpriteFrameCache and it doesn’t work.

Here is the code of CCProgressTimer
m_progressBar = CCProgressTimer::progressWithTexture(
m_progressBar~~>setPosition(ccp(2, 2));

Where the CCProgressTimer’image is supposed to be displayed … it shows the entire texture 1024x1024.


I am on iPhone 4.

Regards and thanks for your help!

Hi all,
why addSpriteFramesWithFile can’t use in the thread? My images were great,I must load them in thread.


  • loadResourceWithName
  • startLoadInThread
    NSAutoreleasePool* pPool = init];
    CCSpriteFrameCache* cache = CCSpriteFrameCache::sharedSpriteFrameCache;
    cache -> addSpriteFramesWithFile);

Hello guys

did anyone managed to use the CCProgressTimer like this:


Hi, Adi Fly,
You can add the interface as follow to CCProgressTimer class

bool initWithSpriteFrameName(const char *pszSpriteFrameName);
static CCProgressTimer* progressWithSpriteFrameName(const char *pszSpriteFrameName);

CCProgressTimer* CCProgressTimer::progressWithSpriteFrameName(const char *pszSpriteFrameName)
    CCProgressTimer *pProgressTimer = new CCProgressTimer();
    if (pProgressTimer->initWithSpriteFrameName(pszSpriteFrameName))
        delete pProgressTimer;
        pProgressTimer = NULL;

    return pProgressTimer;

bool CCProgressTimer::initWithSpriteFrameName(const char *pszSpriteFrameName)
    m_pSprite = CCSprite::spriteWithSpriteFrameName(pszSpriteFrameName);
    m_fPercentage = 0.f;
    m_pVertexData = NULL;
    m_nVertexDataCount = 0;
    setAnchorPoint(ccp(0.5f, 0.5f));
    m_eType = kCCProgressTimerTypeRadialCCW;

    return true;

CCProgressTimer *left = CCProgressTimer::progressWithSpriteFrameName("grossini.png");

The code above will achieve what you want. :slight_smile:

Thank you very much! :slight_smile:


I did exactly like you said and it compiled fine, but it doesn’t show anything on the screen.

It might be a problem with my texture, let me double check.

I double checked it.
It doesn’t work. It doesn’t show the imagine.

Hi, my test demo works fine. Please download the attachment files to have a try.

Adi Fly wrote:

I double checked it.
It doesn’t work. It doesn’t show the imagine.

From what I see on your ProgressActionTest you use CCProgressTimer::progressWithFile and I want to use with SpriteFrameName.

See the line 161 of ProgressActionsTest.cpp file

CCProgressTimer *left = CCProgressTimer::progressWithSpriteFrameName(“grossinis_sister2.png”);//progressWithFile(s_pPathSister1);