예제 #1
0
void LayerSetup::ChangeEffectVolume(CCObject* obj, CCControlEvent)
{
	CCControlSlider* slider = (CCControlSlider*)obj;
	CocosDenshion::SimpleAudioEngine::sharedEngine()->setEffectsVolume(slider->getValue());

	CCUserDefault::sharedUserDefault()->setFloatForKey("EffectVolume", slider->getValue());
}
예제 #2
0
void LayerBet_TomCuaCa::valueChanged(CCObject *sender, CCControlEvent controlEvent){
	CCControlSlider* pSlider = (CCControlSlider*)sender;
	float percent =pSlider->getValue()-pSlider->getMinimumValue();
	float max = pSlider->getMaximumValue() - pSlider->getMinimumValue();
	float delta = max;
	float posX =pSlider->getPositionX();
	float sliderWidth =pSlider->getContentSize().width;
	spriteMoney->setPosition(ccp(posX+percent*(sliderWidth/delta), spriteMoney->getPositionY()));
	//lblMoney->setString( CCString::createWithFormat("%.0f xu", ceil(pSlider->getValue()))->getCString() );
	float myTien = floor(pSlider->getValue());
	float myTien2 = floor((myTien/1000));
	lblMoney->setString( CCString::createWithFormat("%s xu", mUtils::convertMoneyEx(myTien2*1000).c_str())->getCString() );
	CCLog("--%f",pSlider->getValue());
}
void Clayer_normalMapped::sliderAction4(CCObject* sender, CCControlEvent controlEvent)
{
    CCControlSlider* pSlider = (CCControlSlider*)sender;
    float value=pSlider->getValue();
    m_normalMappedSprite->setKBump(value);
    
}
void Clayer_normalMapped::sliderAction(CCObject* sender, CCControlEvent controlEvent)
{
    CCControlSlider* pSlider = (CCControlSlider*)sender;
    float value=pSlider->getValue();
    ccColor4F diffuse=m_lightSprite->getDiffuse();
    diffuse.r=value;
    m_lightSprite->setDiffuse(diffuse);
  }
예제 #5
0
/*
 * Controls Events
 */
void OptionsLayer::sliderEvent(CCObject *pSender, CCControlEvent controlEvent)
{
	CCControlSlider* pSlider = (CCControlSlider*)pSender;

	int percent = pSlider->getValue();
	std::string s = "g:";
	s += percent;

	_lblGoalSelection->setString(s.c_str());
}
예제 #6
0
void LayerTransferMoney::valueChanged(CCObject *sender, CCControlEvent controlEvent){
    CCControlSlider* pSlider = (CCControlSlider*)sender;
    float percent =pSlider->getValue()-pSlider->getMinimumValue();
    float max = pSlider->getMaximumValue() - pSlider->getMinimumValue();
    float delta = max;
    float posX =pSlider->getPositionX();
    float sliderWidth =pSlider->getContentSize().width;
    spriteMoney->setPosition(ccp(posX+percent*(sliderWidth/delta), spriteMoney->getPositionY()));
    lblMoney->setString( CCString::createWithFormat("%s chips", mUtils::convertMoneyEx(ceil(pSlider->getValue())).c_str() )->getCString() );
}
예제 #7
0
void LayerBet_BaCayChuong::valueChanged(CCObject *sender, CCControlEvent controlEvent){
	CCControlSlider* pSlider = (CCControlSlider*)sender;
	float percent =pSlider->getValue()-pSlider->getMinimumValue();
	float max = pSlider->getMaximumValue() - pSlider->getMinimumValue();
	float delta = max;
	float posX =pSlider->getPositionX();
	float sliderWidth =pSlider->getContentSize().width;
	spriteMoney->setPosition(ccp(posX+percent*(sliderWidth/delta), spriteMoney->getPositionY()));
	lblMoney->setString( CCString::createWithFormat("%s xu", mUtils::convertMoneyEx(ceil(pSlider->getValue())*1000).c_str())->getCString() );

	// 	CCControlSlider* pSlider = (CCControlSlider*)sender;
	// 	float percent =pSlider->getValue()-pSlider->getMinimumValue();
	// 	float max = pSlider->getMaximumValue() - pSlider->getMinimumValue();
	// 	float delta = max;
	// 	float posX =pSlider->getPositionX();
	// 	float sliderWidth =pSlider->getContentSize().width;
	// 	spriteMoney->setPosition(ccp(posX+percent*(sliderWidth/delta), spriteMoney->getPositionY()));
	// 	//HoangDD comment
	// 	lblMoney->setString( CCString::createWithFormat("%.0f xu", floor(pSlider->getValue())*1000)->getCString() );
}
예제 #8
0
void ShaderBlur::sliderAction(CCObject* sender, CCControlEvent controlEvent)
{
    CCControlSlider* pSlider = (CCControlSlider*)sender;
    m_pBlurSprite->setBlurSize(pSlider->getValue());
}
예제 #9
0
void SettingsLayer::volumeValueChanged(CCObject *sender, CCControlEvent controlEvent)
{
    CCControlSlider* pSlider = (CCControlSlider*)sender;
    S_AE->setBackgroundMusicVolume(pSlider->getValue());
}
예제 #10
0
void CCControlSliderTest::valueChanged(CCObject *sender, CCControlEvent controlEvent)
{
    CCControlSlider* pSlider = (CCControlSlider*)sender;
    // Change value of label.
    m_pDisplayValueLabel->setString(CCString::createWithFormat("Slider value = %.02f", pSlider->getValue())->getCString());    
}