Libgdx - How to draw filled rectangle in the right place in scene2d?

前端 未结 5 2032
忘了有多久
忘了有多久 2021-01-02 02:23

I am using scene2d. Here is my code:

group.addActor(new Actor() {

    @Override
    public Actor hit(float arg0, flo         


        
5条回答
  •  情歌与酒
    2021-01-02 02:54

    ShapeRenderer has its own transform matrix and projection matrix. These are separate to those in the SpriteBatch that the scene2d Stage uses. If you update the ShapeRenderer's matrices to match those that scene2d is using when Actor.draw() is called then you should get the results that you want.

提交回复
热议问题