crossFade = does not working consistantly

Hi everyone,
I have an odd situation.

I’m building a game… 70+ scenes involved.
I often use… composer.hideOverlay( “crossFade”, 500 ) to hide overlays.
Although on some scenes the overlay will fade out over half a second, on other scenes it just disappears.
The exact same line of code used and called in the exact same way.
There are never any errors.
There are no problems.
The overlay disappears, but the user experience is not consistent, sometimes they see the overlay gracefully depart and others it is just gone instantly.

This is making me think the issue is with the scene event… I’m using the scene template on every scene in my game.

I am baffled.
Anyone able to help me understand why this is happening, or things I can investigate.

The most likely issue is the ‘computing/time’ cost involved with building the new scene.

If the effort needed to build the new scene is heavy, you will notice this affecting the cross-fade.

Things that can cost ‘time’ are, loading large images, drawing many display objects, doing database queries.

Question: What composer called user-defined function is doing the work to build your scene?
Most people use create().

As an experiment, you might consider calling composer.loadScene(), followed by composer.gotoScene() to see if that smooths the transition.

If I recall, this should entirely build the scene before the call to gotoScene().

This is not a final solution, but may give you hints as to what is going wrong.

If the transitions smooth out, you can add temporary debug code to measure the time it takes to complete the loadScene() call and find out which scenes are taking too long to build.

2 Likes

I abandoned the inbuilt scene management and just built my own for what I needed to do.

1 Like

I don’t use a GUI, either, just code because Composer stopped being supported by the dev team a couple of years ago. Does anyone know of a GUI we can use for Solar2D development?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.