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

Method LabelIssue15214

tests/cpp-tests/Source/LabelTest/LabelTest.cpp:3945–3976  ·  view source on GitHub ↗

LabelIssue15214

Source from the content-addressed store, hash-verified

3943// LabelIssue15214
3944//
3945LabelIssue15214::LabelIssue15214()
3946{
3947 auto size = Director::getInstance()->getVisibleSize();
3948
3949 // 1
3950 Label* label = Label::createWithTTF("TTF with setColor()", "fonts/arial.ttf", 24.0f);
3951 label->enableUnderline();
3952 label->setColor(ax::Color3B::BLUE);
3953 label->setPosition(size.width / 2, size.height / 5 * 4);
3954 this->addChild(label);
3955
3956 // 2
3957 Label* label2 = Label::createWithSystemFont("System with setColor()", "Verdana", 24.0f);
3958 label2->enableUnderline();
3959 label2->setColor(ax::Color3B::BLUE);
3960 label2->setPosition(size.width / 2, size.height / 5 * 3);
3961 this->addChild(label2);
3962
3963 // 3
3964 Label* label3 = Label::createWithTTF("TTF with setTextColor()", "fonts/arial.ttf", 24.0f);
3965 label3->enableUnderline();
3966 label3->setTextColor(Color4B::BLUE);
3967 label3->setPosition(size.width / 2, size.height / 5 * 2);
3968 this->addChild(label3);
3969
3970 // 4
3971 Label* label4 = Label::createWithSystemFont("System with setTextColor()", "Verdana", 24.0f);
3972 label4->enableUnderline();
3973 label4->setTextColor(Color4B::BLUE);
3974 label4->setPosition(size.width / 2, size.height / 5 * 1);
3975 this->addChild(label4);
3976}
3977
3978std::string LabelIssue15214::title() const
3979{

Callers

nothing calls this directly

Calls 7

getInstanceFunction · 0.85
enableUnderlineMethod · 0.80
getVisibleSizeMethod · 0.45
setColorMethod · 0.45
setPositionMethod · 0.45
addChildMethod · 0.45
setTextColorMethod · 0.45

Tested by

no test coverage detected