Confused about "Use loader layout..."

Get help using Construct 2

Post » Sun Feb 28, 2016 10:32 am

I've done some research on this topic but I'm still a little confused. (Seems to happen more and more as I get older. <sigh>)

I created a custom loading screen and my event sheet for it looks like this:
Image

First, am I doing that right?

Second, I didn't initially have the layout marked as "Use loader layout..." and I'm sort of confused about what that option actually does. Does it negate the need for the events above? I haven't really noticed a difference whether I use it or not.

I'm asking because I'm having a small issue with my app not getting files from updates. Here's the problem:

    1. I upload a new Project File (.json) and a new offline.appcache file
    2. I go to my website
    3. My app recognizes that there is an update and it *seems* to get the new version
    4. When my app starts the Project File hasn't been updated
    5. The Project File isn't updated until I refresh the browser window

This makes me think the error is in my events that download the Project File, but they *look* okay.

Thanks for any help.
B
11
S
3
Posts: 79
Reputation: 854

Post » Mon Feb 29, 2016 11:07 am

Hello,

To use loader layout you have to select the first layout to display in the project settings, and set "Use loader layout" to "yes".
Then, in the selected layout event sheet, you have to set the system condition "On loader layout complete" that is triggered when everything is loaded.

If you have only few ressources to load, you won't see the difference because it loads relatively fast.

For the project file I think you should use AJAX object to make request and wait for AJAX "On completed" event.

Hope this helped. Nabu
B
14
S
4
Posts: 112
Reputation: 1,287

Post » Mon Feb 29, 2016 1:20 pm

Thanks Nabu0001, I wasn't aware of the "On loader layout complete" condition. It sounds like that is mainly for projects that have a lot of assets, correct? (And it's NOT a replacement for the events I have listed above.)
B
11
S
3
Posts: 79
Reputation: 854

Post » Mon Feb 29, 2016 3:38 pm

No it's not mainly for big projects. It ensures that all ressources are loaded before doing anything. It's not a replacement for what you're already doing, it just loads all the graphics and the sounds if you have set the "Preload sounds" in the project properties.

What you can do is wait for "On loader layout complete" to trigger and wait for the AJAX server side requests during the loader layout, while displaying a progression bar or something like that. Once all these things are done - you can here use variables for completion - you change to your next app layout.
B
14
S
4
Posts: 112
Reputation: 1,287


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 33 guests