cr.createRuntime("c2canvas") loop

0 favourites
  • 5 posts
From the Asset Store
SynthWave Loop Pack includes 68 seamless loops, founded on 11 original melodies.
  • I was wondering lately why every time i run my mobile (phonegap, appmobi) app it runs slower and slower every time i did it. So i googled a little, and knowing that exiting an app doesn't really close it, app just goes to background, I think, that every time it is brought back to top there is another runtime created by cr.createRuntime("c2canvas"); as the listener "deviceready" gets a hit :) I think there should be some kind of check if the runtime is already created, and if it is, don't create another. Would be grateful for some kind of workaround until text build :) maybe some kind of

    if (!runtime) {cr.createRuntime("c2canvas");}
    

    or something, in the index.html

    cheers!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Really? Are you sure this is the problem? Which export format are you using? It uses different events to create the runtime depending on the platform. Still, I'll add once-only checks to all export formats just in case.

  • i think a simple pseudocode:

    var created = false;
    ondeviceready(function(){
    if (!created) {
    cr.createRuntime("c2canvas");
    created = true;
    }
    });

    would work, I will check it today if this work.

    what am I sure of now is that every time i bring app to front after putting it to sleep, it runs slower and slower. appmobi AND phonegap export.

    cheers

  • ok, i don't seem to be able to reproduce it with phonegap export, but in appmobi export, how to reproduce:

    1) create a 500x500 jpeg background with some image, scale it to 100x100

    2) create a 500x500 sprite with some opacity, scale it to 100x100

    3) add a rotating behavior to the sprite with some medium speed of your choice

    4) export through appmobi and install

    5) run on device

    6) double tap back button to exit (put app in background - you can see in application manager that the app is still running in background)

    7) run app again

    8) repeat steps 6 -> 7 to see fps degradation of the rotationg sprite

  • I think it would be very odd if the "page ready" event fired more than once, but regardless I've put a check in the next build which will prevent creating a second runtime if one already exists. Perhaps appMobi is just starting multiple apps and you need to close everything?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)