How can I create a popup with a background Layer?

Hello fellow Monkeys,



Like the Title says I am trying to create a pop up that has a background Layer where I can place an Image rather than just having a simple background color.



I have tried using the LayerBuiler like I do In my other screens, but you can’t use LayerBuilder in the PopupBuilder.



I appreciate any help I can get.



Thanks

Just add a panel and set the background on that…

1 Like

@zarch



I have done that, but When I add buttons etc. The Image covers then up.



I create my initial panel for the main popup add image builder for my image, and inside the main panels I add 4 more panels to split that panel up with buttons, but the image overlays them all. I am wandering if there is a way to set the image in the background.



Here is my popup code with the image builder commented out



[java]

new PopupBuilder(“storePopup”) {

{





childLayoutCenter();

backgroundColor("#000a");



panel(new PanelBuilder(“Store”) {

{

childLayoutVertical();

width(“75%”);

height(“75%”);

backgroundColor("#eeee");

alignCenter();

valignCenter();



// image(new ImageBuilder()

// {{

// filename(“Interface/options.png”);

// width(“100%”);

// height(“100%”);

//

// }});



panel(new PanelBuilder(“Panel_One”) {

{

childLayoutCenter();

width(“100%”);

height(“25%”);

backgroundColor("#0f08");

alignCenter();

valignTop();



}

});

panel(new PanelBuilder(“Panel_Two”) {

{

childLayoutCenter();

width(“100%”);

height(“25%”);

backgroundColor("#0f05");

alignCenter();

valignTop();







}

});

panel(new PanelBuilder(“Panel_Three”) {

{

childLayoutCenter();

width(“100%”);

height(“25%”);

backgroundColor("#f008");

alignCenter();

valignTop();



control(new ButtonBuilder(“StoreTabButton”, “Store”)

{{

alignCenter();

valignTop();

height(“25%”);

width(“25%”);

visibleToMouse(true);



interactOnClick(“ShowStoreTabPopup()”);

}});



}

});

panel(new PanelBuilder(“Panel_Four”) {

{

childLayoutCenter();

width(“100%”);

height(“25%”);

backgroundColor("#f005");

alignCenter();

valignTop();



control(new ButtonBuilder(“ExitButton”, “Exit”)

{{

alignCenter();

valignTop();

height(“25%”);

width(“25%”);

visibleToMouse(true);



interactOnClick(“CloseStorePopup()”);

}});



}

});

}

});

}

}.registerPopup(nifty);

}

[/java]

Add a background image to the panel (it’s a setting in the panel, not a separate thing), not an image.

1 Like

@zarch



Thanks,



This solved my problem!

[java]

backgroundImage(“Interface/options.png”);

[/java]



I don’t know why I never found that through my research.





Much Thanks!