Page 1 of 1

How do you add static images to a window?

Posted: Tue Apr 03, 2012 18:57
by IceThatJaw
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.

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

Posted: Wed Apr 04, 2012 11:38
by matt
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 :)