Unity splash screen for Indies
The Indie version of Unity has few restrictions placed on it. For most developers, the main complaint is the unattractive “powered-by” Unity splash screen.
Whilst we can’t rid ourselves of the Unity splash screen without spending money, we can minimise its impact by making sure the first scene in the app starts as swiftly as possible.
The way I do this is to use a startup startup scene that contains just the splash image, and only has to complete two tasks. The first is to scale the image so that it fills the screen while maintaining aspect ratio. The second is to start loading the main scene of app behind it.
Rather than explain how to do this step-by-step, I’ve attached a copy of my splash asset below. Make sure you read the instructions for the best results!
Using Unity splash screen for Indies
Import the package into your project. A folder called “SplashScreen” will be created which contains the Unity splash screen scene, a script and two sample image files.
Open the SplashScreen scene and click on the SplashScreen object in the hierarchy. This is where you set the image you want to use, and provide the name of the scene to load in the background.
Make sure that the splash image has been set to a GUI texture with compression disabled. This stops Unity stretching it and allows the script to determine the correct aspect ratio to use. If you don’t set this, then the image will be distorted and probably won’t fill the screen at run time.
After configuring, save and open the scene you want to load. Find a method in a script that executes during startup and put the following line of code near the end.
Load the SplashScreen scene again, and run it. You’ll see your splash screen appear. When it vanishes, you should be looking at your running app.
You won’t need to run your app from the splash scene every time in Unity. The Hide() method is static and checks if the splash screen has been instantiated. If it doesn’t exist, then it just exits without error.
In some instances there may be camera issues which could cause elements of your scene to appear on top of the splash while loading. If this happens then you’ll either need to change the depth of the Unity splash scene camera, or temporarily disable the cameras in the scene that is loading.
Also, don’t forget to add the splash scene as the first scene in the build settings, when it’s time to build the app.
Designing your splash image
There are a few rules to follow when designing your splash screen to handle different screen aspect ratios. To help understand how it works, I’ve included two sample files showing demonstrating a landscape and portrait layout.
The script determines whether the splash screen image is portrait or landscape based on it’s dimensions. As expected, portrait are taller than their width, and landscape is assumed for everything else.
Landscape images are scaled so that they fill the screen vertically. This means that a 16:9 aspect ratio splash image will be clipped on a 4:3 aspect ratio screen.
Portrait images are scaled so that they fill the screen horizontally. This means that shorter screens will show a clipped version of the splash image.
Looking at the sample images, only the green part will be completely visible on either a 4:3 or 3:4 aspect ratio screen. Both the blue and the green parts will be visible on a 16:9 or 9:16 aspect ratio screen.
You should design you splash so that it has the same aspect ratio as the sample textures. The important parts of the image should fit into the green area, and overlap into the blue. The resolution of the image doesn’t matter, just the aspect ratio.
If you design your splash screen following these rules, you won’t have to worry about providing different splash images for all the devices and resolutions your supports. It should be one size truly fits all.