The Tooltip Supremacy

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

The Tooltip Supremacy

Postby agamemnus » Sat Jul 17, 2010 06:39

OK, so I have a slider and a slider button ("thumb"). Each one has a different default tooltip height. (because the tooltip height is based in the position/size of its parent)

When mousing over the thumb, CEGUI doesn't know which tooltip height to apply and it alternated the tooltip heights, causing jittering. It should apply the most ancestral one (or at least it should just choose one!), but it just alternates madly.

I set InheritsTooltipText to "false" for the thumb for a temporary fix.

Edit: Oddly, it also alternates at the very leftmost side of the parent, even with InheritsTooltipText set to "false"... I don't see anything special about that place. There's nothing there except the silder..

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: The Tooltip Supremacy

Postby CrazyEddie » Wed Jul 21, 2010 09:16

Default tooltip height? I don't understand. What setting is that? Generally the only tooltip setting you can specify is the text, unless you're using a separate tooltip object for the two windows, or something?

CE.

Jamarr
CEGUI MVP
CEGUI MVP
Posts: 812
Joined: Tue Jun 03, 2008 23:59
Location: USA

Re: The Tooltip Supremacy

Postby Jamarr » Wed Jul 21, 2010 14:16

I have a slider and a slider button ("thumb"). Each one has a different default tooltip height. (because the tooltip height is based in the position/size of its parent)


Why would a tooltip be a child of the window it is targeting? This does not make any sense. Typically a tooltip would be a child of the root-window / GUISheet.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: The Tooltip Supremacy

Postby agamemnus » Wed Jul 21, 2010 15:00

CrazyEddie wrote:Default tooltip height? I don't understand. What setting is that? Generally the only tooltip setting you can specify is the text, unless you're using a separate tooltip object for the two windows, or something?

CE.

There is no setting. What I meant by the "default tooltip height" is the Y-axis difference between the tooltip and a window.


Jamarr wrote:
I have a slider and a slider button ("thumb"). Each one has a different default tooltip height. (because the tooltip height is based in the position/size of its parent)


Why would a tooltip be a child of the window it is targeting? This does not make any sense. Typically a tooltip would be a child of the root-window / GUISheet.

When I say "parent", I mean the window the tooltip is targeting.


So to clarify, here's the slider with a thumb:

=====[]=====

When I mouse over the slider itself, there's a tooltip that appears:
[[ Hi, I'm a tooltip ]]

When I mouse over the thumb, the tooltip stays there, but it rapidly jumps around or shakes - up, down, up, down. I think this is because the slider height and thumb height are different, and CEGUI somehow sets the tooltip y-offset according to a different window for each frame.
Frame 1: offset to the slider.
Frame 2: offset to the thumb.
Frame 3: offset to the slider.
Frame 4: offset to the thumb.

And so on... and that causes it to jump because the height of the thumb and slider are different and the global tooltip y-offset seems to be based on the top value of its target.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: The Tooltip Supremacy

Postby CrazyEddie » Thu Jul 22, 2010 13:20

IIRC the tool tip window position is not updated every frame. The position is only updated for certain state changes (target window, if the mouse enters the tooltip window, tooltip text changes and such like), and even then is based upon the mouse cursor position and not the target window position, so unless you're manually doing something to trigger repositioning (either directly, or indirectly), it should not be anything such as you describe as regards to slider and thumb positions.

What it almost sounds like is front and back buffers having different content and you see that jumping when flipping, however, assuming the screen is redrawn each frame, this makes no sense either.

So, don't know, then...

CE.

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: The Tooltip Supremacy

Postby agamemnus » Mon Jul 26, 2010 05:41

I found out the problem.

The tooltip only jumps around because I am switching gui sheets... I switch style sheets, twice per frame, so that I can draw some things in different order in my game...

Trying to do away with gui sheet switching but it is hard.

Edit: "Sized" also fires constantly when I change style sheets... I'm not sure if this is intended.
Last edited by agamemnus on Wed Jul 28, 2010 21:41, edited 1 time in total.

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: The Tooltip Supremacy

Postby agamemnus » Tue Jul 27, 2010 21:24

OK.... I tried multiple approaches but so far nothing has worked perfectly.

1) I tried this: renderGUI ();

Code: Select all

 ' Calculate map label positions for cities and render.
 cegui.setVisible (guiPtr->worldmap.root, 0)
 cegui.setVisible (guiPtr->worldmap.maplabelparent, 1)
 drawCityLabels (camera3D, camera, cameraChanged, firstDisplayMapLoop)
 cegui.render 'renderGUI ();

 ' Calculate the flag positions for merchants and render.
 drawMerchantFlags (camera3D, camera)

 cegui.setVisible (guiPtr->worldmap.maplabelparent, 0)
 cegui.setVisible (guiPtr->worldmap.root, 1)
 cegui.render 'renderGUI ();


Unfortunately, tooltips do not function because the tooltips automatically disappear when I set guiPtr->worldmap.root's visibility to 0. Is there any way to make the tooltip stay even when visibility goes to 0?

2) I tried this: the individual window render function.

Code: Select all

 ' Calculate map label positions for cities and render.
 drawCityLabels (camera3D, camera, cameraChanged, firstDisplayMapLoop)
 cegui.render (guiPtr->worldmap.maplabelparent)

 ' Calculate the flag positions for merchants and render.
 drawMerchantFlags (camera3D, camera)

 cegui.render (guiPtr->worldmap.root)

However, nothing is rendered!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: The Tooltip Supremacy

Postby CrazyEddie » Thu Jul 29, 2010 09:19

If you need some custom behaviour, then then you need a custom solution (i.e. implement a fake tooltip window, or something). Trying to force the existing components to work in a way they ware not designed to work, is frustrating and a waste of time; most times the time expended trying to get the kludge to work is more than the time it would have taken to do a custom solution.

Switching and rendering sheets during the same frame is not something that was ever intended, so I'm not surprised that does odd things. How 'best' to achieve "sandwiching" content between CEGUI layers is a tough call, and depends on lots of unknowns.

CE.

agamemnus
Just can't stay away
Just can't stay away
Posts: 185
Joined: Sun Mar 14, 2010 04:21

Re: The Tooltip Supremacy

Postby agamemnus » Thu Jul 29, 2010 14:59

I could initialize CEGUI twice... :|

Edit: I guess I might eventually just make a custom tooltip.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 16 guests