Hi,
I borrowed an iPhone 7+ for testing purposes, and was surprised to see the “scale factor” was set at 1. Low res images look quite bad on the device.
I checked display.pixelWidth / display.actualContentWidth (is this the correct formula for scale factor) and can see it 1.85125, so it should be “@2x” as I have the threshhold set at 1.1?.
I am using Sergy’s Pixel Perfect config.lua (although I made the erroneous decision to set the screen at 800 x 1200, too late in the project to change this now) which sets the contentWidth and contentHeight at 1480 x 800 respectively.
I think I am missing something here, can anyone shed some light on this for me now? Is there anyway to tweak my setting to get the correct images loading without having to redo everything (been working on this game for over a year and about 2 weeks from publishing)? Currently, I am being rather old school and including an ‘if statement’ in my config.lua to compensate (not shown because I am hoping it is not needed…)
local w, h = display.pixelWidth, display.pixelHeight local modes = {1, 1.5, 2, 3, 4, 6, 8} -- Scaling factors to try local contentW, contentH = 800, 1200 -- Minimal size your content can fit in -- Try each mode and find the best one local \_w, \_h, \_m = w, h, 1 for i = 1, #modes do local m = modes[i] local lw, lh = w / m, h / m if lw \< contentW or lh \< contentH then break else \_w, \_h, \_m = lw, lh, m end end -- If scaling is not pixel perfect (between 1 and 2) - use letterbox if \_m \< 2 then local scale = math.max(contentW / w, contentH / h) \_w, \_h = w \* scale, h \* scale end application = { license = { google = { key = "" }, }, showRuntimeErrors = true, content = { width = \_w, height = \_h, scale = 'letterbox', fps = 60, imageSuffix = { ['@2x'] = 1.1, } } }
Thanks,
Craig