1103 Size widgetSize =
_widget->getContentSize();
1109 widgetSize.height / 2.0f));
1113 Text* alert = Text::create(
"This test case shouldn't trigger the Assertion!",
1114 "fonts/Marker Felt.ttf",20);
1115 alert->setColor(Color3B(159, 168, 176));
1117 alert->setPosition(Vec2(widgetSize.width / 2.0f,
1118 widgetSize.height / 2.0f
1119 - alert->getContentSize().height * 1.75f));
1124 Button* button = Button::create(
"cocosui/animationbuttonnormal.png");
1125 button->setPosition(Vec2(widgetSize.width / 2.0f - 80,
1126 widgetSize.height / 2.0f + 40));
1130 CCASSERT(button->getTitleRenderer() ==
nullptr,
1131 "Button title render must be nullptr ");
1133 auto buttonCopy = (Button*)button->clone();
1134 buttonCopy->setPosition(Vec2(widgetSize.width / 2.0f + 80,
1135 widgetSize.height / 2.0f + 40));
1136 this->addChild(buttonCopy);
1140 auto buttonScale9Copy = (Button*)button->clone();
1141 buttonScale9Copy->setPosition(button->getPosition() + Vec2(0.0f, -60.0f));
1142 buttonScale9Copy->setScale9Enabled(
true);
1143 buttonScale9Copy->setContentSize(button->getContentSize() * 1.5f);
1144 this->addChild(buttonScale9Copy);
1147 auto buttonScale9Copy2 = (Button*)buttonScale9Copy->clone();
1148 buttonScale9Copy2->setPosition(buttonCopy->getPosition() + Vec2(0.0f, -60.0f));
1149 buttonScale9Copy2->setScale9Enabled(
true);
1150 buttonScale9Copy2->setContentSize(buttonCopy->getContentSize() * 1.5f);
1151 this->addChild(buttonScale9Copy2);
1154 CCASSERT(button->getTitleRenderer() ==
nullptr,
1155 "Original Button title render must be nullptr ");
1157 CCASSERT(buttonCopy->getTitleRenderer() ==
nullptr,
1158 "Copied Button title render must be nullptr ");
cocos2d::Layer * _uiLayer
virtual bool init() override
cocos2d::ui::Layout * _widget