I’m newbie in Cocos2d-x.
I want to create simple progress/update bar for my game.
When this progress bar is full, we will move to next level.
How can i create that bar.
Thanks for all your helps.
I’m newbie in Cocos2d-x.
I want to create simple progress/update bar for my game.
When this progress bar is full, we will move to next level.
How can i create that bar.
Thanks for all your helps.
two methods:
1.you can use CCProgressTo .
2.create a sprite and scale it on update methods.
can you?
CCProgressTimer
Please give me a sample code.
Thank you very much.
CCProgressTimer* progressTimer = CCProgressTimer::create( CCSprite::create("fjut.png") );
if ( progressTimer != NULL )
{
progressTimer->setType(kCCProgressTimerTypeBar);
progressTimer->setMidpoint(ccp(0, 0));
progressTimer->setBarChangeRate(ccp(1, 0));
progressTimer->setPercentage(50);
progressTimer->setPosition(ccp(100, 100));
addChild(progressTimer);
}
@fjut: Thank you very much.
One litter more, I want it to increase from left to right, because your code it increase from right to left
@Storm Spirit wrote:
yes, it increases from left to right, you can invoke progressTimer->setPercentage(50); // 0~100。 have a try:P
fjut . wrote:
`Storm Spirit wrote:
yes, it increases from left to right, you can invoke progressTimer->setPercentage(50); // 0~100。 have a try:P
Sorry, my mistake, i set wrong midPoint
Thanks you very much.
In future, hope you will help me `fjut
i want progress bar like below snap
please ans fast
There are many way to construct it, as I see:
Sprite ( the border and the background ) has 2 childs: label ( Level 6 ) and ProgressTimer
Then just solve the bar like above replies