bool HelloWorld::init(){ if ( !cclayer::init() ) { return false; } CCSize winSize = CCDirector::sharedDirector()->getWinSize(); CCControlSlIDer *slIDer = CCControlSlIDer::create("slIDerBg.png","slIDerProgress.png","slIDerThumb.png"); slIDer->setMaximumAllowedValue(100); slIDer->setMinimumAllowedValue(0); slIDer->setposition(ccp(200,170)); slIDer->addTargetWithActionForControlEvents(this,cccontrol_selector(HelloWorld::valueChange),CCControlEventValueChanged); this->addChild(slIDer); return true;}voID HelloWorld::valueChange(CCObject *pSender){ CCControlSlIDer *slIDer = (CCControlSlIDer *)pSender; float value = slIDer->getValue(); cclog("value:%.2f",value);}总结
以上是内存溢出为你收集整理的Cocos2d-x_CCControlSlider(滑动条类)介绍全部内容,希望文章能够帮你解决Cocos2d-x_CCControlSlider(滑动条类)介绍所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)