Merge pull request #9439 from andyque/addcreateMethodToLoadingBar

add TextureResType to LoadingBar's create method
This commit is contained in:
minggo 2014-12-16 18:31:20 +08:00
commit 116ff0de63
2 changed files with 12 additions and 1 deletions

View File

@ -67,11 +67,18 @@ LoadingBar* LoadingBar::create()
}
LoadingBar* LoadingBar::create(const std::string &textureName, float percentage)
{
return LoadingBar::create(textureName, TextureResType::LOCAL, percentage);
}
LoadingBar* LoadingBar::create(const std::string &textureName,
TextureResType texType,
float percentage)
{
LoadingBar* widget = new (std::nothrow) LoadingBar;
if (widget && widget->init()) {
widget->autorelease();
widget->loadTexture(textureName);
widget->loadTexture(textureName,texType);
widget->setPercent(percentage);
return widget;
}

View File

@ -67,6 +67,10 @@ public:
**/
static LoadingBar* create(const std::string& textureName, float percentage = 0);
static LoadingBar* create(const std::string& textureName,
TextureResType texType,
float percentage = 0);
/**
* Changes the progress direction of loadingbar.
*