| 1604 | } |
| 1605 | |
| 1606 | void DrawNodeBaseTest::initSliders() |
| 1607 | { |
| 1608 | _currentSeletedItemIndex = 0; |
| 1609 | |
| 1610 | std::string text[sliderType::sliderTypeLast] = {"AngleStart", "AngleEnd", "Rotation", "Thickness"}; |
| 1611 | |
| 1612 | auto ttfConfig = TTFConfig("fonts/arial.ttf", 5); |
| 1613 | for (int i = 0; i < (sliderType::sliderTypeLast); i++) |
| 1614 | { |
| 1615 | slider[i] = ax::ui::Slider::create(); |
| 1616 | slider[i]->setAnchorPoint(Vec2::ANCHOR_MIDDLE_LEFT); |
| 1617 | slider[i]->loadBarTexture("cocosui/sliderTrack.png"); |
| 1618 | slider[i]->loadSlidBallTextures("ccs-res/cocosui/sliderballnormal.png", "ccs-res/cocosui/sliderballpressed.png", |
| 1619 | ""); |
| 1620 | slider[i]->loadProgressBarTexture("cocosui/sliderProgress.png"); |
| 1621 | slider[i]->setPosition(Vec2(size.width - slider[i]->getContentSize().x / 2 - 10, size.height / 6 + i * 16)); |
| 1622 | slider[i]->setPercent(sliderValue[i]); |
| 1623 | |
| 1624 | slider[i]->setEnabled(false); |
| 1625 | slider[i]->setScale(0.5f); |
| 1626 | addChild(slider[i], 20); |
| 1627 | |
| 1628 | sliderLabel[i] = Label::createWithTTF(ttfConfig, text[i] + ": (" + Value(sliderValue[i]).asString() + ")"); |
| 1629 | sliderLabel[i]->setAnchorPoint(Vec2::ANCHOR_MIDDLE_LEFT); |
| 1630 | sliderLabel[i]->setPosition(slider[i]->getPosition() + Vec2(0, 8)); |
| 1631 | addChild(sliderLabel[i], 20); |
| 1632 | } |
| 1633 | |
| 1634 | slider[sliderType::AngleStart]->addEventListener(AX_CALLBACK_2(DrawNodeBaseTest::changeStartAngle, this)); |
| 1635 | slider[sliderType::AngleEnd]->addEventListener(AX_CALLBACK_2(DrawNodeBaseTest::changeEndAngle, this)); |
| 1636 | slider[sliderType::Rotation]->addEventListener(AX_CALLBACK_2(DrawNodeBaseTest::changeRotation, this)); |
| 1637 | slider[sliderType::Thickness]->addEventListener(AX_CALLBACK_2(DrawNodeBaseTest::changeThickness, this)); |
| 1638 | } |
| 1639 | |
| 1640 | DrawNodeMorphTest_SolidPolygon::DrawNodeMorphTest_SolidPolygon() |
| 1641 | { |
nothing calls this directly
no test coverage detected