| 1512 | return slider2; |
| 1513 | } |
| 1514 | void LabelTTFSDF::initToggleCheckboxes() |
| 1515 | { |
| 1516 | float startPosY = 0; |
| 1517 | Size winSize = Director::getInstance()->getVisibleSize(); |
| 1518 | |
| 1519 | // Create a radio button group |
| 1520 | auto radioButtonGroup = RadioButtonGroup::create(); |
| 1521 | this->addChild(radioButtonGroup); |
| 1522 | |
| 1523 | // Create the radio buttons |
| 1524 | static const int NUMBER_OF_BUTTONS = 3; |
| 1525 | startPosY = winSize.height * 0.25; |
| 1526 | std::vector<std::string> labelTypes = {"Normal", "Glow", "Outline"}; |
| 1527 | |
| 1528 | for (int i = 0; i < NUMBER_OF_BUTTONS; ++i) |
| 1529 | { |
| 1530 | |
| 1531 | RadioButton* radioButton = RadioButton::create("cocosui/radio_button_off.png", "cocosui/radio_button_on.png"); |
| 1532 | float posY = startPosY + (radioButton->getContentSize().height + 5) * i; |
| 1533 | radioButton->setPosition(Vec2(winSize.width * 0.8, posY)); |
| 1534 | radioButton->addEventListener(AX_CALLBACK_2(LabelTTFSDF::onChangedRadioButtonSelect, this)); |
| 1535 | radioButton->setTag(i); |
| 1536 | radioButtonGroup->addRadioButton(radioButton); |
| 1537 | this->addChild(radioButton); |
| 1538 | |
| 1539 | auto label = Label::createWithSystemFont(labelTypes.at(i), "Arial", 15); |
| 1540 | label->setPosition(radioButton->getPosition() + Vec2(radioButton->getContentSize().width + 1, 0.0f)); |
| 1541 | label->setAnchorPoint(Vec2(0, 0.5)); |
| 1542 | this->addChild(label); |
| 1543 | } |
| 1544 | } |
| 1545 | void LabelTTFSDF::onChangedRadioButtonSelect(RadioButton* radioButton, RadioButton::EventType type) |
| 1546 | { |
| 1547 | if (radioButton == nullptr) |
no test coverage detected