cocos2d-x CheckBox的使用
??
cocos2d::ui::Text* _displayText;
Size size = Director::getInstance()->getVisibleSize(); cocos2d::ui::CheckBox* cBox = cocos2d::ui::CheckBox::create("check_box_normal.png","check_box_normal_press.png","check_box_active.png",
void HelloWorld::selectedEvent(Ref* pSender,cocos2d::ui::CheckBox::EventType type) { switch (type) { case cocos2d::ui::CheckBox::EventType::SELECTED: _displayText->setString(String::createWithFormat("Selected")->getCString()); break; case cocos2d::ui::CheckBox::EventType::UNSELECTED: _displayText->setString(String::createWithFormat("Unselected")->getCString()); break; default: break; } } (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |