| 2667 | } |
| 2668 | |
| 2669 | void LabelLayoutBaseTest::initAlignmentOption(const ax::Size& size) |
| 2670 | { |
| 2671 | // add text alignment settings |
| 2672 | MenuItemFont::setFontSize(30); |
| 2673 | auto menu = Menu::create( |
| 2674 | MenuItemFont::create("Left", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentLeft, this)), |
| 2675 | MenuItemFont::create("Center", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentCenter, this)), |
| 2676 | MenuItemFont::create("Right", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentRight, this)), nullptr); |
| 2677 | menu->alignItemsVerticallyWithPadding(4); |
| 2678 | menu->setPosition(Vec2(50.0f, size.height / 2 - 20)); |
| 2679 | this->addChild(menu); |
| 2680 | |
| 2681 | menu = Menu::create(MenuItemFont::create("Top", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentTop, this)), |
| 2682 | MenuItemFont::create("Middle", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentMiddle, this)), |
| 2683 | MenuItemFont::create("Bottom", AX_CALLBACK_1(LabelLayoutBaseTest::setAlignmentBottom, this)), |
| 2684 | nullptr); |
| 2685 | menu->alignItemsVerticallyWithPadding(4); |
| 2686 | menu->setPosition(Vec2(size.width - 50, size.height / 2 - 20)); |
| 2687 | this->addChild(menu); |
| 2688 | } |
| 2689 | |
| 2690 | void LabelLayoutBaseTest::initUnderlineStrikethroughOption(const ax::Size& size) |
| 2691 | { |
no test coverage detected