Fixed minor problems in test cases.

This commit is contained in:
WenhaiLin 2015-08-07 23:08:49 +08:00
parent d182c37f29
commit 772dab2002
3 changed files with 19 additions and 6 deletions

View File

@ -446,7 +446,7 @@ LabelFNTandTTFEmpty::LabelFNTandTTFEmpty()
auto label2 = Label::createWithTTF(ttfConfig,"", TextHAlignment::CENTER,s.width);
addChild(label2, 0, kTagBitmapAtlas2);
label2->setPosition(Vec2(s.width/2, s.height / 2));
auto label3 = Label::createWithCharMap("fonts/tuffy_bold_italic-charmap.plist");
addChild(label3, 0, kTagBitmapAtlas3);
label3->setPosition(Vec2(s.width/2, 100));
@ -814,7 +814,7 @@ std::string LabelFNTUNICODELanguages::title() const
std::string LabelFNTUNICODELanguages::subtitle() const
{
return "You should see 4 differnt labels:\nIn Spanish, Chinese, Russian and Korean";
return "You should see 4 differnt labels:\nIn Spanish, Chinese, Russian and Japanese";
}
LabelFNTBounds::LabelFNTBounds()

View File

@ -22,7 +22,15 @@ bool UITextAtlasTest::init()
_uiLayer->addChild(alert);
// Create the text atlas
TextAtlas* textAtlas = TextAtlas::create("1234567890", "cocosui/labelatlas.png", 17, 22, "0");
TextAtlas* textAtlas = nullptr;
if (Director::getInstance()->getWinSizeInPixels().height > 320.f)
{
textAtlas = TextAtlas::create("1234567890", "cocosui/labelatlas.png", 34, 44, "0");
}
else
{
textAtlas = TextAtlas::create("1234567890", "cocosui/labelatlas.png", 17, 22, "0");
}
textAtlas->setPosition(Vec2((widgetSize.width) / 2, widgetSize.height / 2.0f));
_uiLayer->addChild(textAtlas);

View File

@ -1211,7 +1211,12 @@ function UILabelAtlasTest:initExtend()
local labelAtlas = ccui.TextAtlas:create()
labelAtlas:setProperty("1234567890", "cocosui/labelatlas.png", 17, 22, "0")
if cc.Director:getInstance():getWinSizeInPixels().height > 320 then
labelAtlas:setProperty("1234567890", "cocosui/labelatlas.png", 34, 44, "0")
else
labelAtlas:setProperty("1234567890", "cocosui/labelatlas.png", 17, 22, "0")
end
labelAtlas:setPosition(cc.p((widgetSize.width) / 2, widgetSize.height / 2.0))
self._uiLayer:addChild(labelAtlas)
@ -1390,12 +1395,12 @@ function UITextFieldTest:initExtend()
if eventType == ccui.TextFiledEventType.attach_with_ime then
local textField = sender
local screenSize = cc.Director:getInstance():getWinSize()
textField:runAction(cc.MoveTo:create(0.225,cc.p(screenSize.width / 2.0, screenSize.height / 2.0 + textField:getContentSize().height / 2.0)))
textField:runAction(cc.MoveBy:create(0.225,cc.p(0, textField:getContentSize().height / 2.0)))
self._displayValueLabel:setString("attach with IME")
elseif eventType == ccui.TextFiledEventType.detach_with_ime then
local textField = sender
local screenSize = cc.Director:getInstance():getWinSize()
textField:runAction(cc.MoveTo:create(0.175, cc.p(screenSize.width / 2.0, screenSize.height / 2.0)))
textField:runAction(cc.MoveBy:create(0.175, cc.p(0, textField:getContentSize().height / -2.0)))
self._displayValueLabel:setString("detach with IME")
elseif eventType == ccui.TextFiledEventType.insert_text then
self._displayValueLabel:setString("insert words")