From ba7c9771118e046975ea28a9460b365cdff74541 Mon Sep 17 00:00:00 2001 From: minggo Date: Tue, 13 Dec 2016 16:31:31 +0800 Subject: [PATCH] use no border policy (#17004) --- tests/lua-tests/src/controller.lua | 2 +- tests/lua-tests/src/helper.lua | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/lua-tests/src/controller.lua b/tests/lua-tests/src/controller.lua index 36df4734f6..c62cc9efd2 100644 --- a/tests/lua-tests/src/controller.lua +++ b/tests/lua-tests/src/controller.lua @@ -30,7 +30,7 @@ if screenSize.height > 320 then cc.Director:getInstance():setContentScaleFactor(resourceSize.height/designSize.height) end -glView:setDesignResolutionSize(designSize.width, designSize.height, cc.ResolutionPolicy.FIXED_HEIGHT) +glView:setDesignResolutionSize(designSize.width, designSize.height, cc.ResolutionPolicy.NO_BORDER) local fileUtils = cc.FileUtils:getInstance() local function addSearchPath(resPrefix, height) diff --git a/tests/lua-tests/src/helper.lua b/tests/lua-tests/src/helper.lua index 63eba2d289..021f6483dd 100644 --- a/tests/lua-tests/src/helper.lua +++ b/tests/lua-tests/src/helper.lua @@ -75,7 +75,7 @@ end function Helper.initWithLayer(layer) Helper.currentLayer = layer - local size = cc.Director:getInstance():getWinSize() + local size = cc.Director:getInstance():getOpenGLView():getVisibleRect() Helper.titleLabel = cc.Label:createWithTTF("", s_arialPath, 28) Helper.titleLabel:setAnchorPoint(cc.p(0.5, 0.5)) layer:addChild(Helper.titleLabel, 1) @@ -99,9 +99,9 @@ function Helper.initWithLayer(layer) menu:addChild(item2) menu:addChild(item3) menu:setPosition(cc.p(0, 0)) - item1:setPosition(cc.p(size.width / 2 - item2:getContentSize().width * 2, item2:getContentSize().height / 2)) - item2:setPosition(cc.p(size.width / 2, item2:getContentSize().height / 2)) - item3:setPosition(cc.p(size.width / 2 + item2:getContentSize().width * 2, item2:getContentSize().height / 2)) + item1:setPosition(cc.p(size.width / 2 - item2:getContentSize().width * 2, size.y + item2:getContentSize().height / 2)) + item2:setPosition(cc.p(size.width / 2, size.y + item2:getContentSize().height / 2)) + item3:setPosition(cc.p(size.width / 2 + item2:getContentSize().width * 2, size.y + item2:getContentSize().height / 2)) layer:addChild(menu, 1) local background = cc.Layer:create() @@ -124,11 +124,11 @@ function CreateBackMenuItem() local MenuItem = cc.MenuItemLabel:create(label) MenuItem:registerScriptTapHandler(MainMenuCallback) - local s = cc.Director:getInstance():getWinSize() + local s = cc.Director:getInstance():getOpenGLView():getVisibleRect() local Menu = cc.Menu:create() Menu:addChild(MenuItem) Menu:setPosition(0, 0) - MenuItem:setPosition(s.width - 50, 25) + MenuItem:setPosition(s.width - 50, s.y + 25) return Menu end @@ -179,7 +179,7 @@ function TestCastScene.newScene() end function TestCastScene.initWithLayer(scene) - local size = cc.Director:getInstance():getWinSize() + local size = cc.Director:getInstance():getOpenGLView():getVisibleRect() TestCastScene.titleLabel = cc.Label:createWithTTF("", s_arialPath, 28) TestCastScene.titleLabel:setAnchorPoint(cc.p(0.5, 0.5)) scene:addChild(TestCastScene.titleLabel, 1) @@ -203,9 +203,9 @@ function TestCastScene.initWithLayer(scene) menu:addChild(item2) menu:addChild(item3) menu:setPosition(cc.p(0, 0)) - item1:setPosition(cc.p(size.width / 2 - item2:getContentSize().width * 2, item2:getContentSize().height / 2)) - item2:setPosition(cc.p(size.width / 2, item2:getContentSize().height / 2)) - item3:setPosition(cc.p(size.width / 2 + item2:getContentSize().width * 2, item2:getContentSize().height / 2)) + item1:setPosition(cc.p(size.width / 2 - item2:getContentSize().width * 2, size.y + item2:getContentSize().height / 2)) + item2:setPosition(cc.p(size.width / 2, size.y + item2:getContentSize().height / 2)) + item3:setPosition(cc.p(size.width / 2 + item2:getContentSize().width * 2, size.y + item2:getContentSize().height / 2)) scene:addChild(menu, 1) local background = cc.Layer:create()