How do you add static images to a window?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

IceThatJaw
Just popping in
Just popping in
Posts: 3
Joined: Tue Apr 03, 2012 18:54

How do you add static images to a window?

Postby IceThatJaw » Tue Apr 03, 2012 18:57

I selected a static image widget and put the file path in the image attribute but it doesn't do anything and reverts back to being blank if I select another window.
Basically what I am trying to do is create a HUD and I figured I'd start by adding some static images to the screen.

Does anyone know of any tutorials for creating a HUD withe CEGUILayout editor?

Thanks.

matt
Not too shy to talk
Not too shy to talk
Posts: 37
Joined: Tue Nov 08, 2011 16:00

Re: How do you add static images to a window?

Postby matt » Wed Apr 04, 2012 11:38

Here is a very good article with very simple sample files to learn how to create Widgets by code or by xml:

Here is the section about doing it in code: http://www.cegui.org.uk/wiki/index.php/Sample_code_for_all_Widgets#Files
And here is the section about doing it in xml: http://www.cegui.org.uk/wiki/index.php/Sample_code_for_all_Widgets#WidgetGalore.layout

There is an example for each kind of widget.


For your specific problem:
If you can't see your static image, the most probable reasons are:
  • You didn't defined a size for this widget, so it's size is (0,0).
  • The URL of the image is wrong, so that it displays nothing. (I think that in this case an error is thrown)

hope it helps :)


Return to “Help”

Who is online

Users browsing this forum: No registered users and 32 guests