2

SOLVED using scroller.setFadeScrollBars(false); scroller is a ScrollPane object.

The background texture is only displayed when the scrollpane is scrolling, then it fades out to black. The text that is drawn displays fine in all cases. I don't know why this is, or how to fix it. Nothing appears to have been said about it on google.

The condensed render method

public void render(float delta){
    stage.act(delta);
    Gdx.gl.glClearColor(0, 0, 0, 1);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);     
    batcher.begin();       
    batcher.draw(AssetLoader.main, 0, 0, gameWidth, gameHeight);
    String out=world.getClicks()+"";
    AssetLoader.font.setScale(3);
    AssetLoader.font.draw(batcher, out, gameWidth/2-(AssetLoader.font.getBounds(out).width)/2, gameHeight);
    batcher.end();   
    stage.draw();
}

The actor inside stage

private void generateScroller() {

    //final Skin skin = new Skin(Gdx.files.internal("uiskin.json"));

    Table scrollTable = new Table();      
    for(int q=0; q<AssetLoader.numIcons; q++){
        scrollTable.add(buttons[q]);
        scrollTable.row();
    }
    ScrollPane scroller = new ScrollPane(scrollTable);
    scroller.setBounds(gameWidth/2-544/2, gameHeight-544*3, 544, 544*2);
    scroller.setName("Options");

    stage.addActor(scroller);

}
Daahrien
  • 10,190
  • 6
  • 39
  • 71

0 Answers0