| 560 | } |
| 561 | |
| 562 | LabelFNTGlyphDesigner::LabelFNTGlyphDesigner() |
| 563 | { |
| 564 | auto winSize = Director::getInstance()->getWinSize(); |
| 565 | |
| 566 | auto layer = LayerColor::create(Color4B(128, 128, 128, 255)); |
| 567 | addChild(layer, -10); |
| 568 | |
| 569 | auto label1 = Label::createWithBMFont("fonts/futura-48.fnt", "Testing Glyph Designer"); |
| 570 | // Demo for reloadFontAtlasFNT function, after it been called, all UI widget |
| 571 | // use the special font must reset font, because the old one is invalid. |
| 572 | FontAtlasCache::reloadFontAtlasFNT("fonts/futura-48.fnt", ax::Rect::ZERO, false); |
| 573 | label1->setBMFontFilePath("fonts/futura-48.fnt"); |
| 574 | addChild(label1); |
| 575 | label1->setPosition(Vec2(winSize.width / 2, winSize.height * 0.4f)); |
| 576 | |
| 577 | auto label2 = Label::createWithBMFont("fonts/bitmapFontTest2.fnt", "Hello World"); |
| 578 | label2->setPosition(Vec2(winSize.width / 2, winSize.height * 0.6f)); |
| 579 | addChild(label2); |
| 580 | } |
| 581 | |
| 582 | std::string LabelFNTGlyphDesigner::title() const |
| 583 | { |
nothing calls this directly
no test coverage detected