mirror of https://github.com/axmolengine/axmol.git
use no border policy (#17004)
This commit is contained in:
parent
80954d392d
commit
ba7c977111
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue