Why is there a delay when using "Go to Layout"?

Get help using Construct 2

Post » Fri Jul 11, 2014 12:20 pm

So I have a main menu with a button "Play". When the player clicks Play the action "Go to Layout: Game Screen" is fired. It happens instaneously in PC. But when exported to Android using CocoonJS, it takes about 3 seconds after touching "Play" to change the layout to the Game Screen. Why is this happening? How do I fix it?

It also happens when the player dies and touches "Try Again", it takes about 3 seconds after touching it for the game to go to the layout "Game".

I thought maybe the "on start of layout" of the layout "Game Screen" is causing the delay. But I'm not doing much at start of the layout. I'm just playing a Sound, setting local variables to WebStorage keys and restoring some variables.
B
10
S
2
Posts: 79
Reputation: 1,122

Post » Fri Jul 11, 2014 12:26 pm

You might want to also look at how much data are to be transferred into memory between the two layouts.
If your game layout is using huge images that need to be read and uncompressed, it's natural that it takes time, especially on weaker hardware.

Try to post a capx of your project to see if anything can be "optimized" specifically for mobiles.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,319
Reputation: 87,487

Post » Fri Jul 11, 2014 12:29 pm

Kyatric wrote:You might want to also look at how much data are to be transferred into memory between the two layouts.
If your game layout is using huge images that need to be read and uncompressed, it's natural that it takes time, especially on weaker hardware.

Try to post a capx of your project to see if anything can be "optimized" specifically for mobiles.


@Kyatric Thanks for helping!
Yeah, there are a lot of large images in the Game Screen layout. Is there a way to preload these images in the main menu layout?
B
10
S
2
Posts: 79
Reputation: 1,122

Post » Fri Jul 11, 2014 12:34 pm

Not really (or at least that I know of).
You'd be better off trying to "optimize" their use as mentioned in this blog article.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
284
S
109
G
91
Posts: 7,319
Reputation: 87,487


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go and 12 guests