我本来打算用下面的代码来实现的。
代码:
var renderTexture=cc.RenderTexture.create(720,1280,1,0);
renderTexture.begin();
this.node.visit();
renderTexture.end();
模拟器下报错:
Simulator : cocos2d: Texture2D: Error uploading compressed texture level: 0 . glError: 0x0500
Simulator : Assert failed: Could not attach texture to framebuffer
Simulator : Assertion failed: (glCheckFramebufferStatus(0x8D40) == 0x8CD5), function initWithWidthAndHeight, file /Users/nantas/fireball-x/fbnew-build/cocos2d-x/cocos/2d/CCRenderTexture.cpp, line 269.
浏览器下报错:
Uncaught TypeError: this.node.visit is not a function
因为没有creator的node没有visit这个方法,所以,请问creator环境下如何截屏?