Can I make a function test before apps start?
What do you mean?
Thanks for your quick response! I’m having a little problem at the moment of changing composer scenes. Once the application starts the transitions to another scene do not work properly. After using the application several times then the transitions start working. I think if I could do a test of my functions before the App is in the ‘show’ phase, I could eliminate the problem and thus see the transitions working the first time correctly.
I wouldn’t compensate for this, and would look at the code a bit more.
Does this happen in the simulator as well?
Any error messages?
If transitions are stuttering when you are loading a scene then your app cannot sustain a decent frame rate or you have thread blocking (like loading large assets).
What I do is throw up a loading screen with a progress bar whilst all my large assets (100MB+) are being loaded and cached and only when that has completed do I transition to my main scene.
@adrianm, @schizoid2k; I have written a topic in the general discussion section in this link: https://forums.coronalabs.com/topic/67889-small-problem-with-composergotoscene-transitions/ I apologize if I started the new topic in a wrong place since I have not received any answers. I am new to this forum and my intention is to make things right. In that topic is the code of one of the scenes in which I think there may be problems. I’ve participated in other forums that have a different user interface. I would appreciate doing things organized to avoid breaches of the rules. If I made some mistake by writing something in the wrong place I would appreciate any moderator help me. Actually I would like to solve the problem of transitions. Any help is welcome. Thank you for all your attention.
@adrianm your idea sound great but I do not know how to do it.
You can preload a scene by using composer.loadScene() and when that is finished loading you can use composer.gotoScene() to transition it at a later date.
A more complicated version would load and cache your textures in main.lua and then use them in your scenes. Note: loading a graphic into memory is much slower than actually displaying it once it’s loaded. More info on this technique is here.
Thanks adrianm I’m going to read and test that right now!
I load in main lua the 20 scenes that my application has using the composer.loadScene() and this is what happens to me now. 1) My cell phone is very very hot when running and keep my application open, if I leave the application, to do a google search for example, when I return to the application I have the same problem, transitions do not run the first time.
do I need to use a system event that reload the main lua or an external module with a function to use the composer.loadScene()?
or, I need to use the composer.loadScene() inside composer scene events for those scenes that I’m going to move from the scene where I am?
–Mounting the scene is easy but making the application work as it should is a challenge for beginners like me who have no programming knowledge.–
Thanks in advance for all the help
Depending on how big your scenes are I’m not sure loading all of them is wise. Mobile devices don’t have a lot of free memory and even less free GPU memory. When you run low on memory, your app will perform poorly.
Rob
Thanks Rob Miracle! For the moment I solved the problem by eliminating all transitions. I still notice a delay like a second when I change the scene. I am eliminating parts, building and testing to see if I identify what the problem is.
Only preload your next scene - not all scenes! Android releases textures when you switch focus away from your app. The slowdown you are seeing is the Corona reloading your textures.
Unless your textures are real small you cannot load and transition at the same time. You have to preload and then transition.
Look at the Corona sample in Graphics called TextureLoad. This should help you.
Thanks adrianm, I’m going to take a look right now.
What do you mean?
Thanks for your quick response! I’m having a little problem at the moment of changing composer scenes. Once the application starts the transitions to another scene do not work properly. After using the application several times then the transitions start working. I think if I could do a test of my functions before the App is in the ‘show’ phase, I could eliminate the problem and thus see the transitions working the first time correctly.
I wouldn’t compensate for this, and would look at the code a bit more.
Does this happen in the simulator as well?
Any error messages?
If transitions are stuttering when you are loading a scene then your app cannot sustain a decent frame rate or you have thread blocking (like loading large assets).
What I do is throw up a loading screen with a progress bar whilst all my large assets (100MB+) are being loaded and cached and only when that has completed do I transition to my main scene.