#include <UIButtonTest.h>
◆ UIButtonTextOnly()
| UIButtonTextOnly::UIButtonTextOnly |
( |
| ) |
|
◆ ~UIButtonTextOnly()
| UIButtonTextOnly::~UIButtonTextOnly |
( |
| ) |
|
◆ CREATE_FUNC()
◆ init()
| bool UIButtonTextOnly::init |
( |
| ) |
|
|
overridevirtual |
重载 UIScene .
在文件 UIButtonTest.cpp 第 768 行定义.
772 Size widgetSize =
_widget->getContentSize();
777 _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f + 20));
782 auto button = Button::create();
783 button->setPositionNormalized(Vec2(0.5f, 0.5f));
785 button->setTitleText(
"PLAY GAME");
786 CCLOG(
"content size should be greater than 0: width = %f, height = %f", button->getContentSize().width,
787 button->getContentSize().height);
788 button->setZoomScale(0.3f);
789 button->setPressedActionEnabled(
true);
790 button->addClickEventListener([](Ref* sender) {
cocos2d::Layer * _uiLayer
virtual bool init() override
cocos2d::ui::Layout * _widget
引用了 _displayValueLabel, UIScene::_uiLayer, UIScene::_widget , 以及 UIScene::init().
◆ _displayValueLabel
| cocos2d::ui::Text* UIButtonTextOnly::_displayValueLabel |
|
protected |
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.h
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UIButtonTest/UIButtonTest.cpp