void LayerSetup::ChangeEffectVolume(CCObject* obj, CCControlEvent) { CCControlSlider* slider = (CCControlSlider*)obj; CocosDenshion::SimpleAudioEngine::sharedEngine()->setEffectsVolume(slider->getValue()); CCUserDefault::sharedUserDefault()->setFloatForKey("EffectVolume", slider->getValue()); }
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); }
/* * 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()); }
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() ); }
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() ); }
void ShaderBlur::sliderAction(CCObject* sender, CCControlEvent controlEvent) { CCControlSlider* pSlider = (CCControlSlider*)sender; m_pBlurSprite->setBlurSize(pSlider->getValue()); }
void SettingsLayer::volumeValueChanged(CCObject *sender, CCControlEvent controlEvent) { CCControlSlider* pSlider = (CCControlSlider*)sender; S_AE->setBackgroundMusicVolume(pSlider->getValue()); }
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()); }