java - Setting new Screen in constructor does not display properly -
java - Setting new Screen in constructor does not display properly -
i made placeholder screen, since empty had phone call next screen in it's constructor. next screen running it's constructor not showing label placed. when skipped placeholder screen , went straight new screen drawing properly. why?
place holder menu
public placeholdermenu() { photographic camera = new orthographiccamera(); camera.settoortho(false, 720, 1280); batch = new spritebatch(); skin = assets.menuskin; stage = new stage(new fitviewport(technoflux.width, technoflux.height, camera), batch); //no need screen yet phone call next one... ((game)gdx.app.getapplicationlistener()).setscreen(new gamescreen()); }
the new screen
public gamescreen() { photographic camera = new orthographiccamera(); camera.settoortho(false, 720, 1280); batch = new spritebatch(); skin = assets.menuskin; stage = new stage(new fitviewport(technoflux.width, technoflux.height, camera), batch); label test = new label("gamescreen", skin, "largetext"); bottomui = new table(); bottomui.row(); bottomui.add(test); bottomui.setfillparent(true); stage.addactor(bottomui); gdx.input.setinputprocessor(stage); } @override public void render(float delta) { gdx.gl.glclearcolor(.2f, .2f, .3f, 1); gdx.gl.glclear(gl30.gl_color_buffer_bit); stage.act(); stage.draw(); }
all above code running placeholder in between not showing label. pretty sure when add together button placeholder screen directs new screen show again. guess has assets loading or screen class itself. i'm looking insights behavior.
java android libgdx
Comments
Post a Comment