我正在尝试仅使用精灵创建一个主菜单。但是,当它被渲染时,精灵会快速闪烁。为什么要这样做?
@Override
public void show() {
batch = new SpriteBatch();
texture = new Texture("ui/mainmenu.png");
mainMenu = new Sprite(texture);
mainMenu.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
batch.begin();
mainMenu.draw(batch);
batch.end();
}
@Override
public void render(float delta) {
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
}