屏幕截图

cc.RenderTexture.create 这个方法给我报错了我都是找网上的代码拿来用的
cc.RenderTexture.create is not a function

有没有大佬可以提供下代码 截屏的代码 谢谢了

new cc.RenderTexture()

大佬 官方案例没有用啊 canvas.toDataURL is not a function
这个也一直报错

这么写
var canvas=canvas||cc.game.canvas;
canvas.toDataURL

1赞

因为微信小游戏,canvas是一个全局变量,可以直接用,其他环境时通过cc.game.canvas拿到。