Note that there are some explanatory texts on larger screens.

plurals
  1. POLibGDX Tablelayout Menu does not show
    text
    copied!<p>I'm writing a new program in LibGDX handling Backgroundtextures and have just begun to implement the screens. But when I test it, it just shows me a black cleared screen with the given resolution. I call the screen with the setScreen(screen)- Method in an implemented Game class.</p> <p>So here is the code:</p> <pre><code>public class MenuScreen implements Screen{ Table table; Stage stage; TextButton button; TextField textField; Texture texture; Pic2Box2d game; public MenuScreen(Pic2Box2d gameH) { this.game = gameH; stage = new Stage(0, 0, true); table = new Table(); } public void create() { final TextFieldStyle fieldStyle = new TextFieldStyle(new BitmapFont(), Color.WHITE, new BitmapFont(), Color.GRAY, null, null, null); textField = new TextField("path", fieldStyle); final TextButtonStyle buttonStyle = new TextButtonStyle(); buttonStyle.font = new BitmapFont(); buttonStyle.fontColor = Color.WHITE; buttonStyle.pressedOffsetY = 1f; buttonStyle.downFontColor = new Color(0.8f, 0.8f, 0.8f, 1f); button = new TextButton("Übernehmen", buttonStyle); button.setClickListener(new ClickListener() { @Override public void click(Actor actor, float x, float y) { if(textField.getText() != "" &amp;&amp; textField.getText() != "path") { texture = new Texture(textField.getText()); game.setScreen(new Workscreen(texture)); } } }); table.row(); table.add(textField); table.add(button); stage.addActor(table); } @Override public void render(float delta) { Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); Gdx.gl.glClearColor(0, 0, 0, 1); stage.act(Gdx.graphics.getDeltaTime()); stage.draw(); } </code></pre> <p>}</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload