初始化Stage时出错

时间:2015-09-08 14:48:33

标签: java libgdx initialization screen stage

我创建了一个实现Screen的新类,我从其他人的代码中看到的是他们创建了一个带有Game游戏参数的构造函数。我没有创建构造函数,我认为这就是我得到错误的原因

  public class MainMenu implements Screen{
     public MainMenu(Game game){ //I dont know what are these for
            this.game = game;    //<--
        }


 public void show() {
        btnAtlas=new TextureAtlas(Gdx.files.internal("bitters.atlas"));
        skin=new Skin();
        skin.addRegions(btnAtlas);
        stage=new Stage(Gdx.graphics.getWidth(),Gdx.graphics.getHeight(),true);// I get the error here when initializing the Stage
    }
 }

错误为"Cannon resolve constructor 'Stage(int,int,boolean)'"

0 个答案:

没有答案