Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cc.RenderTexture.newCCImage throws exception in 2.1.2 #854

Closed
bomzj opened this issue Mar 27, 2013 · 5 comments
Closed

cc.RenderTexture.newCCImage throws exception in 2.1.2 #854

bomzj opened this issue Mar 27, 2013 · 5 comments

Comments

@bomzj
Copy link

bomzj commented Mar 27, 2013

var texture = cc.RenderTexture.create(winSize.width, winSize.width);
texture.begin();
this.visit();
texture.end();
var ccImage = texture.newCCImage();

Uncaught TypeError: undefined is not a function CCRenderTexture.js:567
cc.RenderTexture.cc.Node.extend.newCCImage CCRenderTexture.js:567
BaseMenuLayer.extend.init ChooseLevelLayer.js:95
(anonymous function) CCClass.js:138
ChooseLevelLayer.create ChooseLevelLayer.js:176
BaseScene.extend.onEnter MainMenuScene.js:75
(anonymous function) CCClass.js:138
cc.Director.cc.Class.extend.setNextScene CCDirector.js:749
cc.Director.cc.Class.extend._drawSceneForWebGL CCDirector.js:381
cc.Director.cc.Class.extend.drawScene CCDirector.js:341
cc.DisplayLinkDirector.cc.Director.extend.mainLoop CCDirector.js:1127
callback

@dingpinglv
Copy link
Contributor

Thank you, Maksim.
This issue had been fixed, please update master branch of Cocos2d-html5 from Github.

@bomzj
Copy link
Author

bomzj commented Mar 29, 2013

Just got update , still not working in chrome at least.

@dingpinglv
Copy link
Contributor

The line 567 of cc.RenderTexture is :
var pImage = new cc.Image();

I thought that CCImage.js isn't load from jsload, but I check jsload.js again, It loads after CCConfig.js, and I have tested newCCImage() of cc.RenderTexture again, It doest work.
Maybe the jsloads.js was cached in browser.

Thanks.

@bomzj
Copy link
Author

bomzj commented Mar 30, 2013

Seems was issue with chrome cache. The code snippet below always returns null. renderMode is set to 1 (canvas).

var ccImage = texture.newCCImage();

@dingpinglv
Copy link
Contributor

I'm sorry to say that cc.TextureRender.newCCImage isn't supported on Cococs2d-html5, because cc.Image is not implemented on html5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants