I have searched and read some topics about loading a image to a staticImage object, especially this one:
http://www.cegui.org.uk/phpBB2/viewtopi ... +jpg+image
I followed this page and implemented my function like this:
CEGUI::ImagesetManager::getSingleton().createImageset("mj.imageset");
guiWnd= WindowManager::getSingleton().getWindow("logo");
guiWnd->setImage("mjset", "ogretext");
"logo" is the name of a StaticImage object, defined as:
<Window Type="TaharezLook/StaticImage" Name="logo">
<Property Name="FrameEnabled" Value="False" />
<Property Name="BackgroundEnabled" Value="False" />
<Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" />
<Property Name="UnifiedSize" Value="{{1,0},{1,0}}" />
<Property Name="Alpha" Value="0.8" />
<Property Name="InheritsAlpha" Value="False" />
<Property Name="NormalImage" Value="set:mjset image:ogretext" />
</Window>
After compiling, my codeblocks shows this message:
error: 'class CEGUI::Window' has no member named 'setImage'
I looked up the CEGUI reference, and found that setImage is not a member function of StaticImage class, In fact I can not even find a StaticImage class, I don't know how to fix it.
I also want to load a image to a button, if it is possible? and how? thanks
[solved]How to load a image to a StaticImage or button
Moderators: CEGUI MVP, CEGUI Team
[solved]How to load a image to a StaticImage or button
Last edited by erwinxu on Fri Jul 11, 2008 14:48, edited 2 times in total.
- scriptkid
- Home away from home
- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
Hi and welcome
StaticImage and StaticText are mapped to the DefaultWindow, and can only be accessed by using properties, except for the common methods. To set your image, use:
For your second question, you also need to call properties, for example:
There's also HoverImage, PushedImage and DisabledImage.
For a full property reference, please see this thread: http://www.cegui.org.uk/phpBB2/viewtopic.php?t=2555
HTH.
StaticImage and StaticText are mapped to the DefaultWindow, and can only be accessed by using properties, except for the common methods. To set your image, use:
Code: Select all
guiWnd->setProperty("Image", "set:mjset image:ogretext");
For your second question, you also need to call properties, for example:
Code: Select all
button->setProperty("NormalImage", "set:mjset image:ogretext" )
There's also HoverImage, PushedImage and DisabledImage.
For a full property reference, please see this thread: http://www.cegui.org.uk/phpBB2/viewtopic.php?t=2555
HTH.
Check out my released snake game using Cegui!
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Who is online
Users browsing this forum: No registered users and 9 guests