java - Why does my sprite flash in LibGDX? -


i'm trying create main menu using sprite. however, when gets rendered , everything, sprite flashes quickly. why 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); } 

this goes in render method:

batch.begin(); mainmenu.draw(batch); batch.end(); 

render method called, show called once when screen shown.


Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -