void SchedulerTimeScale::sliderAction(Ref* sender, Control::EventType controlEvent) { ControlSlider* pSliderCtl = static_cast<ControlSlider*>(sender); float scale; scale = pSliderCtl->getValue(); Director::getInstance()->getScheduler()->setTimeScale(scale); }
void TwoSchedulers::sliderAction(Ref* sender, Control::EventType controlEvent) { float scale; ControlSlider *slider = static_cast<ControlSlider*>(sender); scale = slider->getValue(); if( sender == sliderCtl1 ) sched1->setTimeScale(scale); else sched2->setTimeScale(scale); }
void ShaderBlur::onSampleNumChanged(Ref* sender, Control::EventType) { ControlSlider* slider = (ControlSlider*)sender; _blurSprite->setBlurSampleNum(slider->getValue()); }
void ControlSliderTest::valueChanged(Object *sender, Control::EventType controlEvent) { ControlSlider* pSlider = (ControlSlider*)sender; // Change value of label. if(pSlider->getTag() == 1) _displayValueLabel->setString(String::createWithFormat("Upper slider value = %.02f", pSlider->getValue())->getCString()); if(pSlider->getTag() == 2) _displayValueLabel->setString(String::createWithFormat("Lower slider value = %.02f", pSlider->getValue())->getCString()); }