bool NumericStepper::init(const char *lnormal,const char *lselet,const char *ldisable, const char *rnormal,const char *rselet,const char *rdisable,const char* bg) { m_btnLeft = CButton::create(lnormal,lselet,ldisable); m_btnRight = CButton::create(rnormal,rselet,rdisable); m_bg = CImageView::create(bg); m_labNum = CLabel::createWithSystemFont("15","",m_bg->getContentSize().height-2,m_bg->getContentSize(),TextHAlignment::CENTER); m_btnLeft->setOnClickListener(this,ccw_click_selector(NumericStepper::event_btn_left)); m_btnRight->setOnClickListener(this,ccw_click_selector(NumericStepper::event_btn_right)); this->addChild(m_btnLeft); this->addChild(m_btnRight); this->addChild(m_bg); this->addChild(m_labNum); resetSelf(); return true; }
CreatureUI::CreatureUI() : ThingUI() { resetSelf(); }
void NumericStepper::setrSelectedSpriteFrameName(const char* pSpriteName) { m_btnRight->setSelectedSpriteFrameName(pSpriteName); resetSelf(); }
void NumericStepper::setlDisabledSpriteFrameName(const char* pSpriteName) { m_btnLeft->setDisabledSpriteFrameName(pSpriteName); resetSelf(); }
void NumericStepper::setlNormalSpriteFrameName( const char* pSpriteName ) { m_btnLeft->setNormalSpriteFrameName(pSpriteName); resetSelf(); }
void NumericStepper::setStepBgSpriteFrameName(const char* pSpriteName) { SpriteFrame *pFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(pSpriteName); m_bg->setSpriteFrame(pFrame); resetSelf(); }