感觉quick3.3分辨率有问题啊?

我之前写过一个九宫格平铺图片的demo,在2.2.5的时候,所有分辨率下都是正确的。
但我使用quick3.3之后,首先就发现这个在iphone5s的分辨率下时错误的,会超出屏幕外。
然后我发现,我根据display的屏幕矩形做一些操作时,点击点位置也会出现相应的偏移!!!
我不知道是我代码有错,还是3.3改过些什么。

以下这段代码就是九宫格代码,在2.2.5和3.3下都能运行,但在2.2.5下所有分辨率都是对的,3.3下某些屏幕分辨率不对。


–九宫格

–九宫格背景图,无拉伸,只是图片复制
function nineSlotSetting(uiParent,rootPath,nineSlotNameAffix,zOrder,bgRect)
local layer = cc.Layer:create()
uiParent:addChild(layer,zOrder)
uiParent = layer

rootPath = rootPath or “images”
nineSlotNameAffix = nineSlotNameAffix or “ninePicture_”

local leftTop = nil
local rightTop = nil
local leftBottom = nil
local rightBottom = nil

–四个角

–左上
local sprite = cc.Sprite:create(rootPath…"/"…nineSlotNameAffix…“1.png”)
sprite:setPosition(cc.p(bgRect.left + sprite:getContentSize().width / 2,bgRect.top - sprite:getContentSize().height / 2))
leftTop = sprite
–右上
sprite = cc.Sprite:create(rootPath…"/"…nineSlotNameAffix…“3.png”)
sprite:setPosition(cc.p(bgRect.right - sprite:getContentSize().width / 2,bgRect.top - sprite:getContentSize().height / 2))
rightTop = sprite
–左下
sprite = cc.Sprite:create(rootPath…"/"…nineSlotNameAffix…“7.png”)
sprite:setPosition(cc.p(bgRect.left + sprite:getContentSize().width / 2,bgRect.bottom + sprite:getContentSize().height / 2))
leftBottom = sprite
–右下
sprite = cc.Sprite:create(rootPath…"/"…nineSlotNameAffix…“9.png”)
sprite:setPosition(cc.p(bgRect.right - sprite:getContentSize().width / 2,bgRect.bottom + sprite:getContentSize().height / 2))
rightBottom = sprite


–中间块
local widthTop = bgRect.right - leftTop:getContentSize().width - rightTop:getContentSize().width - bgRect.left
local widthBottom = bgRect.right - leftBottom:getContentSize().width - rightBottom:getContentSize().width - bgRect.left

local heightLeft = bgRect.top - leftTop:getContentSize().height - leftBottom:getContentSize().height - bgRect.bottom
local heightRight = bgRect.top - rightTop:getContentSize().height - rightBottom:getContentSize().height - bgRect.bottom

sprite = display.newTilesSprite(rootPath…"/"…nineSlotNameAffix…“5.png”,cc.rect(bgRect.left,bgRect.right,bgRect.right-bgRect.left,bgRect.top-bgRect.bottom))
sprite:setPosition(bgRect.left,bgRect.bottom)
uiParent:addChild(sprite,zOrder)


–四条边

–中上
sprite = cc.Sprite:create(rootPath…"/"…nineSlotNameAffix…“2.png”)
sprite = display.newTilesSprite(rootPath…"/"…nineSlotNameAffix…“2.png”,cc.rect(0,0,widthTop,sprite:getContentSize().height))
sprite:setPosition(cc.p(leftTop:getContentSize().width,bgRect.top - sprite:getContentSize().height))
uiParent:addChild(sprite,zOrder)
–中下
sprite = cc.Sprite:create(rootPath…"/"…nineSlotNameAffix…“8.png”)
sprite = display.newTilesSprite(rootPath…"/"…nineSlotNameAffix…“8.png”,cc.rect(0,0,widthBottom,sprite:getContentSize().height))
sprite:setPosition(cc.p(leftBottom:getContentSize().width,bgRect.bottom))
uiParent:addChild(sprite,zOrder)
–左中
sprite = cc.Sprite:create(rootPath…"/"…nineSlotNameAffix…“4.png”)
sprite = display.newTilesSprite(rootPath…"/"…nineSlotNameAffix…“4.png”,cc.rect(0,0,sprite:getContentSize().width,heightLeft))
sprite:setPosition(cc.p(0,bgRect.bottom + leftBottom:getContentSize().height))
uiParent:addChild(sprite,zOrder)
–右中
sprite = cc.Sprite:create(rootPath…"/"…nineSlotNameAffix…“6.png”)
sprite = display.newTilesSprite(rootPath…"/"…nineSlotNameAffix…“6.png”,cc.rect(0,0,sprite:getContentSize().width,heightRight))
sprite:setPosition(cc.p(bgRect.right - sprite:getContentSize().width,bgRect.bottom + rightBottom:getContentSize().height))
uiParent:addChild(sprite,zOrder)


–最后加入四个角
uiParent:addChild(leftTop,zOrder)
uiParent:addChild(rightTop,zOrder)
uiParent:addChild(leftBottom,zOrder)
uiParent:addChild(rightBottom,zOrder)

return layer
end

我之所以怀疑3.3有问题,是因为我使用3.3的player测试我这段代码时,我加了一个屏幕onTouch时点击点x,y坐标的输出,然后我发现
我将屏幕使用75%缩放时,我那个九宫格错了,于是我输出x,y坐标,然后发现,我点击的那个右下角位置的坐标y值居然非常大有32个这么大,
我正常大小时,点击右下角,只要是贴着边点击的,大多数都应该是4-8之间,所以我怀疑3.3有问题。

不要在player的缩放下做测试,你正常大小测试

以前缩放正常啊,点击也是正常的。
缩放容易点击全部屏幕,否则有些时候点击不到,很不方便啊。

32 。。。。

请问是在 win32 下么。。

确实是模拟器下面,因为真机很难一下子测试很多机型,所以我一般都先在模拟器下对很多分辨率进行测试后,才真机测试。
这样大部分bug都能在win32下就能查出来。

嗯,应该是 菜单栏的高度问题,缩放时候没有计算在内,v3 上已经修复 。