815 Size widgetSize =
_widget->getContentSize();
818 _displayValueLabel = Text::create(
"Button IgnoreContent Size Test",
"fonts/Marker Felt.ttf",32);
820 _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + 20));
825 auto button = Button::create(
"cocosui/animationbuttonnormal.png",
826 "cocosui/animationbuttonpressed.png");
827 button->ignoreContentAdaptWithSize(
false);
828 button->setContentSize(Size(200.0f,100.0f));
829 button->setPositionNormalized(Vec2(0.3f, 0.5f));
830 button->setTitleText(
"PLAY GAME");
831 button->setZoomScale(0.3f);
832 button->setPressedActionEnabled(
true);
833 button->addClickEventListener([=](Ref* sender) {
835 button->setScale(1.2f);
840 auto button2 = Button::create(
"cocosui/animationbuttonnormal.png",
841 "cocosui/animationbuttonpressed.png");
842 button2->ignoreContentAdaptWithSize(
false);
843 button2->setContentSize(Size(200.0f,100.0f));
844 button2->setPositionNormalized(Vec2(0.8f, 0.5f));
845 button2->setTitleText(
"PLAY GAME");
846 button2->setZoomScale(0.3f);
847 button2->setPressedActionEnabled(
true);
848 button2->addClickEventListener([=](Ref* sender) {
849 button2->runAction(ScaleTo::create(1.0f, 1.2f));
cocos2d::Layer * _uiLayer
virtual bool init() override
cocos2d::ui::Layout * _widget