Taking A Screenshot on Cocos2d-x JavaScript

@energyy

I didn’t try with Facebook yet so not familiar how to do that.

What i can think is try to convert the cc.Sprite to base64 image data, then you may upload it or share it.

Between, you want to do it on native app or website?

For now website.

Maybe you can give solution for cc.Sprite to base64?:slight_smile: and then probably i can use php script to generate screenshot.

@energyy

Not sure this help or not, haven’t try yet.
http://html2canvas.hertzen.com/

Basic idea is

  1. Convert cc.Sprite to DOM element.
  2. Pass the sprite element to html2canvas(element, options);
  3. Get base64 from canvas var base64 = canvas.toDataURL("image/jpeg", 1.00);

Hello,

Did anyone try the above method. Is that working.
Am trying to take screenshot of current running scene in Safari browser(Ipad Device).