Loading Screen check if loaded:

This code works as expected the loaded variable increases as the files finish loading.

The next step is to check when the loading is done and then append a button for the user to press to start the scene and call the init function.

To check if the loading is done you simply need to check that the loaded var is greater than or equal to the totalNeededToLoad var.

The only thing left to do is create a visual for the loading bar. This can be done through css, making a bar with its width equal to 100% divided by totalNeededToLoad and then as each file loads increment the width by this found fraction.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s