28using namespace cocos2d::ui;
30UITextBMFontTests::UITextBMFontTests()
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);
68 cocos2d::ResourceData textureFile =
_textBMFont->getRenderFile();
69 CCLOG(
"textureFile Name : %s, Type: %d", textureFile.file.c_str(), textureFile.type);
#define ADD_TEST_CASE(__className__)
cocos2d::Layer * _uiLayer
virtual bool init() override
cocos2d::ui::Layout * _widget
cocos2d::ui::TextBMFont * _textBMFont
virtual bool init() override
void printWidgetResources(cocos2d::Ref *sender)
static cocos2d::Vec2 bottom()
static cocos2d::Vec2 left()