Increasing the width of line drawn using Shape Renderer in LibGDX

后端 未结 2 739
太阳男子
太阳男子 2020-12-20 19:16

I am drawing a line using Shape Renderer in LibGDX and i am using Orthographic Camera in my code, so to increase the width i used

camera = new OrthographicCa         


        
2条回答
  •  隐瞒了意图╮
    2020-12-20 19:57

    As you can see here:
    libgdx Shaperenderer line .. How to draw line with a specific width
    And here:
    Libgdx gl10.glLineWidth()
    And here:
    Why Libgdx Gdx.gl10.glLineWidth(width); does not react to change projection properities

    Playing with the line width in the shaperenderer isn't the best way to do what you want to achieve.

    Try using a 1x1 white TextureRegion (you can change the color the Batch draws it with later), and draw it with the width and height that you desire:

    batch.draw(region, x, y, width, height);
    

提交回复
热议问题