StaticImage help

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
Nikon
Just popping in
Just popping in
Posts: 10
Joined: Mon Feb 21, 2005 22:42

StaticImage help

Postby Nikon » Mon Feb 21, 2005 22:48

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

User avatar
CyberJay
Not too shy to talk
Not too shy to talk
Posts: 24
Joined: Wed Jan 12, 2005 12:06

Re: StaticImage help

Postby CyberJay » Tue Feb 22, 2005 05:13

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);

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: StaticImage help

Postby CrazyEddie » Tue Feb 22, 2005 10:01

Also, are there any errors in the CEGUI.log file?

User avatar
Nikon
Just popping in
Just popping in
Posts: 10
Joined: Mon Feb 21, 2005 22:42

Re: StaticImage help

Postby Nikon » Tue Feb 22, 2005 21:03

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


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 7 guests