#include <UICheckBoxTest.h>
◆ UICheckBoxCopyTest()
| UICheckBoxCopyTest::UICheckBoxCopyTest |
( |
| ) |
|
◆ ~UICheckBoxCopyTest()
| UICheckBoxCopyTest::~UICheckBoxCopyTest |
( |
| ) |
|
◆ CREATE_FUNC()
◆ init()
| bool UICheckBoxCopyTest::init |
( |
| ) |
|
|
overridevirtual |
重载 UIScene .
在文件 UICheckBoxTest.cpp 第 203 行定义.
207 Size widgetSize =
_widget->getContentSize();
212 _displayValueLabel->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f));
216 Text* alert = Text::create(
"Two checkbox are identical.",
"fonts/Marker Felt.ttf",20 );
217 alert->setColor(Color3B(159, 168, 176));
218 alert->setPosition(Vec2(widgetSize.width / 2.0f,
219 widgetSize.height / 2.0f - alert->getContentSize().height * 1.75f));
223 CheckBox* checkBox = CheckBox::create(
"cocosui/check_box_normal.png",
224 "cocosui/check_box_active.png");
225 checkBox->setPosition(Vec2(widgetSize.width / 2.0f - 50, widgetSize.height / 2.0f));
229 auto checkboxCopy = checkBox->clone();
230 checkboxCopy->setPosition(checkBox->getPosition() + Vec2(50.0f,0.0f));
cocos2d::Layer * _uiLayer
virtual bool init() override
cocos2d::ui::Layout * _widget
引用了 _displayValueLabel, UIScene::_uiLayer, UIScene::_widget , 以及 UIScene::init().
◆ _displayValueLabel
| cocos2d::ui::Text* UICheckBoxCopyTest::_displayValueLabel |
|
protected |
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.h
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UICheckBoxTest/UICheckBoxTest.cpp