fix EditBox lua compile error

This commit is contained in:
andyque 2014-09-02 17:37:55 +08:00
parent 28f00df0cf
commit 51e160beff
2 changed files with 9 additions and 5 deletions

View File

@ -68,12 +68,12 @@ void EditBox::touchDownAction(Ref *sender, TouchEventType controlEvent)
} }
EditBox* EditBox::create(const Size& size, EditBox* EditBox::create(const Size& size,
const std::string& pNormal9SpriteBg, const std::string& normalSprite,
TextureResType texType /*= TextureResType::LOCAL*/) TextureResType texType /*= TextureResType::LOCAL*/)
{ {
EditBox* pRet = new EditBox(); EditBox* pRet = new EditBox();
if (pRet != nullptr && pRet->initWithSizeAndBackgroundSprite(size, pNormal9SpriteBg, texType)) if (pRet != nullptr && pRet->initWithSizeAndBackgroundSprite(size, normalSprite, texType))
{ {
pRet->autorelease(); pRet->autorelease();
} }
@ -85,11 +85,12 @@ EditBox* EditBox::create(const Size& size,
return pRet; return pRet;
} }
EditBox* EditBox::create(const cocos2d::Size &size, cocos2d::ui::Scale9Sprite *pNormal9SpriteBg)
EditBox* EditBox::create(const cocos2d::Size &size, cocos2d::ui::Scale9Sprite *normalSprite, ui::Scale9Sprite *pressedSprite, Scale9Sprite* disabledSprite)
{ {
EditBox* pRet = new (std::nothrow) EditBox(); EditBox* pRet = new (std::nothrow) EditBox();
if (pRet != nullptr && pRet->initWithSizeAndBackgroundSprite(size, pNormal9SpriteBg)) if (pRet != nullptr && pRet->initWithSizeAndBackgroundSprite(size, normalSprite))
{ {
pRet->autorelease(); pRet->autorelease();
} }

View File

@ -190,7 +190,10 @@ namespace ui {
* @return An autorelease pointer of EditBox, you don't need to release it only if you retain it again. * @return An autorelease pointer of EditBox, you don't need to release it only if you retain it again.
*/ */
static EditBox* create(const Size& size, static EditBox* create(const Size& size,
Scale9Sprite* pNormal9SpriteBg); Scale9Sprite* normalSprite,
Scale9Sprite* pressedSprite = nullptr,
Scale9Sprite* disabledSprite = nullptr);
/** /**
* create a edit box with size. * create a edit box with size.