#include <UITextBMFontTest.h>
◆ init()
| bool UITextBMFontTest::init |
( |
| ) |
|
|
overridevirtual |
重载 UIScene .
在文件 UITextBMFontTest.cpp 第 36 行定义.
40 Size widgetSize =
_widget->getContentSize();
42 Text* alert = Text::create(
"TextBMFont",
"TextBMFont",30);
43 alert->setColor(Color3B(159, 168, 176));
44 alert->setPosition(Vec2(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getContentSize().height * 1.75f));
48 TextBMFont* textBMFont = TextBMFont::create(
"BMFont",
"cocosui/bitmapFontTest2.fnt");
49 textBMFont->setPosition(Vec2(widgetSize.width / 2, widgetSize.height / 2.0f + textBMFont->getContentSize().height / 8.0f));
54 TTFConfig ttfConfig(
"fonts/arial.ttf", 15);
55 auto label1 = Label::createWithTTF(ttfConfig,
"Print Resources");
58 auto pMenu1 = Menu::create(item1,
nullptr);
59 pMenu1->setPosition(Vec2(0, 0));
60 this->addChild(pMenu1, 10);
cocos2d::Layer * _uiLayer
virtual bool init() override
cocos2d::ui::Layout * _widget
cocos2d::ui::TextBMFont * _textBMFont
void printWidgetResources(cocos2d::Ref *sender)
static cocos2d::Vec2 bottom()
static cocos2d::Vec2 left()
引用了 _textBMFont, UIScene::_uiLayer, UIScene::_widget, VisibleRect::bottom(), UIScene::init(), VisibleRect::left() , 以及 printWidgetResources().
◆ printWidgetResources()
| void UITextBMFontTest::printWidgetResources |
( |
cocos2d::Ref * |
sender | ) |
|
◆ _textBMFont
| cocos2d::ui::TextBMFont* UITextBMFontTest::_textBMFont |
|
protected |
该类的文档由以下文件生成:
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.h
- /Users/yujizhu/Documents/Git/cocos2d-x-4.0/tests/cpp-tests/Classes/UITest/CocoStudioGUITest/UITextBMFontTest/UITextBMFontTest.cpp