Question about background picture on popups

sman1975

Emperor
Joined
Aug 27, 2016
Messages
1,371
Location
Dallas, TX
Hello,

I'm trying to simply add a background picture on a popup. When I use the image with DXT3 compression, no image shows. When I use the image with no compression, everything looks like it's supposed to.

Here is the .XML code for the popup - the image in question is named GreatWarPopupBG2.dds (image size 606 x 260, and yes, VFS=true):

Code:
<?xml version="1.0" encoding="utf-8" ?>
<Context ID="MajorEventsPopup">
    <Box Style="BGBlock_ClearTopBar" />
    <Grid Size="640,340" Anchor="C,C" Style="Grid9DetailFive140" ConsumeMouse="1"> 
        <Image Anchor="C,T" AnchorSide="I,O" Offset="0,-27" Size="256,64" Texture="DecTop256x64.dds">
            <Image Anchor="C,C" Offset="0,-6" Size="80,80" Texture="NotificationFrameBase.dds">
                <Image ID="DialogTopIcon" Anchor="C,C" Offset="0,0" Size="80,80" Texture="NotificationGeneric.dds" />
            </Image>
        </Image>
        <Image Anchor="L,C" AnchorSide="O,I" Offset="-17,0" Size="32,64" Texture="Dec32x64Left.dds" />
        <Image Anchor="R,C" AnchorSide="O,I" Offset="-17,0" Size="32,64" Texture="Dec32x64Right.dds" />

  
        <Image ID="MajorEventBgImage" Texture="GreatWarPopupBG2.dds" Anchor="L,T" Size="606,260" Offset="17,44" Color="255,255,255,70" />

          
        <Label ID="MajEventTitle"    Anchor="C,T" Font="TwCenMT24" FontStyle="Shadow" ColorSet="Beige_Black_Alpha" String="A Major Event in the `War to End All Wars`" Offset="0, 20"/>
        <Label ID="MajEventMessage1" Anchor="C,T" Font="TwCenMT24" FontStyle="Shadow" ColorSet="Beige_Black_Alpha" String="Test Message" Offset="0, 40"/>

        <GridButton ID="MEDismiss" Anchor="C,B" Offset="0,60" Size="140,36" Style="BaseButton" ToolTip="Press OK button to dismiss window">
            <Label Anchor="C,C" Offset="0,-2" String="Dismiss" Font="TwCenMT24" FontStyle="Shadow" ColorSet="Beige_Black_Alpha" />
        </GridButton>
    </Grid>
</Context>


Is there something I'm missing? Does the image need to be one of the "multiples of 4's" kind of thing?

Appreciate any suggestions!
 
Last edited:
If the image shows with no compression, but not with compression, the error is in how you are compressing it, not in the XML/Lua.

Civ5 uses a very old and/or custom DDS library so don't expect any old DDS file to load, Civ has oddities. Probably best to start with multiple of 4 dimensions. If that doesn't work, try DXT5. If that doesn't work, look at the images that are used as backgrounds and work backwards from one of those
 
@whoward69 - you were absolutely correct (as always...)!

I'm using Gimp2 for images, so am always a bit suspect about its outputs. However, when I made the image sizes a multiple of 4 for both dimensions and using DXT3, the image appeared, no problems.

Thanks!
 
Top Bottom