Is it possible to detect if c2runtime is loaded?

For developers using the Construct 2 Javascript SDK

Post » Mon Mar 30, 2015 5:30 pm

Is it possible to detect if c2runtime is loaded & ready like the "on loader layout is ready"?
Now i see a 0.5 second of black screen before it goes to loading layout. I want to fix that. : )
B
31
S
10
G
2
Posts: 310
Reputation: 5,516

Post » Tue Mar 31, 2015 2:07 pm

@Ashley

Is their something like this:
document.addEventListener("loaded", function() {
// code
}, false);

I want to check if the first layout (Loading layout) is fully loaded - visible in index.html. Is this even possible?
Placing my codes after cr_createRuntime("c2canvas"); has no effect.
B
31
S
10
G
2
Posts: 310
Reputation: 5,516

Post » Tue Mar 31, 2015 2:41 pm

If the game has loaded, then 'On start of layout' will trigger in events (even in a loader layout). Before that, what are you hoping to do? There's only a loading bar showing.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,454

Post » Tue Mar 31, 2015 2:49 pm

Fixed by adding the javascript code as last line in c2runtime when exported. It's not a plugin just for myself. The javascript code loads after c2runtime is loaded. Wich is what i wanted.
B
31
S
10
G
2
Posts: 310
Reputation: 5,516


Return to Javascript SDK

Who is online

Users browsing this forum: No registered users and 0 guests