CocoonJS plugin updates

Discussion and feedback on Construct 2

Post » Fri Oct 24, 2014 12:44 pm

Hello,

It was so long and we considered it was important, so we decided to open a new topic:
https://www.scirra.com/forum/viewtopic.php?f=146&t=118049
In addition, we created a more general post in our blog.
http://blog.ludei.com/techniques-to-optimize-memory-use-in-ludeis-canvas-environment/
We recommend to read both of them.

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

Post » Fri Oct 24, 2014 1:03 pm

Thanks @Ludei, good to see continued efforts and fixes. I hope that this keeps up!
B
57
S
15
G
11
Posts: 912
Reputation: 12,606

Post » Fri Oct 24, 2014 1:55 pm

Hello again,

ArcadEd wrote:However the loading layout doesn't work anymore


Can you please send us a testcase regarding this topic? We will have a look at it.

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

Post » Fri Oct 24, 2014 2:04 pm

I'll try to whip one up. I assume it's because not all assets are loading at start like before, the loading layout just replaced the standard HTML5 loading screen. It's just nice to give users some kind of feedback when they need to wait, rather than what appears to be a frozen screen.

I'll add a loading layout to the memory.capx I sent you all earlier.
B
100
S
32
G
11
Posts: 1,552
Reputation: 21,612

Post » Fri Oct 24, 2014 2:19 pm

@Ludei
Are the setMaxMemory and setNPOTEnabled features options available through the plugin via the editor (I see it was updated) or do we need to make that change in code after it's compiled from C2?
B
100
S
32
G
11
Posts: 1,552
Reputation: 21,612

Post » Fri Oct 24, 2014 2:35 pm

ArcadEd wrote:Are the setMaxMemory and setNPOTEnabled features options available through the plugin via the editor (I see it was updated) or do we need to make that change in code after it's compiled from C2?


You have to edit it at cocoonjs_prelude.js file. This has to be done in this way because it must be executed before the C2 runtime.js file. That is why it can't be a C2 option.
B
9
S
4
G
4
Posts: 383
Reputation: 3,616

Post » Fri Oct 24, 2014 2:44 pm

Good info, thank you.

The question still remains, now that we have layout by layout loading, if we want it, how can we pop a loading bar or something while loading a layout. Is it possible?
B
100
S
32
G
11
Posts: 1,552
Reputation: 21,612

Post » Fri Oct 24, 2014 3:51 pm

The question still remains, now that we have layout by layout loading, if we want it, how can we pop a loading bar or something while loading a layout. Is it possible?


@ArcadEd @Ludei I would also like to know what can be done for showing loading progress between layouts.
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Fri Oct 24, 2014 4:06 pm

ArcadEd wrote:The question still remains, now that we have layout by layout loading, if we want it, how can we pop a loading bar or something while loading a layout. Is it possible?


C2 uses lazy loading on CocoonJS by default. Thats the reason why the loading bar is not shown, assets are loaded when they rendered the first time, not when they are created (as we explained in the post). With lazy loading enabled loading times are 0, because images are loaded later when they're going to be rendered.

Lazy loading is enabled on C2 in these lines:

Code: Select all
frameobj.texture_img = new Image();
frameobj.texture_img["idtkLoadDisposed"] = true;
frameobj.texture_img.src = frame[0];


If you set the idtkLoadDisposed property to false or comment the entire line CocoonJS would work as always:

Code: Select all
frameobj.texture_img = new Image();
//frameobj.texture_img["idtkLoadDisposed"] = true;
frameobj.texture_img.src = frame[0];


We'll think about if it's possible to include a check to enable/disable lazy loading in the C2 CocoonJS plugin. By now it has to be done editing the final .js file.
B
9
S
4
G
4
Posts: 383
Reputation: 3,616

Post » Fri Oct 24, 2014 4:10 pm

TheWyrm wrote:
The question still remains, now that we have layout by layout loading, if we want it, how can we pop a loading bar or something while loading a layout. Is it possible?


@ArcadEd @Ludei I would also like to know what can be done for showing loading progress between layouts.


That must be fixed in C2. It doesn't make sense to use lazy loading and progress bar at the same time. As explained in the post we recommend that C2 disables lazyLoading and uses img.dispose() when images are not longer needed, for example in a layout to layout change.
B
9
S
4
G
4
Posts: 383
Reputation: 3,616

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: Hiran Rodrigues and 4 guests