#include <UIButtonTest.h>
◆ UIButtonTestSwitchScale9()
| UIButtonTestSwitchScale9::UIButtonTestSwitchScale9 |
( |
| ) |
|
◆ ~UIButtonTestSwitchScale9()
| UIButtonTestSwitchScale9::~UIButtonTestSwitchScale9 |
( |
| ) |
|
◆ CREATE_FUNC()
◆ init()
| bool UIButtonTestSwitchScale9::init |
( |
| ) |
|
|
overridevirtual |
重载 UIScene .
在文件 UIButtonTest.cpp 第 632 行定义.
636 Size widgetSize =
_widget->getContentSize();
641 _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
646 Button* button = Button::create(
"cocosui/animationbuttonnormal.png",
647 "cocosui/animationbuttonpressed.png");
648 button->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
650 button->setTitleText(
"Button Title");
651 button->ignoreContentAdaptWithSize(
false);
cocos2d::Layer * _uiLayer
virtual bool init() override
cocos2d::ui::Layout * _widget
引用了 _displayValueLabel, UIScene::_uiLayer, UIScene::_widget, UIScene::init() , 以及 touchEvent().
◆ touchEvent()
| void UIButtonTestSwitchScale9::touchEvent |
( |
cocos2d::Ref * |
sender, |
|
|
cocos2d::ui::Widget::TouchEventType |
type |
|
) |
| |
在文件 UIButtonTest.cpp 第 662 行定义.
666 case Widget::TouchEventType::BEGAN:
670 case Widget::TouchEventType::MOVED:
674 case Widget::TouchEventType::ENDED:
677 auto btn = ((Button*)pSender);
678 btn->setScale9Enabled(!btn->isScale9Enabled());
679 btn->setContentSize(Size(200.0f,100.0f));
683 case Widget::TouchEventType::CANCELED:
引用了 _displayValueLabel.
被这些函数引用 init().
◆ _displayValueLabel
| cocos2d::ui::Text* UIButtonTestSwitchScale9::_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