The loading time for my game in XNA is insane (up to 1 minute), and the screen while loading before the first draw is all white, triggering people to believe it's a bug and close the application. I need help creating some kind of message for them (such as a Splash Screen) so they know that the white screen is a loading screen, or better yet, exchange the whitescreen for a picture.
The game project is made in XNA, using VB.NET. The answers i found thus far either applies to something else, or they haven't worked. I have tried to add a draw of a picture in the load content section (as suggested by a person), such as this:
spritebach.begin
draw my picture
spritebatch.end
GraphicsDevice.Present()
This does nothing, however. The picture doesn't even show, and the same white screen shows until the first draw.
To be clear, I don't want a picture showing after the game started (as suggested by some answers to other posts) with a "press a button to start". I already have an intro video starting as soon as loaded. I want something instead of the white screen during loading the game.
Additional tests:
I tried drawing in the loadcontent and in the update function (letting loading of all the assets wait), but it doesnt draw in any other function than the draw function. Also, when I put an "Exit Sub" early in the draw function, the loading time is reduced to a few seconds. So its not the loading of the content per se that takes time, but the first time the drawfunction is loaded, IF an exit sub isnt placed early.
Any help on this would be greatly appreciated!
Ok. My answer perhaps is NOT exactly what you want because it is for Monogame (XNA) specifically. But I think the idea is the same. Below is how I implemented splash screen in my game.
In declaration phase:
In LoadContent():
In Draw() method:
Moreover, in my main LoadContent() method, I use:
to call the method to load my game content.
Just change the syntax to match your VBA program, and
Draw()
method as well.Edit: For Timer to count loading time:
Declare a variable:
long loadTimeForSplashContent, loadTimeForAllContent, startTime;
In the first line of
LoadContent()
method:loadTimeForSplashContent = DateTime.Now.Ticks;
After loading splash screen's content:
loadTimeForSplashContent = (DateTime.Now.Ticks - start) / 10000;//to convert to seconds
After loading all content:
loadTimeForAllContent = (DateTime.Now.Ticks - start) / 10000;//to convert to seconds
Then print them out to screen or
Console
to see how much they are. You need to find a similar method ofDateTime.Now.Ticks
inVBA
to see the time at that moment (sorry I don't know).Hope this helps!