So I’m testing immersiveSticky visibility mode on xperia Z2
I’m drawing circle and on screenshot below you can see how it stretches when bottom bar is hidden.
The issue is that in both cases display.contentHeight returns same value for me, but display.pixelHeight is changed.
(link to image - https://imgur.com/pdtv8NZ )
my config:
application = { content = { scale = "adaptive", fps = 30, }, }
main.lua code:
local circle local mode = "immersiveSticky" local function drawCircle() local c = display.newCircle(display.contentWidth \* 0.5, display.contentHeight \* 0.5, display.contentWidth \* 0.4) c:addEventListener("tap", function() if (mode == "immersiveSticky") then mode = "default" else mode = "immersiveSticky" end print("mode changed") end) return c end local function printSizes() print("===================== printSizes ============================") print("androidSystemUiVisibility = ", native.getProperty("androidSystemUiVisibility")) print("content", display.contentWidth, display.contentHeight) print("viewable content", display.viewableContentWidth, display.viewableContentHeight) print("actual content", display.actualContentWidth, display.actualContentHeight) print("pixel", display.pixelWidth, display.pixelHeight) print("===================== printSizes ends =======================") end printSizes() display.setStatusBar(display.HiddenStatusBar) display.setDefault("magTextureFilter", "nearest") display.setDefault("minTextureFilter", "nearest") printSizes() local function onSystemEvent(event) local eventType = event.type if (eventType == "applicationStart") then elseif (eventType == "applicationResume") then print("resume") native.setProperty("androidSystemUiVisibility", mode) end end local function onResize(event) print("resize2") printSizes() display.remove(circle) circle = drawCircle() end -- Add the "resize" event listener Runtime:addEventListener("resize", onResize) Runtime:addEventListener("system", onSystemEvent) print("set ui visibility mode", mode) native.setProperty("androidSystemUiVisibility", mode) --end circle = drawCircle()
How can I utilize all screen and avoid stretch? I believe display.contentHeight different value after resize event