Why does my sprite flash in LibGDX?
I'm trying to create a main menu just using a sprite. However, when it
gets rendered and everything, the sprite flashes quickly. Why is it doing
this?
@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);
}
No comments:
Post a Comment