CEGUI text formaters & image sets

Everything related to 3D programming
benubi
Enthusiast
Enthusiast
Posts: 220
Joined: Tue Mar 29, 2005 4:01 pm

CEGUI text formaters & image sets

Post by benubi »

Hello!

It's possible to use text formaters in CEGUI but it does not to work at all on EditorGadget3D, ComboBoxGadget3D and StringGadget3D. It seems to be incompletely implemented because I can't display an embedded images from the image-sets (CEGUI website example with mouse pointer). The image sets seem to be identical as on CEGUI's website and the mouse arrow does show on screen after RenderWorld().

I can remember to have been able to display tiles from the GUI image set in earlier PB versions. If not I must have dreamed it :lol:

You can also change the window title color, but the images also don't show up there (which would be awesome).

It's also possible to add colored gadget items to ListViewGadget3D and ComboboxGadget3D, but the Combobox will display an unformated text with the brackets - only inside the drop-down menu the items stay colored.

Also Window3D titles can be colored this way:

Code: Select all

 SetWindowTitle3D(1,"[colour='FFFFFF00'] Yellow window title")
Beside that a helper function IsMouseOverCEGUI() would come handy, and I miss a PopupMenu3D() - but I would be happy with more text formaters possibilities. I also suggest to allow text formaters in the window3d/gadget3d tooltips.
benubi
Enthusiast
Enthusiast
Posts: 220
Joined: Tue Mar 29, 2005 4:01 pm

Re: CEGUI text formaters & image sets

Post by benubi »

Sorry for the drama. I was partially wrong.


1) You can insert images from the imagesets with the formaters, but the simplest version doesn't seem to work.
This specific formater fails for me:

Code: Select all

Text$="[image='imageset/imagename'] Text with icon..."
But the images can be inserted this way:

Code: Select all

Text$="[image='set:imageset image:imagename'] Text with icon..."
The imagesets are only loaded when specified in the .scheme file, they are NOT all processed when you use Parse3DScripts(). Also when you don't specify the used font, when you don't use SetGUITheme3D(), it will use TaharezLook.sheme and ignore the font that is written in that scheme file (normally it's DejavuSans-10) and use the default DejaVuSans-10 in any case.


2) The tooltips already have implemented the images, they are only drawn in black/white negative but it looks very cool this way in the "vanilla style" or how it's called, judge for yourself:

Image

3) There are still some Gadgets that won't accept the formaters and some caveats I have to check.

Before the first RenderWorld() you should already have added all 3D archives, used Parse3DScripts() and SetGUITheme3D(). If not either the GUI will not show up and the program will directly crash or later freeze on system exit/close screen. Changing something at the GUI configuration after the first RenderWorld() will result in problems.

4) SetGUITheme3D() works only once! You can't switch themes before opening new windows, at least it doesn't seem so.

Hypothetically I'd like to generate a few pseudo image sets in the background, for the player logo/badge/avatar and team flags for example. Those may be generated on the fly or downloaded over the network, and it would be nice if they could be used in CEGUI over the formaters. I think it's not too important, it can also be done with textures. I don't think you can use named Ogre textures in CEGUI using their names, at least it didn't work for me.

Code: Select all

CreateTexture(#Texture, width, height, Name$) ; <-- not accessible through CEGUI formaters or is it?
Post Reply