是通过CCRenderTexture实现的嘛?求教程或代码~
/**
- 截屏
-
/
MainLayer.prototype.screenShot=function(picName){
var renderTexture=cc.RenderTexture.create(720,1280,0,0);
(renderTexture.getSprite()).setAnchorPoint(cc.p(0.5,0.5));
renderTexture.setPosition(cc.p((720)/2,(1280)/2));
renderTexture.setAnchorPoint(cc.p(0.5,0.5));
renderTexture.begin();
this.rootNode.visit();
renderTexture.end();
return renderTexture.saveToFile(picName,0);
};
貌似把对应的7201280改成你自己游戏实际分辨路就Ok
saveToFile isn’t supported on Cocos2d-Html5
— Begin quote from ____
引用第2楼happyfhc于2014-08-01 14:26发表的 :
saveToFile isn’t supported on Cocos2d-Html5 http://www.cocoachina.com/bbs/job.php?action=topost&tid=218113&pid=1019122
— End quote
Canvas.toDataURL(“image/png”)
然后上传到服务器,我是这么做的。
楼主,你好,我想问两个问题。如果你有时间,还请你解答一下。
1、屏幕截图保存后,默认的根目录在哪里,要用的这张照片的时候怎么取出来呢?
2、如果想要后面截取得屏幕 替换 前面截取的屏幕,是不是只要文件名固定就直接替换了?
谢谢!
楼主,这个问题有解决的方法了吗?? 能分享下是怎么解决的吗
saveToFile isn’t supported on Cocos2d-Html5
小游戏的
H5的不支持saveToFile怎么破~