How do I preload next layout?

  • u can make a loading screen that shows up when going from layout to another, i think this is the only way, or maybe u can save all the object in the layout to the local storage or webstorage, example: So when the layout go to (layout2) then returns to layout 1 the object will be saved and ready for loading quickly

    This is not going to work as you think when dealing with lots of objects, especially more so if lots of objects have behaviors.

    There isn't a way to preload it like you're asking, but I have a fade in/out to black to hide and smooth out the transition.

    This is by far one of the best approaches.

    I call it camouflage

  • i think that the loading screen will work, ..... can u please tell me why it wont work as you say?

  • Don't get me wrong, the loading screen you mention will likely work, but it is far from optimal.

    Most of the frame drops happen after the load, also due to objects initializing their states, where behaviors obviously require more performance.

    Not to mention it taking longer to save/load the more objects your layouts has, which also requires a sophisticated loader mechanism to make it viable for the game matriax mentions.

    The key is layouts with not to many objects on them, and careful with addressing them all. (the objects)

    And switching between layouts smoothly can be done as easily as have a global black none transparent layer on top, lerping its opacity to 100% before switching to the next layout, which lerps the black layer back to 0% on layout start.

  • ok thx for the info

  • That is basically the same solution as with loading screen, but you use a black layer instead of loading screen sprite in it. However I haven't tried lerping the opacity. I need to check it out . Thanks for sharing!

  • That is basically the same solution as with loading screen, but you use a black layer instead of loading screen sprite in it. However I haven't tried lerping the opacity. I need to check it out . Thanks for sharing!

    Demo

    capx

    With a bit of optimization in mind relating to the lerping.

    I set a delay at the start of layout, can be removed or adjusted to fit purpose.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can definitely lerp the opacity.

    Something like:

    Set Opacity: lerp(0,100,((1-0.09^(x-2))/(1-0.01^(x-2))))

    That way you have nice smooth transitions both directions.

    Lol. lennaert beat me to it.

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