Hi,
one short question: Is it possible to create "Super Tooltips" with CEGUI? Similar to the item tooltips in Diablo2. When you stay a while over an item or skill, you will get a tooltip with all the informations with it, text in different colors, etc.
I haven't looked into the tooltips yet, but is it doable or if not, how much work would it be to create them?
Greetings
"Super Tooltips"?
Moderators: CEGUI MVP, CEGUI Team
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
guess a bit more information could be useful...
0.5 adds a new TextProperty element to Falagard XML that can be used inside TextComponent elements.
This allows you to have an arbitrary number of Text properties for any window , with this you should be able to create a single Tooltip skin which has all all the properties you need like: ItemName, RequiredStr etc (whatever
)
These properties can be created in the looknfeel already via the PropertyDefinition element.
In code you could do something like updating the tooltip fields when the mouse moves over a new item.
HTH
0.5 adds a new TextProperty element to Falagard XML that can be used inside TextComponent elements.
This allows you to have an arbitrary number of Text properties for any window , with this you should be able to create a single Tooltip skin which has all all the properties you need like: ItemName, RequiredStr etc (whatever

These properties can be created in the looknfeel already via the PropertyDefinition element.
In code you could do something like updating the tooltip fields when the mouse moves over a new item.
HTH
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
I realise that this is not exactly beginner material.
There are several different approaches you can take to this. The one above is the most flexible IMHO.
Another route you can take is to create a simple Tooltip and use it as a container window. If you set this tooltip on each of your items, you will have single window which acts as tooltip for your items.
You could then just load a XML layout created with the layout editor into this tooltip. It might be easier, and avoids you having to learn Falagard XML.
Though I can only recommend that. Falagard is not just skinning, it's a extremely flexible layout format as well.
There are several different approaches you can take to this. The one above is the most flexible IMHO.
Another route you can take is to create a simple Tooltip and use it as a container window. If you set this tooltip on each of your items, you will have single window which acts as tooltip for your items.
You could then just load a XML layout created with the layout editor into this tooltip. It might be easier, and avoids you having to learn Falagard XML.
Though I can only recommend that. Falagard is not just skinning, it's a extremely flexible layout format as well.
Okay, again thx. Writing a custom Renderer was way easier
Now, back to the topic. You said I can place a TextProperty element inside a TextComponent (a static text?) (btw. I looked into the falagard pdf and didn't find info's about these two elements, are there any other sources?).
So, let's say I have a heading. I place a textproperty in it and than I can center it, change color, etc, right?
Now, next comes the description. Again, only text, will the textcomponent do automatic line breaks and can I add custom line breaks (e.g. a \n)? (I think it will be easy to specify the width of a tooltip to about 20% of the screen and let the height handle by CEGUI, right?)
After that come the stats. Can I specify as much stats as I want in the tooltip skin, even if I don't want to use them? E.g. I add somehting like RequiredStr for an item and RequiredMana for an spell, so I can reuse the tooltips for items and spells?
I only want to know if it's really flexible enough, before I go to mess around with it
Greetings

Now, back to the topic. You said I can place a TextProperty element inside a TextComponent (a static text?) (btw. I looked into the falagard pdf and didn't find info's about these two elements, are there any other sources?).
So, let's say I have a heading. I place a textproperty in it and than I can center it, change color, etc, right?
Now, next comes the description. Again, only text, will the textcomponent do automatic line breaks and can I add custom line breaks (e.g. a \n)? (I think it will be easy to specify the width of a tooltip to about 20% of the screen and let the height handle by CEGUI, right?)
After that come the stats. Can I specify as much stats as I want in the tooltip skin, even if I don't want to use them? E.g. I add somehting like RequiredStr for an item and RequiredMana for an spell, so I can reuse the tooltips for items and spells?
I only want to know if it's really flexible enough, before I go to mess around with it

Greetings
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Now, back to the topic. You said I can place a TextProperty element inside a TextComponent (a static text?) (btw. I looked into the falagard pdf and didn't find info's about these two elements, are there any other sources?).
The TextComponent is a Falagard tag that create a area capable of rendering text in the looknfeel. It is not related to the StaticText, in fact the StaticText uses custom rendering to allow the scrollbars.
Unfortunately the Falagard manual has not yet been updated properly but the latest additions are mentioned in the 0.5 release notes
In short, the TextProperty element is allowed inside a TextComponent. If it is present the text to render for the TextComponent will be fetched from the property you specify fx: <TextProperty name="RequiredStr" />.
With this you now render the text in the RequiredStr property.
Also FontProperty has been added which works similarly.
So, let's say I have a heading. I place a textproperty in it and than I can center it, change color, etc, right?
Yup. you can use Horz/VertFormat and Colour/Colours/ColourProperty/ColourRectProperty elements in any TextComponent.
Now, next comes the description. Again, only text, will the textcomponent do automatic line breaks and can I add custom line breaks (e.g. a \n)? (I think it will be easy to specify the width of a tooltip to about 20% of the screen and let the height handle by CEGUI, right?)
HorzFormat support multiple word wrapped formats for TextComponents.
I'm not sure where you're going with the 20%, but unfortunately Falagard does not yet provide a element for counting lines in wrapped text. You will need to this in code and (possible) provide it to the looknfeel via a property, which can then be used in a DimOperator chain to get the area you're looking for.
fx:
Code: Select all
<FontDim type="LineSpacing">
<DimOperator op="Multiply">
<PropertyDim name="NumLinesInDescription" />
</DimOperator>
</FontDim>
After that come the stats. Can I specify as much stats as I want in the tooltip skin, even if I don't want to use them? E.g. I add somehting like RequiredStr for an item and RequiredMana for an spell, so I can reuse the tooltips for items and spells?
That should be doable, you can use PropertyLinkDefinition to link properties, it really meant for linking to properties in child windows but IIRC it can be used locally as well.
The tooltip is reusable in fact all your items/spells etc can use the same tooltip instance.
I only want to know if it's really flexible enough, before I go to mess around with it
Greetings
I hope you do

I read the realse notes and looked a little bit into the tharezlook looknfeel file. So far, I've understood the upper half of your post
Now, here's my first question about the area element. The upper one comes from a button and the lower one from a static text. Where's the difference in these two? According to the documentation, it should look like the upper one. And what's the purpose of the type-attribute?
Now the question for me is, how do I define the correct height of every area element? First, we have a heading, one line, one free line, than a descritpion with x lines. Looks life you are doing it with this FontDim and DimOperation, but I didn't understand this. Well, I'll look into the docu again
Greetings

Now, here's my first question about the area element. The upper one comes from a button and the lower one from a static text. Where's the difference in these two? According to the documentation, it should look like the upper one. And what's the purpose of the type-attribute?
Code: Select all
<Area>
<Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim>
<Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim>
</Area>
<Area>
<Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="RightEdge" ><UnifiedDim scale="1" type="RightEdge" /></Dim>
<Dim type="BottomEdge" ><UnifiedDim scale="1" type="BottomEdge" /></Dim>
</Area>
Now the question for me is, how do I define the correct height of every area element? First, we have a heading, one line, one free line, than a descritpion with x lines. Looks life you are doing it with this FontDim and DimOperation, but I didn't understand this. Well, I'll look into the docu again

Greetings
Who is online
Users browsing this forum: No registered users and 17 guests