Create heathy bar

Hi all,

I try to create a heathybar to add on my target object.

I create a sprite with green color:

CCSprite* htybar = CCSprite::create();
htybar~~>setColor);
htybar~~>setContentSize( CCSize(100,500));
htybar~~>setTextureRect);
htybar~~>setPosition(ccp(200,200));

Add add to CCprogressTimer:

CCProgressTimer* heathyBar = CCProgressTimer::create(htybar);
target->addChild(heathyBar ,10);

But it no show anything.
Any idea will be appriciate.

Thanks for all your helps.

I’ve never used this, but creating a empty sprite looks strange…

Have you tried creating the sprite with a filename?

CCSprite* htybar = CCSprite::("pathToAnExisitingTextureFile.png");

Looks like a good catch Xavier

Xavier Arias wrote:

I’ve never used this, but creating a empty sprite looks strange…
>
Have you tried creating the sprite with a filename?
[…]