X Tutup
Skip to content

Add Stretch Modes for Splash Screen#109596

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
atlasapplications:splash-screen-stretch-mode
Oct 22, 2025
Merged

Add Stretch Modes for Splash Screen#109596
Repiteo merged 1 commit intogodotengine:masterfrom
atlasapplications:splash-screen-stretch-mode

Conversation

@atlasapplications
Copy link
Contributor

@atlasapplications atlasapplications commented Aug 14, 2025

Rework of #56959

Its been a few years since that PR has been modified (originally made for 4.0) so I started again with 4.5, solved any conflicts with the previous one, and made some additions with how new platform specific splash screens are handled.

To rehash, this will replace the application/boot_splash/fullsize project setting that can only be toggled on or off in favor of various stretching options that change how the boot image will appear for Godot projects on startup.

It's a full upgrade because the stretching options include what toggling full size on or off meant previously and with the new options. However, this mostly applies to the editor boot splash and exported desktop platforms because mobile platforms have their own platform-specific approaches for showing boot splashes.

The new setting is called application/boot_splash/stretch_mode and the options include:

  • Disabled (same as toggling the legacy full size project setting off, no stretching applied)
  • Keep (same as toggling the legacy full size project setting on, stretches while preserving aspect ratio)
  • Keep Width (stretches width based on height)
  • Keep Height (stretches height based on the width)
  • Cover (stretches until it covers the entire screen while preserving aspect ratio)
  • Expand (stretches until it covers the entire screen but doesn't preserve aspect ratio)

To preserve compatibility, set_boot_splash retains the same signature but now routes to a new function set_boot_splash_with_stretch which is what's now used for the various renderers. Also, for projects that still have the legacy project setting serialized, a check is done to convert that to the corresponding stretch option.

@AThousandShips
Copy link
Member

Changing the type of an argument is a significant compatibility breakage, doesn't necessarily stop this but I think alternative solutions need to be evaluated that won't be so disruptive

@atlasapplications
Copy link
Contributor Author

@AThousandShips Per our discussion, I've refactored to preserve compatibility and added new functions for the added functionality. Thank you for mentioning those changes!

@atlasapplications atlasapplications marked this pull request as ready for review August 19, 2025 15:15
@atlasapplications atlasapplications requested review from a team as code owners August 19, 2025 15:15
@atlasapplications atlasapplications requested a review from a team August 19, 2025 15:15
@atlasapplications atlasapplications requested a review from a team as a code owner August 19, 2025 15:15
Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, it works as expected. Code looks good to me.

Some feedback:

  • Expand should be renamed to "Ignore" (for consistency with the stretch aspect project setting), "Distort" or perhaps just "Stretch" as it leads to aspect ratio distortion. This should be made clear from the get go as it's generally a bad option for anything that displays a logo.
    • Maybe "Ignore (Distort)"?

Testing project: test_pr_109596.zip

Example with the default setting at various aspect ratios (splash image is 7680×2160, i.e. designed for 4K displays with aspect ratio up to 32:9):

Screenshot_20250819_194749 Screenshot_20250819_194800 Screenshot_20250819_194813

Stretch mode comparison

Window aspect ratio is 48:9.

Disabled

Screenshot_20250819_195035

Keep / Keep Height

Screenshot_20250819_195031

Keep Width / Cover

Screenshot_20250819_195007

Expand

Screenshot_20250819_195017

@LoganMinarik
Copy link

This looks nice

@atlasapplications
Copy link
Contributor Author

@Calinou Regarding your feedback, and now that you mention it, I'm noticing numerous conflicting naming schemes that lead me to wonder what is the best route for consistency and coherence.

There's StretchMode in AspectRatioContainer, StretchMode in TextureRect and lastly, as you mentioned, the project setting stretch modes.

Perhaps this new project setting could follow TextureRect's naming scheme because it's a single setting that mostly maps to the same functionality minus the layout options. So, maybe scale would be better? Ignore might not be bad but what could be confusing is that other project setting does have an option named expand.

@atlasapplications atlasapplications force-pushed the splash-screen-stretch-mode branch from 365cd14 to d2e1754 Compare September 27, 2025 19:22
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine now. I tested that it works on Windows, other platforms might still need testing.

@KoBeWi KoBeWi modified the milestones: 4.x, 4.6 Sep 28, 2025
@atlasapplications atlasapplications force-pushed the splash-screen-stretch-mode branch 2 times, most recently from 24330ec to 2d0b128 Compare October 1, 2025 21:26
@akien-mga
Copy link
Member

akien-mga commented Oct 1, 2025

@atlasapplications Thanks for picking it up, I could never find motivation to revive #56959 myself.

Since you reused the code from that PR, it would be good to add @samuelpedrajas as co-author. Edit: Resolved.

@atlasapplications
Copy link
Contributor Author

@akien-mga Absolutely! Happy to continue it. Thanks for mentioning the co-author point, I went ahead and did that.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested again on macOS 26, it works as expected. Code looks good to me.

@atlasapplications atlasapplications force-pushed the splash-screen-stretch-mode branch from 6b67385 to ea03a9c Compare October 3, 2025 02:48
@Repiteo
Copy link
Contributor

Repiteo commented Oct 21, 2025

Needs a rebase

@atlasapplications atlasapplications force-pushed the splash-screen-stretch-mode branch from ea03a9c to 948006e Compare October 21, 2025 20:25
Co-authored-by: Samuel Pedrajas <samuelpedrajaspz@gmail.com>
@atlasapplications atlasapplications force-pushed the splash-screen-stretch-mode branch from e8e2bed to b6b3e1e Compare October 21, 2025 22:21
@Repiteo Repiteo merged commit 3f34e38 into godotengine:master Oct 22, 2025
19 of 20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Oct 22, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

X Tutup