You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Add Stretch Modes for Splash Screen
Co-authored-by: Samuel Pedrajas <samuelpedrajaspz@gmail.com>
This commit is contained in:
@@ -3681,7 +3681,8 @@ void Main::setup_boot_logo() {
|
||||
|
||||
if (show_logo) { //boot logo!
|
||||
const bool boot_logo_image = GLOBAL_DEF_BASIC("application/boot_splash/show_image", true);
|
||||
const bool boot_logo_scale = GLOBAL_DEF_BASIC("application/boot_splash/fullsize", true);
|
||||
|
||||
const RenderingServer::SplashStretchMode boot_stretch_mode = GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "application/boot_splash/stretch_mode", PROPERTY_HINT_ENUM, "Disabled,Keep,Keep Width,Keep Height,Cover,Ignore"), 1);
|
||||
const bool boot_logo_filter = GLOBAL_DEF_BASIC("application/boot_splash/use_filter", true);
|
||||
String boot_logo_path = GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "application/boot_splash/image", PROPERTY_HINT_FILE, "*.png"), String());
|
||||
|
||||
@@ -3721,7 +3722,7 @@ void Main::setup_boot_logo() {
|
||||
boot_bg_color = GLOBAL_DEF_BASIC("application/boot_splash/bg_color", (editor || project_manager) ? boot_splash_editor_bg_color : boot_splash_bg_color);
|
||||
#endif
|
||||
if (boot_logo.is_valid()) {
|
||||
RenderingServer::get_singleton()->set_boot_image(boot_logo, boot_bg_color, boot_logo_scale, boot_logo_filter);
|
||||
RenderingServer::get_singleton()->set_boot_image_with_stretch(boot_logo, boot_bg_color, boot_stretch_mode, boot_logo_filter);
|
||||
|
||||
} else {
|
||||
#ifndef NO_DEFAULT_BOOT_LOGO
|
||||
@@ -3735,7 +3736,7 @@ void Main::setup_boot_logo() {
|
||||
MAIN_PRINT("Main: ClearColor");
|
||||
RenderingServer::get_singleton()->set_default_clear_color(boot_bg_color);
|
||||
MAIN_PRINT("Main: Image");
|
||||
RenderingServer::get_singleton()->set_boot_image(splash, boot_bg_color, false);
|
||||
RenderingServer::get_singleton()->set_boot_image_with_stretch(splash, boot_bg_color, RenderingServer::SPLASH_STRETCH_MODE_DISABLED);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user