How do I create a Loading screen?

Hello,

My game is High Definition, and I use a lot of HD images and spritesheets, taking up a LOT of texture memory. The result is that I get an ugly black screen before my Scene loads, spaning for some seconds. So I want to make a loading screen. Actually two. One for my main menu and one for my main game. I searched a lot the whole day, but I didn’t find any steps for making a loading screen.

What I want to do:

-Having a loading screen, with just a text saying “LOADING…” and another text with a percentage that calculates how much my next screen assets have loaded.

-After I’m done, I want to remove my loading screen and start my main menu scene, or my main game scene, with no delay.

I’m developing for Android, but any comments for iPhone as well are welcomed.

How does the storyboard know if my scene following is loaded and in what percentage? Where should I put my newImageRects? I couldn’t find a single tutorial.

anyone?

There really isn’t a way to measure of how much is loaded.  You could use a widget progress bar, but you’re going to have to have a way to update it as you’re moving along, like update it a bit after you load a file.   You could also use the native.setActivityIndicator http://docs.coronalabs.com/api/library/native/setActivityIndicator.html to show a busy symbol while you’re loading.

I would near the top of your main.lua, local a small image with the word “Loading” on it, so it will show quickly and then you can start loading your other resources.

I use the 3rd party set of tools, level helper and it’s associated API, which includes a function that creates a loading/progress bar and updates it as the assets are loaded…unfortunately you need to purchase the tool…but it’s not very expensive, and is very nice once you figure it out.

Care to share a link?

The problem is that with just an HD image, the app gives a black image untils it loads it. Imagine what happens when I want to load my seven  full HD images! I want the game to be full HD 1080p, cause I want to target full HD devices like samsung galaxy s4. Lower resolution images look ugly, on the other hand OpenGL recognises it as 2024x2024 and covers 4 MB of texture memory…  As of my “tap” event images, I use a 50x50 empty .png, scale it inside corona to the size of the dynamic image, and put the listener there instead of my image. So, I save a bit of memory. Still, the full HD background image is what that causes the large texture memory and blank screen while it is loading.

anyone?

There really isn’t a way to measure of how much is loaded.  You could use a widget progress bar, but you’re going to have to have a way to update it as you’re moving along, like update it a bit after you load a file.   You could also use the native.setActivityIndicator http://docs.coronalabs.com/api/library/native/setActivityIndicator.html to show a busy symbol while you’re loading.

I would near the top of your main.lua, local a small image with the word “Loading” on it, so it will show quickly and then you can start loading your other resources.

I use the 3rd party set of tools, level helper and it’s associated API, which includes a function that creates a loading/progress bar and updates it as the assets are loaded…unfortunately you need to purchase the tool…but it’s not very expensive, and is very nice once you figure it out.

Care to share a link?

The problem is that with just an HD image, the app gives a black image untils it loads it. Imagine what happens when I want to load my seven  full HD images! I want the game to be full HD 1080p, cause I want to target full HD devices like samsung galaxy s4. Lower resolution images look ugly, on the other hand OpenGL recognises it as 2024x2024 and covers 4 MB of texture memory…  As of my “tap” event images, I use a 50x50 empty .png, scale it inside corona to the size of the dynamic image, and put the listener there instead of my image. So, I save a bit of memory. Still, the full HD background image is what that causes the large texture memory and blank screen while it is loading.