Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Logical Scale and Texture Sizes — Gideros Forum

Logical Scale and Texture Sizes

troysandaltroysandal Member
edited June 17 in General questions
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:
  1. Is my app just really old and never got a 3x scaling until these newer iOS devices? Or...
  2. Did Gideros change and used to only return 1, 2 or 4 given that's the only assets I have?
  3. 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}

image
Screenshot 2025-06-17 at 9.21.39 AM.png
1188 x 1414 - 420K

Comments

Sign In or Register to comment.