ViewPort not visible

Hello,

I am trying to set a background for my game.
I created a new viewport to set an image as the background but the viewport is not visible.
I’m not sure if there is something wrong with my code or if this is a bug.
If I create the viewport with renderManager.createMainView() or renderManager.createPostView() the viewport is visible.
If I create it with renderManager.createPreView() it is not visible anymore.

[java]
public class ViewPortTest extends SimpleApplication {

public static void main(String[] args) {
    new ViewPortTest().start();
}

@Override
public void simpleInitApp() {
    ViewPort background = renderManager.createPreView("background", cam);

    Picture p = new Picture("asd");
    p.setImage(assetManager, "Interface/buttons/back.png", true);
    p.setWidth(settings.getWidth());
    p.setHeight(settings.getHeight());

    background.attachScene(p);
    p.updateGeometricState();
}

}
[/java]

You create the viewport behind the viewport that clears the buffer…

@pspeed said: You create the viewport behind the viewport that clears the buffer...

Thanks! I got it working. I had to add this line before creating the background viewport:

[java]
viewPort.setClearFlags(false, true, true);
[/java]