Showing tooltips several times?

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

Nomonkeybusiness
Not too shy to talk
Not too shy to talk
Posts: 45
Joined: Wed Sep 09, 2009 11:20

Showing tooltips several times?

Postby Nomonkeybusiness » Tue Jul 20, 2010 10:02

Hi. I'm trying to create tooltips for gameworld-entities. I do a raycast to recieve the entity, and then I figured I could use the Root-window's tooltip, and just change the text, depending on what entity it is. Then, after the mouse is moved I hide the tooltip, and after a second I make the raycast again and shows the tooltip if hovering an entity.
It works for the first entity I hover, but after that I have to hover the mouse over a different GUI-Window, and then back to Root in order to pick a new.
Is there any way into tricking CEGUI into showing the tooltip again?

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

Re: Showing tooltips several times?

Postby agamemnus » Tue Jul 20, 2010 12:42

I don't understand your explanation. I think you are missing some verbs/nouns... :\

DisplayTime and HoverTime could be what you need?

Also, you can just manually position/hide a simple text window instead of a tooltip. For instance:

Code: Select all

  <!--
  ***************************************************
   textWithBackground
  ***************************************************
  -->
  <WidgetLook name="textWithBackground">
   <PropertyDefinition name="normalTextColor" initialValue="FFFFFFFF" redrawOnWrite="true" />
   <PropertyDefinition name="disabledTextColor" initialValue="FFFFFFFF" redrawOnWrite="true" />
   <PropertyDefinition name="backgroundColor" initialValue="FF000000" redrawOnWrite="true" />
   <PropertyDefinition name="borderColor" initialValue="FF8DA9B9" redrawOnWrite="true" />
   <PropertyDefinition name="borderSize" initialValue="0" redrawOnWrite="true" />
   <PropertyDefinition name="vertFormatting" initialValue="CenterAligned" redrawOnWrite="true" />
   <PropertyDefinition name="horzFormatting" initialValue="CenterAligned" redrawOnWrite="true" />
   <PropertyDefinition name="textOffsetX" initialValue="0" redrawOnWrite="true" />
   <PropertyDefinition name="extraProperties" initialValue="" redrawOnWrite="true" />
   <ImagerySection name="label">
    <TextComponent>
     <Area>
      <Dim type="LeftEdge"><PropertyDim name="textOffsetX" /></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>
     <VertFormatProperty name="vertFormatting" />
     <HorzFormatProperty name="horzFormatting" />
    </TextComponent>
   </ImagerySection>
   <ImagerySection name="background">
    <FrameComponent>
     <Area>
      <Dim type="LeftEdge"><PropertyDim name="borderSize" /></Dim>
      <Dim type="TopEdge"><PropertyDim name="borderSize" /></Dim>
      <Dim type="Width"><UnifiedDim scale="1" type="Width">
      <DimOperator op="Add"><AbsoluteDim value="-2">
       <DimOperator op="Multiply"><PropertyDim name="borderSize" /></DimOperator>
      </AbsoluteDim></DimOperator>
     </UnifiedDim></Dim>
      <Dim type="Height"><UnifiedDim scale="1" type="Height">
      <DimOperator op="Add"><AbsoluteDim value="-2">
       <DimOperator op="Multiply"><PropertyDim name="borderSize" /></DimOperator>
      </AbsoluteDim></DimOperator>
     </UnifiedDim></Dim>
    </Area>
    <Image imageset="TaharezLook" image="GenericBrush" />
     <ColorProperty name="backgroundColor" />
     <VertFormat type="Stretched" />
     <HorzFormat type="Stretched" />
    </FrameComponent>
   </ImagerySection>
    <ImagerySection name="backgroundBorder">
    <FrameComponent>
     <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>
    <Image imageset="TaharezLook" image="GenericBrush" />
     <ColorProperty name="borderColor" />
     <VertFormat type="Stretched" />
     <HorzFormat type="Stretched" />
    </FrameComponent>
   </ImagerySection>
   <StateImagery name="Enabled">
    <Layer>
    <Section section="backgroundBorder" />
     <Section section="background" />
     <Section section="label">
      <ColorProperty name="normalTextColor" />
     </Section>
    </Layer>
   </StateImagery>
   <StateImagery name="Disabled">
    <Layer>
    <Section section="backgroundBorder" />
    <Section section="background" />
     <Section section="label">
      <ColorProperty name="disabledTextColor" />
     </Section>
    </Layer>
   </StateImagery>
  </WidgetLook>

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

Re: Showing tooltips several times?

Postby CrazyEddie » Wed Jul 21, 2010 09:32

Nomonkeybusiness wrote:Is there any way into tricking CEGUI into showing the tooltip again?

Not tried it, but perhaps CEGUI::Tooltip::setTargetWindow passing 0 to clear the current target window?

CE.

Nomonkeybusiness
Not too shy to talk
Not too shy to talk
Posts: 45
Joined: Wed Sep 09, 2009 11:20

Re: Showing tooltips several times?

Postby Nomonkeybusiness » Sat Jul 24, 2010 10:05

CE: That worked fine. Thanks alot.
And I may have forgotten to say this, but thanks for an excellent GUI-library, what we're doing right now wouldn't be possible without CEGUI.
Keep it up :)

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

Re: Showing tooltips several times?

Postby CrazyEddie » Mon Jul 26, 2010 08:46

Cool. I'm glad it worked. And I'm glad you're finding CEGUI useful :)

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 11 guests