问题
I'm trying to take screenshots in my libGDX game using the code from the official wiki.
My render method looks like this:
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
shapeRenderer.begin(ShapeRenderer.ShapeType.Filled);
shapeRenderer.rect(0, 0, screenWidth, screenHeight, topColor, topColor, bottomColor, bottomColor);
shapeRenderer.end();
batch.begin();
// everything else
batch.end();
if (screenshot) { takeScreenshot(); }
But unfortunately, the ShapeRenderer rect in the background is missing in the screenshots.
Any idea, why?
来源:https://stackoverflow.com/questions/37146088/libgdx-take-screenshot-inluding-shaperenderer