Splash Screen Device vs Design aspect ratio

Currently the Splash Screen in the engine uses a hard coded displayRatio setting in the build configuration and I guess that’s trying to fill the role of what I actually need. I need this value to be dynamic based on the device that’s running the game.

Mobile web devices come in various aspect ratios that may or may not match the design ratio. We need to compare the design aspect ratio to the device aspect ratio and use that as a multiplier on the splash screen to ensure it fits. Previously iPhone had 1.77 aspect ratio but newer devices seem to be 2.16.

Typically designers would be designing for a 1.77 aspect ratio, so we would need a ratio modifier based on the device it runs on. It would be 1.0 for older devices and 1.22 for newer. But rather than hard code these values, I want to use the aspect ratio of the device and the aspect ratio of the design resolution to calculate it dynamically.

This change would probably negate the need for the hard coded displayRatio in settings and tbh, I’m not even sure why that exists since it isn’t dynamic.

I’ve tested this change locally and it works for my needs. I have a PR Support device vs design aspect ratio by mikecoker · Pull Request #12159 · cocos/cocos-engine · GitHub

1 Like

Ok, we will reply you in the pr, please keep watching the pr for the latest progress.