mirror of https://github.com/axmolengine/axmol.git
Merge pull request #9439 from andyque/addcreateMethodToLoadingBar
add TextureResType to LoadingBar's create method
This commit is contained in:
commit
116ff0de63
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue