You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Add Stretch Modes for Splash Screen
Co-authored-by: Samuel Pedrajas <samuelpedrajaspz@gmail.com>
This commit is contained in:
@@ -98,9 +98,32 @@ HashMap<String, Variant> EditorExportPlatformIOS::get_custom_project_settings(co
|
||||
switch (image_scale_mode) {
|
||||
case 0: {
|
||||
String logo_path = get_project_setting(p_preset, "application/boot_splash/image");
|
||||
bool is_on = get_project_setting(p_preset, "application/boot_splash/fullsize");
|
||||
RenderingServer::SplashStretchMode stretch_mode = get_project_setting(p_preset, "application/boot_splash/stretch_mode");
|
||||
// If custom logo is not specified, Godot does not scale default one, so we should do the same.
|
||||
value = (is_on && logo_path.length() > 0) ? "scaleAspectFit" : "center";
|
||||
if (logo_path.is_empty()) {
|
||||
value = "center";
|
||||
} else {
|
||||
switch (stretch_mode) {
|
||||
case RenderingServer::SplashStretchMode::SPLASH_STRETCH_MODE_DISABLED: {
|
||||
value = "center";
|
||||
} break;
|
||||
case RenderingServer::SplashStretchMode::SPLASH_STRETCH_MODE_KEEP: {
|
||||
value = "scaleAspectFit";
|
||||
} break;
|
||||
case RenderingServer::SplashStretchMode::SPLASH_STRETCH_MODE_KEEP_WIDTH: {
|
||||
value = "scaleAspectFit";
|
||||
} break;
|
||||
case RenderingServer::SplashStretchMode::SPLASH_STRETCH_MODE_KEEP_HEIGHT: {
|
||||
value = "scaleAspectFit";
|
||||
} break;
|
||||
case RenderingServer::SplashStretchMode::SPLASH_STRETCH_MODE_COVER: {
|
||||
value = "scaleAspectFill";
|
||||
} break;
|
||||
case RenderingServer::SplashStretchMode::SPLASH_STRETCH_MODE_IGNORE: {
|
||||
value = "scaleToFill";
|
||||
} break;
|
||||
}
|
||||
}
|
||||
} break;
|
||||
default: {
|
||||
value = storyboard_image_scale_mode[image_scale_mode - 1];
|
||||
|
||||
Reference in New Issue
Block a user