Godot Version
4.4.1
Question
Hello all,
I have disabled all the configurations related to the splash screen, but I still see a gray rectangle when the game starts. How can I eliminate this 1–2 second splash screen?
I’m trying to do this with C++.
code:
void GameInitWindow::_ready() {
DisplayServer* ds = DisplayServer::get_singleton();
ds->window_set_flag(DisplayServer::WINDOW_FLAG_TRANSPARENT, true);
// get_viewport()->set_transparent_background(true);
int screen_index = ds->get_primary_screen(); // Or use screen_get_current()
Vector2 screen_size = ds->screen_get_size(screen_index);
int width = static_cast<int>(screen_size.x); // Full screen width
int height = 240;
ds->window_set_size(Vector2(width, height));
ds->window_set_position(Vector2(0, screen_size.y - height));
ds->window_set_flag(DisplayServer::WINDOW_FLAG_BORDERLESS, true);
ds->window_set_flag(DisplayServer::WINDOW_FLAG_ALWAYS_ON_TOP, true);
get_viewport()->set_transparent_background(true);
//CanvasItem::update(); // Explicit to avoid ambiguity
}