cocos js 3.6.1版本的,在有些界面截图会出现在能截取最上层那层图,后面的截取都是空白的,这个问题有谁知道如何解决吗?截图代码如下:
var winSize=cc.winSize;
var tex = new cc.RenderTexture(parseInt(winSize.width),parseInt(winSize.height));
tex.setPosition(cc.p(winSize.width / 2, winSize.height / 2));
tex.begin();
cc.director.getRunningScene().visit();
tex.end();
var imgPath = jsb.fileUtils.getWritablePath();
if (imgPath.length == 0) {
return;
}
var result = tex.saveToFile(fileName,cc.IMAGE_FORMAT_JPEG, false);
if (result) {
imgPath += fileName;
return imgPath;
}