Crosswalk Intel XDK experiences

Discussion and feedback on Construct 2

Post » Fri Sep 19, 2014 5:41 am

Is anyone on the lastest XDK?

The built app now asks too many permissions than before.
I removed a lot of plugins from the project tab... but still!
Krish
Hey! Did you know that you can hire me to make your games?

Click Here to See More
B
21
S
6
G
5
Posts: 391
Reputation: 5,662

Post » Fri Sep 19, 2014 6:59 am

I just choose "Minimum".
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sun Sep 21, 2014 6:48 am

@IntelRobert

I have a question.

Is it possible to do this in xdk tool's preference?

XWalkPreferences.setValue(XWalkPreferences.ANIMATABLE_XWALK_VIEW, true);

Because I want to use TextureView to capture screen (main canvas).

In android,

var ca = document.getElementById('c2canvas');
var base64 = ca.toDataURL();

works well

but in crosswalk android

black screen was captured.

See also this:
Cordova Screenshot plugin always capture BLACK screenshot of xwalkView
https://crosswalk-project.org/jira/si/j ... -2233.html
and this
https://crosswalk-project.org/jira/browse/XWALK-2266

Thanks
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Mon Sep 22, 2014 11:22 am

@cranberrygame

Do you only need to capture the canvas? The following works for me. I see that the textureview has memory and performance penalties.

Code: Select all
<!DOCTYPE html>
<html>
<body>

<canvas id="myCanvas" width="200" height="100" style="border:1px solid #c3c3c3;">
Your browser does not support the HTML5 canvas tag.
</canvas>


<div id="placehere">

<script>

var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
ctx.fillStyle = "#FF0000";
ctx.fillRect(0,0,150,75);

var dataUrl = c.toDataURL();

var elem = document.createElement("img");
elem.src = dataUrl;

document.getElementById("placehere").appendChild(elem);
</script>

</body>
</html>
Intel Corporation
B
15
S
3
Posts: 193
Reputation: 1,552

Post » Mon Sep 22, 2014 7:05 pm

I'd appreciate some help with a few problems I'm having. Is there any way of getting the Browser Open New Window command to work in crosswalk, or would enabling the InAppBrowser plugin help? I'm also having no luck invoking download of canvas snapshots either, can anyone help me with this? Thirdly the Set Silent and Set Muted audio commands do nothing in crosswalk, though they work in the preview.

Thanks!
B
11
S
3
Posts: 135
Reputation: 1,309

Post » Mon Sep 22, 2014 11:47 pm

@Ashley

Hi, Ashley

I'm making screen capture plugin.

I made this code by @IntelRobert 's help, but still can't capture screen (c2canvas canvas capture).

By which canvas, can I take base64 string?

I need your help.

Thanks

See the code below:

Code: Select all
//cranberrygame start
   Acts.prototype.SaveScreenCaptureToImageFile = function ()
   {      
/*
      //works <============
      var c = document.createElement("canvas");
      c.width = 150;
      c.height = 75;
      var ctx = c.getContext("2d");
      ctx.fillStyle = "#FF0000";
      ctx.fillRect(0,0,150,75);
      var base64 = c.toDataURL();
      var img = document.createElement("img");
      img.src = base64;

      //document.body.appendChild(img);
      document.getElementById("c2canvas").parentNode.insertBefore(img, document.getElementById("c2canvas"));
*/

      //works in phonegap but don't work in crosswalk android: black screen capture <============
      var c = document.getElementById("c2canvas");
      var base64 = c.toDataURL();
      var img = document.createElement("img");
      img.src = base64;

      //document.body.appendChild(img);
      document.getElementById("c2canvas").parentNode.insertBefore(img, document.getElementById("c2canvas"));
   };
//cranberrygame end
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Tue Sep 23, 2014 12:11 am

Hi @cranberrygame

the default system plugin already has "snapshot canvas" action and the data or value is available in expression "canvassnapshot" . This is not what you want ?
B
75
S
22
G
14
Posts: 388
Reputation: 12,222

Post » Tue Sep 23, 2014 12:49 am

@tumira

I did test, but it didn't work in crosswalk for andorid.

Thanks for your reply
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Tue Sep 23, 2014 1:06 am

@cranberrygame

Can you file a bug report in bug report section ? Or else I think Ashley might ignore or does not know about this issue.
B
75
S
22
G
14
Posts: 388
Reputation: 12,222

Post » Tue Sep 23, 2014 11:55 am

@alexfrancois

The muting problem is an issue with chrome for android, which crosswalk depends upon. It works in chrome for windows/mac which explains why it works in the emulator. We don't have a solution right now and are waiting for it to be fixed by google.

@cranberrygame

I will look at the c2 'snapshot canvas' to see why it does not work in crosswalk. It might take a few days.
Intel Corporation
B
15
S
3
Posts: 193
Reputation: 1,552

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests