How do I remove the flickering splash when using CocoonJS?

Get help using Construct 2

Post » Fri Oct 03, 2014 11:09 am

Hello everyone,

Due to the increasing amount of users demanding a solution for the blinking logo, we have decided to create this new post in order to explain all of you a workaround to remove that flickering.

The flickering issues are related to how Construct2 handles CoccoonJS screencanvas mode on the splash scene. ScreenCanvas is an optional to use specific high performance canvas. It renders directly to the screen buffer without creating an offscreen buffer. This allows huge rendering performance improvements in some GPUs and it also consumes less memory. When using screencanvas is very important to render the whole screen every frame, because android's GLSurfaceView internally performs a swapBuffers operation although nothing is drawn on a frame. Construct2 doesn't redraw the surface while loading resources on splash scene, that's why flickering is happening.

Flickering issues can be avoided disabling screencanvas and using a normal canvas. Keep in mind that it may affect performance on some GPUs. An alternative solution if you want to keep using screencanvas is to redraw the splash scene every frame while resources are loading.

To disable Screencanvas you have to:

  • Export the project with Construct2's CocoonJS exporter.
  • Open the exported zip file.
  • Edit the c2runtime.js file and change these lines:

    Code: Select all
       var canvas = document.createElement("screencanvas") || document.createElement("canvas");
       canvas.screencanvas = true;

    For these ones:

    Code: Select all
       var canvas = document.createElement("canvas");
       canvas.screencanvas = false;

  • Save changes and compress the ZIP folder again.

Once this is done, you can compile the project in the Cloud Compiler and test it on your device. The flickering Splash should have disappeared.

About Memory Management, we will open another post in the following days as we are currently working on a workaround to improve it.

Regards,

Ludei Team.
B
9
S
4
G
4
Posts: 383
Reputation: 3,616

Return to How do I....?

Who is online

Users browsing this forum: ametueraspirant, dand, Google [Bot], mickclarke, Yahoo [Bot] and 26 guests