2013-09-16 20:54:13 +08:00
|
|
|
|
|
|
|
|
|
|
|
#include "UILabelBMFontTest.h"
|
|
|
|
|
|
|
|
|
|
|
|
// UILabelBMFontTest
|
|
|
|
|
|
|
|
bool UILabelBMFontTest::init()
|
|
|
|
{
|
|
|
|
if (UIScene::init())
|
|
|
|
{
|
2013-12-23 15:35:35 +08:00
|
|
|
Size widgetSize = _widget->getSize();
|
2013-09-16 20:54:13 +08:00
|
|
|
|
2013-12-31 16:36:33 +08:00
|
|
|
gui::Text* alert = gui::Text::create();
|
2013-09-16 20:54:13 +08:00
|
|
|
alert->setText("LabelBMFont");
|
2013-12-23 15:35:35 +08:00
|
|
|
alert->setFontName("Marker Felt");
|
2013-09-16 20:54:13 +08:00
|
|
|
alert->setFontSize(30);
|
|
|
|
alert->setColor(Color3B(159, 168, 176));
|
2013-12-23 15:35:35 +08:00
|
|
|
alert->setPosition(Point(widgetSize.width / 2.0f, widgetSize.height / 2.0f - alert->getSize().height * 1.75f));
|
|
|
|
_uiLayer->addChild(alert);
|
2013-09-16 20:54:13 +08:00
|
|
|
|
|
|
|
// Create the LabelBMFont
|
2013-12-31 16:36:33 +08:00
|
|
|
gui::TextBMFont* labelBMFont = gui::TextBMFont::create();
|
2013-09-16 20:54:13 +08:00
|
|
|
labelBMFont->setFntFile("cocosgui/bitmapFontTest2.fnt");
|
|
|
|
labelBMFont->setText("BMFont");
|
|
|
|
labelBMFont->setPosition(Point(widgetSize.width / 2, widgetSize.height / 2.0f + labelBMFont->getSize().height / 8.0f));
|
2013-12-23 15:35:35 +08:00
|
|
|
_uiLayer->addChild(labelBMFont);
|
2013-09-16 20:54:13 +08:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|