MCPcopy Create free account
hub / github.com/axmolengine/axmol / initAlignmentOption

Method initAlignmentOption

tests/cpp-tests/Source/LabelTest/LabelTest.cpp:2669–2688  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2667}
2668
2669void 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
2690void LabelLayoutBaseTest::initUnderlineStrikethroughOption(const ax::Size& size)
2691{

Callers 1

LabelLayoutBaseTestMethod · 0.95

Calls 6

setFontSizeFunction · 0.85
createFunction · 0.85
Vec2Function · 0.50
setPositionMethod · 0.45
addChildMethod · 0.45

Tested by

no test coverage detected