This commit is contained in:
Victor Buldakov 2013-11-04 01:27:16 +04:00
parent 20cb7a6cbc
commit 5213aa7bc9
2 changed files with 9 additions and 9 deletions

View File

@ -96,7 +96,7 @@ ControlSlider* ControlSlider::create(Sprite * backgroundSprite, Sprite* pogressS
} }
ControlSlider* ControlSlider::create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite, ControlSlider* ControlSlider::create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite,
Sprite* selectedThumbSprite) Sprite* selectedThumbSprite)
{ {
ControlSlider *pRet = new ControlSlider(); ControlSlider *pRet = new ControlSlider();
pRet->initWithSprites(backgroundSprite, pogressSprite, thumbSprite, selectedThumbSprite); pRet->initWithSprites(backgroundSprite, pogressSprite, thumbSprite, selectedThumbSprite);
@ -106,14 +106,14 @@ ControlSlider* ControlSlider::create(Sprite * backgroundSprite, Sprite* pogressS
bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite) bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite)
{ {
Sprite* selectedThumbSprite = Sprite::createWithTexture(thumbSprite->getTexture(), Sprite* selectedThumbSprite = Sprite::createWithTexture(thumbSprite->getTexture(),
thumbSprite->getTextureRect()); thumbSprite->getTextureRect());
selectedThumbSprite->setColor(Color3B::GRAY); selectedThumbSprite->setColor(Color3B::GRAY);
this->initWithSprites(backgroundSprite, progressSprite, thumbSprite, selectedThumbSprite); this->initWithSprites(backgroundSprite, progressSprite, thumbSprite, selectedThumbSprite);
} }
bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite, bool ControlSlider::initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite,
Sprite* selectedThumbSprite) Sprite* selectedThumbSprite)
{ {
if (Control::init()) if (Control::init())
{ {

View File

@ -64,7 +64,7 @@ public:
* and a selected thumb image filename. * and a selected thumb image filename.
*/ */
static ControlSlider* create(const char* bgFile, const char* progressFile, const char* thumbFile, static ControlSlider* create(const char* bgFile, const char* progressFile, const char* thumbFile,
const char* selectedThumbSpriteFile); const char* selectedThumbSpriteFile);
/** /**
* Creates a slider with a given background sprite and a progress bar, a thumb * Creates a slider with a given background sprite and a progress bar, a thumb
@ -73,7 +73,7 @@ public:
* @see initWithSprites * @see initWithSprites
*/ */
static ControlSlider* create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite, static ControlSlider* create(Sprite * backgroundSprite, Sprite* pogressSprite, Sprite* thumbSprite,
Sprite* selectedThumbSprite); Sprite* selectedThumbSprite);
/** /**
* @js ctor * @js ctor
*/ */
@ -104,7 +104,7 @@ public:
* @param selectedThumbSprite Sprite, that is used as a selected thumb. * @param selectedThumbSprite Sprite, that is used as a selected thumb.
*/ */
virtual bool initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite, virtual bool initWithSprites(Sprite * backgroundSprite, Sprite* progressSprite, Sprite* thumbSprite,
Sprite* selectedThumbSprite); Sprite* selectedThumbSprite);
virtual void needsLayout(); virtual void needsLayout();