Module taking a couple seconds to load.

Hey! So my problem is this.

When i open the app and click the about page and try to click the back button right away or in a one second period i wouldn’t be able to return back to the menu. My back button would not be able to be pressed the first time. So i was playing with this and found out that if i go to the about page and wait 2-3 second THEN and only then would i be able to press the back button and go back on the first press. 

So i came to this. The module is taking a couple seconds to load in the widget library and stuff. 

Yes i am using widget.newButton through a module because i have a lot of buttons. In the about page there are only 3 buttons though. This happens when i have 100 buttons on a page or 3 buttons. Makes no difference. There’s always a 2-3 second wait period before the widgets kick in and are able to be used.

Is there a way to speed it up or make it as if the whole thing was local? It’s just the app i’m making for a client needs A LOT of buttons so making all of it locally will just take up unnecessary space. I mean this isn’t a big deal because a user would probably read the about page once and the 3 seconds would pass and then they would never even go on that page anymore but it would be nice to have a fix or workaround. 

Thanks!

–SonicX278 

I’m unclear.  

  • Do you mean an app installed on device is taking 2…3 seconds?

          - or - 

  • Is it taking 2…3 seconds when you restart the simulator?

If it is the prior, that is both weird and wrong.  Also, by the time you install on device, the widget library is already pre-compiled to bytecode and ‘installed’ so to speak.

Here’s a video i quickly put together. Sorry for the kid in the background throwing things around. I was using my headset mic and when recording my screen doesnt seem to work properly. 

Sorry for the poor explanation. But here it is.

https://youtu.be/_wKdombj_8Q

–SonicX278 

Maybe it’s because i’m loading scroll view in the same module? 

Honestly i’m doing many things. Adding Scroll view. Making groups. Adding buttons.

–SonicX278 

Any suggestions? Maybe i should split the module up? 

–SonicX278 

From what I see it the video it seems like the button hasn’t been activated yet.

One thing I found curious is, that you didn’t use scene:create() and load the button, functions and other stuff in the scene:show(), which cold take long to load and might lead to memory leaks too.

I think the touch is being blocked while your transition finishes, OR the listener isn’t being added till the transition finishes.  i.e. There is some dynamic part of your code that is preventing touching the button.,

Is the button in an overlay?

Correct! In the “local” version of the game i had “crossFade” as a transition effect. Not since the whole game it pretty much global and there’s nothing in sceneGroup the transition takes time but doesn’t visually look like its working.

Thanks @RoamingGamer!

–SonicX278 

I’m unclear.  

  • Do you mean an app installed on device is taking 2…3 seconds?

          - or - 

  • Is it taking 2…3 seconds when you restart the simulator?

If it is the prior, that is both weird and wrong.  Also, by the time you install on device, the widget library is already pre-compiled to bytecode and ‘installed’ so to speak.

Here’s a video i quickly put together. Sorry for the kid in the background throwing things around. I was using my headset mic and when recording my screen doesnt seem to work properly. 

Sorry for the poor explanation. But here it is.

https://youtu.be/_wKdombj_8Q

–SonicX278 

Maybe it’s because i’m loading scroll view in the same module? 

Honestly i’m doing many things. Adding Scroll view. Making groups. Adding buttons.

–SonicX278 

Any suggestions? Maybe i should split the module up? 

–SonicX278 

From what I see it the video it seems like the button hasn’t been activated yet.

One thing I found curious is, that you didn’t use scene:create() and load the button, functions and other stuff in the scene:show(), which cold take long to load and might lead to memory leaks too.

I think the touch is being blocked while your transition finishes, OR the listener isn’t being added till the transition finishes.  i.e. There is some dynamic part of your code that is preventing touching the button.,

Is the button in an overlay?

Correct! In the “local” version of the game i had “crossFade” as a transition effect. Not since the whole game it pretty much global and there’s nothing in sceneGroup the transition takes time but doesn’t visually look like its working.

Thanks @RoamingGamer!

–SonicX278