How to make a splash screen

so i’m working on a game project for class and we need to have some sort of splash screen i wondering if there was a tutorial on how to do this with JME that i could display a blank screen with a few simple text items on and then it disappears after about 5 seconds?

A splash screen usually is a simple window without borders nor system buttons.

You should first make one in pure JAVA, without JME.

then merge your splash screen code before starting JME’s engine.



A splash screen with JME wouldn’t be a splash screen anymore… “does not compute”.

For a “real” Java6 splash theres an option in the project settings for that. Else just create a swing window that shows up. You can install the “GUI Builder” plugin to edit swing windows visually.

I would use nifty gui :roll:.

Again I was looking through my old posts and stumbled upon my topic Splash Screen for JMonkey Games as a result I found this really old post.

it seems like a good enough place to post my JMonkeyEngine3 splash screen technique.

Example Steps:

  1. Display a Picture on the GuiNode
  2. Queue a method to init the application
    1. Load Scene
    2. Detach Picture From GuiNode after everything is loaded
Example Logic: [java]public void simpleInitApp() { final Picture splashScreen = new Picture("Splash Screen"); splashScreen.setImage(assetManager, "Textures/MySplashScreen.png", true); splashScreen.setWidth(640); splashScreen.setHeight(480); splashScreen.setPosition((settings.getWidth() - 640) / 2, (settings.getHeight() - 480) / 2); guiNode.attachChild(splashScreen); enqueue(new Callable<Void>() { @Override public void run() { // This is where I add My Init logic splashScreen.removeFromParent(); } }); }[/java]

The reason I started doing it this way is because it takes a few seconds to load Nifty GUI enough that I notice the black screen.

EDIT: I should note that I do load nifty gui in the enque and detach the Picture then I contenu loading the rest of my scene.

btw splash screens are usually considered annoyance, unless the splash screen is showing up to give you something to look at while the program loads. you can show the name of your game/organization on the main menu just as easily and prominently.

1 Like