Loading Screen

Started by Thunderfox, July 20, 2011, 04:13:54 PM

Previous topic - Next topic

Thunderfox

Hi,
I want to create a loading screen for the time while the GLSurfaceView, objects and textures are loading. But when I try to load a ProgressDialog in Android, you can see it not until the GLSurfaceView is ready and the renderloop is started. Also a overlay with Android Widgets can't displayed until GLSurfaceView is loaded.
Before I found this engine, I loaded objects in the renderloop, one object per frame and every frame I scaled a colored rectangle, the progressbar, in x-direction. At all, this solution is not really clear.
So, is there another easy solution to show a ProgressBar while loading the GLSurfaceView?

By the way: Is there a easy function to draw 2D text?

EgonOlsen

In AlienRunner, i'm starting a thread that loads the data in onSurfaceCreated() and blit some loading screen while it runs in onDrawFrame().

About blitting text: You can either draw your text onto a texture and blit that or use raft's blitting classes. You can find them here: http://www.jpct.net/forum2/index.php/topic,1563.0.html.

Disastorm

#2
If you have an activity running before you start the game activity (like a main menu) then you can actually do setContentView(ImageView) immediately before the startActivity() of your jpct part.  Then in the main menu activity you want an onRestart() method that does setContentView(MainMenu) back so that it doesn't continue showing the ImageView loading screen.  This is what I am doing.

Also if you don't have a main menu, then perhaps you could make a dummy activity that litteraly just does setContentView(ImageView) then startActivity of your main activity.  Unfortunately, this ImageView method does not support a progress bar though.

Thunderfox

Then I think it is the best, when I also load the objects while the onDrawFrame function is running (which I called renderloop above) and not while initialize the GLSurface.

Thanks for the Textclass :)