| 1584 | } |
| 1585 | } |
| 1586 | void LabelTTFSDF::initToggleLabel(std::string content, |
| 1587 | ax::Vec2 pos, |
| 1588 | std::function<void(Object*, ax::ui::CheckBox::EventType)> callback) |
| 1589 | { |
| 1590 | auto label = Label::createWithSystemFont(content + ":", "Arial", 10); |
| 1591 | label->setColor(Color3B::WHITE); |
| 1592 | label->setPosition(pos); |
| 1593 | label->setAnchorPoint(Vec2(1, 0.5)); |
| 1594 | this->addChild(label); |
| 1595 | |
| 1596 | CheckBox* checkBox = CheckBox::create("cocosui/check_box_normal.png", "cocosui/check_box_normal_press.png", |
| 1597 | "cocosui/check_box_active.png", "cocosui/check_box_normal_disable.png", |
| 1598 | "cocosui/check_box_active_disable.png"); |
| 1599 | checkBox->setPosition(pos); |
| 1600 | checkBox->setScale(0.5); |
| 1601 | checkBox->setName("toggleType"); |
| 1602 | checkBox->setSelected(true); |
| 1603 | checkBox->addEventListener(callback); |
| 1604 | checkBox->setAnchorPoint(Vec2(0, 0.5)); |
| 1605 | checkBox->setSelected(false); |
| 1606 | this->addChild(checkBox); |
| 1607 | } |
| 1608 | std::string LabelTTFSDF::title() const |
| 1609 | { |
| 1610 | return "Label + SDF + .TTF (#2623)"; |
nothing calls this directly
no test coverage detected