大家好,我想做个截屏,参考的官方文档, 用的cocos creator 2.1.2,下面是我的代码
let node = this.node;
let camera = node.addComponent(cc.Camera);
let texture:cc.RenderTexture = new cc.RenderTexture();
texture.initWithSize(this.node.width, this.node.height);
this.tempSprite.spriteFrame = new cc.SpriteFrame(texture);
camera.targetTexture = texture;
this.node.addChild(this.tempSprite.node);
上面代码可以正常实现截屏,但是控制台报警告,
[.WebGL-0x7f9780510800]GL ERROR :GL_INVALID_OPERATION : glDrawElements: Source and destination textures of the draw are the same.
不知道这个怎么解决,求大神指导。看了很多其它截屏的例子,但都是老的API,实在没办法