screen adjust

This commit is contained in:
2020-07-11 10:57:19 +08:00
parent 19eaa467e9
commit f563839566
20 changed files with 713 additions and 549 deletions

View File

@@ -12,12 +12,16 @@ MyUtl.getUIContent = function(panel, top, bottom, forceCal)
-- if _ContentRect and (not forceCal) then
-- return _ContentRect
-- end
local sizeAdjust = UIRoot.GetPixelSizeAdjustment(panel.gameObject)
local height = Screen.height * sizeAdjust
top = top or _TopHeight_
bottom = bottom or _BottomHeight_
local sizeAdjust = UIRoot.GetPixelSizeAdjustment(panel.gameObject)
local offsetRect = NGUITools.offsetRect
top = top + offsetRect.y * height
bottom = bottom + offsetRect.w * height
_sizeAdjust = sizeAdjust
_ContentRect =
Vector4(0, (bottom - top) / 2, Screen.width * sizeAdjust, Screen.height * sizeAdjust - (bottom + top))
_ContentRect = Vector4(0, (bottom - top) / 2, Screen.width * sizeAdjust, height - (bottom + top))
return _ContentRect
end