cocos2d-js icon indicating copy to clipboard operation
cocos2d-js copied to clipboard

cc.RenderTexture.saveToFile runs async and no callback

Open emfox opened this issue 9 years ago • 3 comments

RenderTexture.setPosition(cc.p(winSize.width / 2, winSize.height / 2));
RenderTexture.beginWithClear(255, 255, 255, 0.0);
cc.director.getRunningScene().visit();
RenderTexture.end();
var imgPath = jsb.fileUtils.getWritablePath();
var result = RenderTexture.saveToFile(fileName, cc.IMAGE_FORMAT_PNG);
if (result) {
    imgPath += fileName;
        open_img(imgPath); // open_img a function to open file, but it say file not found!!!
    }

please add finish callback for it.

emfox avatar May 24 '15 13:05 emfox

Hi.

I have added a timeout for this feature but it is not async so far.

IgorMats avatar May 24 '15 16:05 IgorMats

which commit and how to use?

emfox avatar May 25 '15 00:05 emfox

hello, any update for this bug?

emfox avatar Jun 27 '15 14:06 emfox