适用于Creator2.0之前的版本,2.0开始官方文档有适用的截图方案
const size: cc.Size = cc.view.getVisibleSize();
const texture: cc.RenderTexture = new cc.RenderTexture(size.width, size.height, cc.IMAGE_FORMAT_PNG);
texture.begin();
cc.director.getRunningScene().visit();
texture.end();
texture.saveToFile(filename, cc.ImageFormat.PNG, true, function () {
cc.log("保存成功");
});