Page 1 of 1

StaticImage help

Posted: Mon Feb 21, 2005 22:48
by Nikon
First of all, I'd like to say that CrazyEddie has made quite an amazing GUI system :).

I am having trouble using a StaticImage as the background of my GUI. This is the code I am using:

Code: Select all

CEGUI::ImagesetManager::getSingleton().createImageset("../datafiles/imagesets/pawn.imageset", "Pawn");
StaticImage* si = (StaticImage*)WindowManager::getSingleton().createWindow((utf8*)"TaharezLook/StaticImage", (utf8*)"Backdrop");
sheet->addChildWindow(si);
      
si->setImage("PawnImageset", "Background");
si->setPosition(Absolute, Point(0, 0));
si->setSize(Relative, Size(1.0f, 1.0f));
si->setFrameEnabled(false);
si->setBackgroundEnabled(true);
si->setAlwaysOnTop(false);
si->setAlpha(1.0f);
si->setEnabled(false);
si->moveToBack();
si->show();


Nothing shows up at all, it is just a plain black background. I have tried everything and I have no clue what is wrong.. :(. Any help would be greatly appreciated.

Thanks in advance!

Nikon

Re: StaticImage help

Posted: Tue Feb 22, 2005 05:13
by CyberJay
I don't see the rest of your code but just as a reminder, did you set your sheet as the active sheet in the gui?

CEGUI::System::getSingleton().setGUISheet(sheet);

Re: StaticImage help

Posted: Tue Feb 22, 2005 10:01
by CrazyEddie
Also, are there any errors in the CEGUI.log file?

Re: StaticImage help

Posted: Tue Feb 22, 2005 21:03
by Nikon
Wow, I feel like such an idiot. I was loading a layout from an xml file, and sheet was never actually used for anything :(. I got it working by adding it to the xml file, however now it just displays a white rectangle, and once again I am lost :(. This is the imageset file which might be of some importance:

Code: Select all

<?xml version="1.0" ?>
<Imageset Name="PawnImageset" Imagefile="../datafiles/imagesets/pawn.jpg" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true">
   <Image Name="Background" XPos="0" YPos="0" Width="1600" Height="1200" />
</Imageset>


Thanks again!

Nikon