cocos-engine
cocos-engine copied to clipboard
[3.6.0] Support device vs design aspect ratio in Splash Screen
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. Re: #
Changelog
Continuous Integration
This pull request:
- [ ] needs automatic test cases check.
Manual trigger with
@cocos-robot run test cases
afterward. - [ ] does not change any runtime related code or build configuration
If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.
Compatibility Check
This pull request:
- [ ] changes public API, and have ensured backward compatibility with deprecated features.
- [ ] affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
- [ ] affects file structure of the build package or build configuration which requires user project upgrade.
- [ ] introduces breaking changes, please list all changes, affected features and the scope of violation.
Interface Check Report
This pull request does not change any public interfaces !
Hi, @mikecoker we are about to submit last round QA for v3.6, and new features won't be accepted in this version, but it will be taken into v3.6.1
Thanks for your contribution, we have refactor the splash screen in v3.7. And I think this PR is unnecessary. Feel free if you rebased this to v3.7