Window::useSplashLogo()
Browser availability: desktop-only.
The browser has no desktop splash window. This option only reports a limitation.
Puts your own picture on the loading screen in place of the Scratch for Java logo. The picture fades in while your project starts and fades out again once it is ready.
It is shrunk to fit if it is large, and never enlarged, so a picture of roughly 300 by 300 looks right in a window of the usual size.
Call it before the first stage is created, because the loading screen is the first thing the window draws:
public static void main(String[] args) {
Window.useSplashLogo("assets/logo.png");
new MyStage();
}
Examples
This example requires the desktop runtime in the current browser revision.
void main() {
// The picture shown while the window is starting up - a file next to the
// program, or a built-in sprite. It has to be said before the window is
// built.
Window.useSplashLogo("slimeGreen");
Window myWindow = new Window(600, 240);
myWindow.setStage(new Stage());
}
Syntax
Java
.useSplashLogo(path)
Parameters
| Name | Data Type | Description |
|---|---|---|
| path | String | a path to an image file or the name of a built-in sprite, or `null` for the Scratch for Java logo |
Return
void