Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add web support for all missing splash screen properties #99296

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion misc/dist/html/full-size.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@
margin: auto;
}

#status-splash.show-image--false {
display: none;
}

#status-splash.fullsize--true {
height: 100%;
width: 100%;
object-fit: contain;
}

#status-splash.use-filter--false {
image-rendering: pixelated;
}

#status-progress, #status-notice {
display: none;
}
Expand Down Expand Up @@ -88,7 +102,7 @@
</noscript>

<div id="status">
<img id="status-splash" src="$GODOT_SPLASH" alt="">
<img id="status-splash" class="$GODOT_SPLASH_CLASSES" src="$GODOT_SPLASH" alt="">
<progress id="status-progress"></progress>
<div id="status-notice"></div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions platform/web/export/export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ void EditorExportPlatformWeb::_fix_html(Vector<uint8_t> &p_html, const Ref<Edito
replaces["$GODOT_HEAD_INCLUDE"] = head_include + custom_head_include;
replaces["$GODOT_CONFIG"] = str_config;
replaces["$GODOT_SPLASH_COLOR"] = "#" + Color(GLOBAL_GET("application/boot_splash/bg_color")).to_html(false);

LocalVector<String> godot_splash_classes;
godot_splash_classes.push_back("show-image--" + String(GLOBAL_GET("application/boot_splash/show_image")));
godot_splash_classes.push_back("fullsize--" + String(GLOBAL_GET("application/boot_splash/fullsize")));
godot_splash_classes.push_back("use-filter--" + String(GLOBAL_GET("application/boot_splash/use_filter")));
replaces["$GODOT_SPLASH_CLASSES"] = String(" ").join(godot_splash_classes);
replaces["$GODOT_SPLASH"] = p_name + ".png";

if (p_preset->get("variant/thread_support")) {
Expand Down