First off please don’t point out how foolish it was of us to get to this stage in development having never tested the game on a 3GS, we fully understand our stupid mistake
Our problem is that on all resolutions our objects are positioned perfectly except on the 3GS which has the the contentScaleX and Y of 1.
This is our config.lua file.
local aspectRatio = display.pixelHeight / display.pixelWidth application = { content = { width = aspectRatio \> 1.5 and 320 or math.ceil( 480 / aspectRatio ), height = aspectRatio \< 1.5 and 480 or math.ceil( 320 \* aspectRatio ), scale = "letterBox", fps = 60, imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, }, }, }
In our engine all objects have their positions set in a scene layout file, to try to get things to work on all resolutions we have everything positioned as an offset from the centre of the screen. This has been working great so far on every device, until we tested on the 3GS.
This is one of the scenes in the game working fine on the iPhone 4:
And this is the same scene on the 3GS:
As you can see, both the background image and the centre dial image are positioned correctly. Both of these have no offset set so they are both in the centre of the screen. The other 4 dials all have an offset specified and you can see they are no longer in the desired positions.
What we need is some kind of scaling factor we could apply to the positions so that they would be placed where they are supposed to be but I just can’t think of how I could do it without having it affect all other resolutions.
I can provide more code if required or an apk of the project to see it in action if that helps. I’m also going to try to simplify everything into a small demo.