I try to draw severeal Sprites
to a FrameBuffer
. The Sprites
are PNGs with transparency. When I draw them directly to the screen it's fine. But when I draw on the FrameBuffer
and then draw the resulting texture on the screen the transparent parts are cut out and the glBackground shines through. Any idea how to solve this?
Here is how I do it:
FrameBuffer fbo = new FrameBuffer(Format.RGBA8888, width, height, false);
Sprite fboTexture = new Sprite(frameBufferObject.getColorBufferTexture());
fboTexture.flip(false, true);
fbo.begin();
batch.begin();
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.draw(sprite1, 0,0);
batch.draw(sprite2, 0,0);
batch.draw(sprite3, 0,0);
batch.end();
fbo.end();
batch.begin();
batch.draw(fboTexture, 0,0);
batch.end();