Loadscreen - Multiple resolutions and stretch modes#218
Merged
kitty624 merged 3 commits intoSep 2, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multiple resolutions of loading screens can be used by adding a prefix to the loading screen file. Similar feature was previously available for _800x600 and _1024x786 at one point, but seems to be removed since. In this version, the "best" resolution variant will always be used; the game will select the largest variant equal to or exceeding the current screen resolution. For instance, if we have only the 800x600 and 1920x1080 variants, the 800x600 variant will be used for all resolutions between 640x480 and 800x600, and the 1920x1080 variant will be used for all resolutions above.
Loading screens can be configured to use different stretch modes:
Stretch - Always stretch to fit the screen.
Match Height - Stretch the image so its height matches the screen height, maintaining aspect ratio. This will add black bars on the sides if the screen is wider and crop the image otherwise.
Match Height for Widescreen - Maintain the aspect ratio for images wider than the screen; otherwise, stretch. This ensures no black bars and won't scale down widescreen images. It's particularly useful for derivative mods using mixed aspect ratios for loading screen images.
The stretch mode also affects the loading bar, ensuring it always aligns with the image (all standard loading screens incorporate a loading bar frame within the asset).
My recommended default setting: Match Height. Matter of taste, I personally find black bars better than a skewed aspect ratio.
Related fixes:
640x480 before - bar pixel short, black outline last second only


640x480 after
1920x1080 before - bar not fitting the frame



1920x1080 after - stretch mode
1920x1080 after - match height mode
1920x1080 with default asset - match height mode


1920x1080 if upscaled asset is provided - match height mode
Gamedir PR: 1dot13/gamedir#58