Ejemplo n.º 1
0
UINumber* UINumber::numberWithStyle(NumStyle style){
	UINumber* n = new UINumber;
	if(n && n->initWithStyle(style)){
		n->autorelease();
		return n;
	}
	CC_SAFE_DELETE(n);
	return NULL;
}
Ejemplo n.º 2
0
/*
 * initWithStyle 初始化
 */
UINumber* UINumber::initWithStyle(NumStyle style)
{
    //if( (self=[super init])) {
	UINumber* self = UINumber::create();
	self->init(style);
    self->autorelease();   
    //}
    return self;
}
Ejemplo n.º 3
0
void UIRollNum::clearEffect(){
	for(unsigned int i = 0; i < numArray->count(); i++){
		UINumber* pNumber = (UINumber*)numArray->objectAtIndex(i);
		this->removeChild(pNumber, true);
	}
    
	numArray->removeAllObjects();
    
	for(int i = 0; i < m_maxCol; i++){
		UINumber* pNumber = UINumber::numberWithStyle(style);
		numArray->addObject(pNumber);
		pNumber->setNumber(0);
		pNumber->setPosition(ccp(m_point.x - i * NUM_WIDTH, m_point.y));
		pNumber->setAnchorPoint(ccp(1.0f, 0.5f));
		this->addChild(pNumber, 100);
	}
}
Ejemplo n.º 4
0
void UIRollNum::rebuildEffect(){
	int i = 0;
	int num = m_nNumber;
	while(1){
		if(num <= 0){
			if(m_maxCol <= i && zeroFill){
				break;
			}
		}
		int showNum = num % 10;
		UINumber* pNumber = (UINumber*)numArray->objectAtIndex(i);
		pNumber->setNumber(showNum);
		i++;
		num = num / 10;
	}
    
}