I am running into an assertion crash in my app and looking for help in understanding how Gideros chooses which assets to use based on the screen scaling. My app is built for 320x480, letterbox, portrait with base,
@2x and
@4x assets. This has traditionally worked fine on iPhones. However, I recently installed my app on an iPhone 15 Pro (960x1704) and starting getting a crash. The problem was that my code assumes that
application:getLogicalScaleX() will always return 1, 2 or 4. However in this case it's getting 3 back for the scale and the dimensions of any Texture I load show that they are coming from my "
@4x" texture files.
Getting 3 back for the scale makes sense and my app hasn't been built nor run on Gideros for 12 years so either it's never encountered a 3x scale iOS device OR a change in Gideros now returns 3 instead of 4 despite it appearing to use the 4x assets. I built my app originally according to the instructions
in the Wiki.
So my questions are:
- Is my app just really old and never got a 3x scaling until these newer iOS devices? Or...
- Did Gideros change and used to only return 1, 2 or 4 given that's the only assets I have?
- If Gideros returns a scale of 3 but my Textures are being loaded from the 4x files, should I be detecting that and scaling things myself?
Thanks in advance for any help.
PS - application:getDeviceInfo() returns the following:
{["platform"]="iOS", ["version"]="18.5", ["model"]="iPhone16,1", ["ui"]="iPhone", ["height"]=1704, ["type"]="iPhone", ["width"]=960} |
Comments
on the other hand this does not answer why you never had this crash in the past.
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Where I'm scratching my head is that Gideros isn't telling me which texture assets (1x, 2x, 4x) it has chosen so I'm going to have to figure that out on my own (4x in this case). , create a bitmap from the texture, then resize it to fit the 3x returned by getLogicalScaleX() ? Or perhaps I should use the Pixel object which supports texture scaling.
Will keep working on it.
Likes: MoKaLux
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: keszegh, MoKaLux