UVM
UVM

Reputation: 9914

ShapeRender issue

When I use Shaperenderer, I can see what I am drawing between the shaperender block. No problem. But it is not displaying the sprite using b.renderMap. This is the following code:

b.drawBoard(batch, shapeRenderer,camera);
      batch.begin();
      b.renderMap(batch);
      batch.end();

Shaperendere block:

 shapeRenderer.setProjectionMatrix(camera.combined);
     shapeRenderer.begin(ShapeType.FilledRectangle);
     shapeRenderer.setColor(Color.PINK);
     shapeRenderer.filledRect(0, 0, width, height);
     shapeRenderer.setColor(Color.GRAY);
     shapeRenderer.filledRect(10, 20, width-30, height-10);
     shapeRenderer.end();

If I comment shapeRenderer block , I am able to see my sprite. Any idea? Thanks

Upvotes: 0

Views: 57

Answers (1)

thealeksandr
thealeksandr

Reputation: 1736

I know that it's necessary to do

batch.end()

before you draw shapeRender. And do

batch.begin()

after. Maybe problem somewhere there.

Upvotes: 1

Related Questions