From ae997f52ee729bb7fbcdb307bafdf9bc64055d8b Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 20 Oct 2014 14:58:15 +0800 Subject: [PATCH] update test case of LabelTTF --- tests/cpp-tests/Classes/LabelTest/LabelTest.cpp | 17 ++++++++--------- tests/cpp-tests/Classes/LabelTest/LabelTest.h | 6 +++--- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTest.cpp b/tests/cpp-tests/Classes/LabelTest/LabelTest.cpp index 74fecaa0ac..290f5f0875 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTest.cpp +++ b/tests/cpp-tests/Classes/LabelTest/LabelTest.cpp @@ -68,7 +68,7 @@ static std::function createFunctions[] = CL(LabelTTFChinese), CL(LabelBMFontChinese), CL(BitmapFontMultiLineAlignment), - CL(LabelTTFA8Test), + CL(LabelTTFOpacityTest), CL(BMFontOneAtlas), CL(BMFontUnicode), CL(BMFontInit), @@ -1325,18 +1325,17 @@ void BitmapFontMultiLineAlignment::snapArrowsToEdge() this->_labelShouldRetain->getPosition().y)); } -/// LabelTTFA8Test -LabelTTFA8Test::LabelTTFA8Test() +/// LabelTTFOpacityTest +LabelTTFOpacityTest::LabelTTFOpacityTest() { auto s = Director::getInstance()->getWinSize(); auto layer = LayerColor::create(Color4B(128, 128, 128, 255)); addChild(layer, -10); - // LabelBMFont - auto label1 = LabelTTF::create("Testing A8 Format", "Marker Felt", 48); + auto label1 = LabelTTF::create("Testing opacity", "Marker Felt", 48); addChild(label1); - label1->setColor(Color3B::RED); + label1->setFontFillColor(Color3B::RED); label1->setPosition(Vec2(s.width/2, s.height/2)); auto fadeOut = FadeOut::create(2); @@ -1346,12 +1345,12 @@ LabelTTFA8Test::LabelTTFA8Test() label1->runAction(forever); } -std::string LabelTTFA8Test::title() const +std::string LabelTTFOpacityTest::title() const { - return "Testing A8 Format"; + return "Testing opacity"; } -std::string LabelTTFA8Test::subtitle() const +std::string LabelTTFOpacityTest::subtitle() const { return "RED label, fading In and Out in the center of the screen"; } diff --git a/tests/cpp-tests/Classes/LabelTest/LabelTest.h b/tests/cpp-tests/Classes/LabelTest/LabelTest.h index 2f0e0d252f..0883619971 100644 --- a/tests/cpp-tests/Classes/LabelTest/LabelTest.h +++ b/tests/cpp-tests/Classes/LabelTest/LabelTest.h @@ -293,12 +293,12 @@ public: bool _drag; }; -class LabelTTFA8Test : public AtlasDemo +class LabelTTFOpacityTest : public AtlasDemo { public: - CREATE_FUNC(LabelTTFA8Test); + CREATE_FUNC(LabelTTFOpacityTest); - LabelTTFA8Test(); + LabelTTFOpacityTest(); virtual std::string title() const override; virtual std::string subtitle() const override;