Ejemplo n.º 1
0
CSlider* TuiManager::createSlider(float tag,int max,int min,int cur, const char* bg, const char* progress, const char* thumb, float x, float y, float rotation, int isUseFrame){
	CSlider *pSlider = NULL;
	if (isUseFrame){
		pSlider = CSlider::createSpriteFrame(thumb, progress);
		pSlider->setBackgroundSpriteFrameName(bg);
	}else{
		pSlider = CSlider::create(thumb,progress);
		pSlider->setBackgroundImage(bg);
	}
	pSlider->setRotation(rotation);
	pSlider->setPosition(Vec2(x,-y));
	pSlider->setMinValue(min);
	pSlider->setMaxValue(max);
	pSlider->setValue(cur);
	pSlider->setTag(tag);
	return pSlider;
}
Ejemplo n.º 2
0
CSlider* TuiManager::createSlider(float tag, const char* bg,const char* progress,const char* thumb,float x,float y,float rotation){
	CSlider *pSlider = NULL;
	if(m_isUseSpriteFrame){
		pSlider = CSlider::create();
		pSlider->setBackgroundSpriteFrameName(bg);
		pSlider->setProgressSpriteFrameName(progress);
		pSlider->setSliderSpriteFrameName(thumb);
	}else{
		pSlider = CSlider::create(thumb,progress);
		pSlider->setBackgroundImage(bg);
	}
	pSlider->setRotation(rotation);
	pSlider->setPosition(Point(x,-y));
	pSlider->setMinValue(0);
	pSlider->setMaxValue(100);
	pSlider->setValue(15);
	pSlider->setTag(tag);
	return pSlider;
}