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

Method LabelTTFEmoji

tests/cpp-tests/Source/LabelTest/LabelTest.cpp:1228–1239  ·  view source on GitHub ↗

LabelTTFEmoji emoji test

Source from the content-addressed store, hash-verified

1226// LabelTTFEmoji emoji test
1227//
1228LabelTTFEmoji::LabelTTFEmoji()
1229{
1230 std::string emojiString = FileUtils::getInstance()->getStringFromFile("fonts/emoji.txt");
1231 auto winSize = Director::getInstance()->getWinSize();
1232
1233 auto label = Label::createWithTTF(emojiString, "fonts/NotoEmoji-Regular.ttf", 23);
1234 label->setPosition(winSize.width / 2, winSize.height / 2);
1235 label->setDimensions(winSize.width, winSize.height);
1236 label->setVerticalAlignment(ax::TextVAlignment::CENTER);
1237 label->setHorizontalAlignment(ax::TextHAlignment::CENTER);
1238 addChild(label);
1239}
1240
1241std::string LabelTTFEmoji::title() const
1242{

Callers

nothing calls this directly

Calls 6

getInstanceFunction · 0.85
getStringFromFileMethod · 0.80
setVerticalAlignmentMethod · 0.80
setPositionMethod · 0.45
setDimensionsMethod · 0.45

Tested by

no test coverage detected