loading=CCSprite::create("loading.png");
pro=CCProgressTimer::create(loading);
loadingbar=CCSprite::create("loadbg.png");
pro->setType(kCCProgressTimerTypeBar);
// Setup for a bar starting from the left since the midpoint is 0 for the x
pro->setMidpoint(ccp(0,0));
// Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change
pro->setBarChangeRate(ccp(1, 0));
w=loadingbar->getTexture()->getContentSize().width;
h=loadingbar->getTexture()->getContentSize().height;
x=w/2+((AppDelegate::SCREEN_WIDTH-w)/2);
to= CCProgressTo::create(10, 100);
pro->setPosition(ccp(x,h));
action=CCRepeatForever::create(to);
pro->runAction(action);
loadingbar->setPosition(ccp(x,h));
//loading->setPosition(ccp(x,h));
sprite->setAniPosition(sprite->sprite,x+15-w/2,h);
this->addChild(loadingbar);
// this->addChild(loading);
this->addChild(pro);
this->addChild(sprite);
pro=CCProgressTimer::create(loading);
loadingbar=CCSprite::create("loadbg.png");
pro->setType(kCCProgressTimerTypeBar);
// Setup for a bar starting from the left since the midpoint is 0 for the x
pro->setMidpoint(ccp(0,0));
// Setup for a horizontal bar since the bar change rate is 0 for y meaning no vertical change
pro->setBarChangeRate(ccp(1, 0));
w=loadingbar->getTexture()->getContentSize().width;
h=loadingbar->getTexture()->getContentSize().height;
x=w/2+((AppDelegate::SCREEN_WIDTH-w)/2);
to= CCProgressTo::create(10, 100);
pro->setPosition(ccp(x,h));
action=CCRepeatForever::create(to);
pro->runAction(action);
loadingbar->setPosition(ccp(x,h));
//loading->setPosition(ccp(x,h));
sprite->setAniPosition(sprite->sprite,x+15-w/2,h);
this->addChild(loadingbar);
// this->addChild(loading);
this->addChild(pro);
this->addChild(sprite);