Java – in SpriteBatch Nested shaperenders in begin / end begin / end

Whether shaperender can be used to draw shapes between the start and end calls of SpriteBatch

I tried, but there was no result. I only drew the sprite patch texture, and there was no shape in the scene The example code is as follows:

shapeRenderer.begin(ShapeType.FilledCircle);
shapeRenderer.setColor(0f,1f,0f,1f);
shapeRenderer.filledCircle( 100,100,100);
shapeRenderer.end();

I have an orthographic camera created by these commands:

camera = new OrthographicCamera(1,Gdx.graphics.getHeight() / Gdx.graphics.getWidth());
camera.setToOrtho(true);

Solution

Shapereader and SpriteBatch are both set in OpenGL and remain unchanged during use Nesting them can cause problems See this post in the badlogic forum

This should probably be more clearly stated in the documentation

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>