Exemplo n.º 1
0
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;
}
Exemplo n.º 2
0
CreatureUI::CreatureUI() : ThingUI()
{
	resetSelf();
}
Exemplo n.º 3
0
void NumericStepper::setrSelectedSpriteFrameName(const char* pSpriteName) {
    m_btnRight->setSelectedSpriteFrameName(pSpriteName);
    resetSelf();
}
Exemplo n.º 4
0
void NumericStepper::setlDisabledSpriteFrameName(const char* pSpriteName) {
    m_btnLeft->setDisabledSpriteFrameName(pSpriteName);
    resetSelf();
}
Exemplo n.º 5
0
void NumericStepper::setlNormalSpriteFrameName( const char* pSpriteName ) {
    m_btnLeft->setNormalSpriteFrameName(pSpriteName);
    resetSelf();
}
Exemplo n.º 6
0
void NumericStepper::setStepBgSpriteFrameName(const char* pSpriteName) {
    SpriteFrame *pFrame = SpriteFrameCache::getInstance()->getSpriteFrameByName(pSpriteName);
    m_bg->setSpriteFrame(pFrame);
    resetSelf();
}