MCPcopy Create free account
hub / github.com/axmolengine/axmol / LabelFNTGlyphDesigner

Method LabelFNTGlyphDesigner

tests/cpp-tests/Source/LabelTest/LabelTest.cpp:562–580  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560}
561
562LabelFNTGlyphDesigner::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
582std::string LabelFNTGlyphDesigner::title() const
583{

Callers

nothing calls this directly

Calls 6

getInstanceFunction · 0.85
createFunction · 0.85
Color4BFunction · 0.85
Vec2Function · 0.50
setBMFontFilePathMethod · 0.45
setPositionMethod · 0.45

Tested by

no test coverage detected