How to add a UI image?

Thalassicus

Bytes and Nibblers
Joined
Nov 9, 2005
Messages
11,057
Location
Texas
How do I add a texture to the interface? I followed the steps below.

  1. I created a texture file of a ? question mark image, Unmet32.dds.
  2. Added it to my project.
  3. Set Import into VFS = true.
  4. Added to CityBannerManager.xml:
    <Image Anchor="C,C" Size="32,32" Texture="Unmet32.dds" Color="200,200,200,255" ID="MinorIndicatorUnmet" Hidden="0" />
Ingame it said it "can't find the texture Unmet32.dds." What am I missing? Does it need a path to the image... and if so, what should I put?
 
It SHOULD work; my own mod uses quite a few custom background images for various UI elements, and I haven't had any issues.

So I can see three possibilities:
1> You have a typo in there somewhere, like the filename isn't capitalized or something. Not likely, I know.

2> I'm not sure if you'd see that message if you made an error on sizing (i.e., you're loading it as a 32x32 image but the DDS is 33x33).

3> Your DDS isn't saved with a compression the game recognizes. I use BC3/DXT5, which only has the drawback that the X and Y sizes both have to be multiples of 4, but other than that Civ5 can load it just fine. I know Civ5 can't handle uncompressed DDS formats, and the specific compression used might be part of the reason I've been having problems with the DX10 executable, but I'm still learning this part myself.
 
Hmm each of those three things checks out. It must be something else causing the problem, outside the information provided above. I'm not sure what else to consider though. :think:

Edit: I typed the extension instead of clicking the file type dropdown box, so it saved in psd format with a dds extension. :crazyeye:
 
Back
Top Bottom