libGDX: take screenshot inluding ShapeRenderer

跟風遠走 提交于 2019-12-24 01:16:20

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!