Narendrabrsoft / cocos2d-android-1

Automatically exported from code.google.com/p/cocos2d-android-1
0 stars 0 forks source link

CCRendertexture not working properly? #71

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

A Simple Code like this don't work properly in a CCScene constructor:

CCSprite texture1 = CCSprite.sprite("menu_background.png");
CCRenderTexture layerRenderTexture = CCRenderTexture.renderTexture(width, 
height);
layerRenderTexture.begin();
texture1.visit(CCDirector.gl);
layerRenderTexture.end();
this.addChild(layerRenderTexture);

AND

A Cocos2D transition that use Rendertexture (CCCrossFadeTransition) don't work 
too.

What is the expected output? What do you see instead?
I expected to see a nice background. Instead I see black :)
CCCrossFadeTransition does nothing! All other transisitions seems to work 
properly.

What version of the product are you using? On what operating system?
latest version from git.

Please provide any additional information below.

- In opposite to the iphone version of cocos2d ".visit()" needs a parameter.

- If I clear the renderTexture with ".clear(...)" I see the texture with the 
specified color, but it seems that the visit-call from the CCSprite draws 
nothing on it?

Original issue reported on code.google.com by erdenkri...@googlemail.com on 26 May 2011 at 1:05

GoogleCodeExporter commented 8 years ago
it seems FBO is not supported on the android platform, when calling 
glGenRenderbuffersOES in CCRendertexture's init function, it crashes.

Original comment by bpteam2...@gmail.com on 29 Aug 2011 at 5:00

GoogleCodeExporter commented 8 years ago
This happens because the onSurfaceCreate event of the mGLThread (GLSurfaceView 
class) occurs after the creation of the CCScene and eventually the 
CCDirector.gl property is still equals to null.

This seems to happen although I have called the attachView method of the 
sharedDirector before I create my scene.

Not found a solution yet.

Original comment by sort.co...@gmail.com on 17 Aug 2012 at 7:17

GoogleCodeExporter commented 8 years ago
Whell there is a solution for the above...

Just override the onEnter event of your CCNode and write the CCRenderTexture 
code in there. The class will work as it should.

Original comment by sort.co...@gmail.com on 17 Aug 2012 at 7:08

GoogleCodeExporter commented 8 years ago
could you clarify your solution with regards to the above problem please?  
which CCNode are you talking about?  i tried overriding my CCLayers onEnter and 
still got a black screen.

Original comment by RichardH...@gmail.com on 9 Oct 2012 at 4:40