[Solved] Tooltip doesn't draw!

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

JonLord
Just popping in
Just popping in
Posts: 9
Joined: Wed Nov 06, 2013 03:11

[Solved] Tooltip doesn't draw!

Postby JonLord » Fri Apr 29, 2016 18:26

Hi again. I've already figured out how to do the other stuff. Now I have some trouble with the "tooltips". I'm using the 'GlossySerpent' skin , but it doesn't display the tooltips. From what I've read, it doesn't invoke the events TooltipActive and TooltipInactive

Here's part of the code;

When I set default tooltip

Code: Select all

      CEGUI::System::getSingleton().getDefaultGUIContext().setDefaultTooltipType("GlossySerpent/Tooltip");


When I render the tooltip, forging a setVisible(true) to show it! (Fix??)

Code: Select all

   CEGUI::System::getSingleton().getDefaultGUIContext().getDefaultTooltipObject()
      ->update(Time::getSingleton().getElapsedTimef());

   CEGUI::System::getSingleton().renderAllGUIContexts();


LookNFeel of Tooltip's GlossySerpent

Code: Select all


    <!--
    ***************************************************
        GlossySerpent/Tooltip
        (based on the Taharez Look)
    ***************************************************
     -->
   
    <WidgetLook name="GlossySerpent/Tooltip">
        <NamedArea name="TextArea">
            <Area>
                <Dim type="LeftEdge" ><ImageDim name="GlossySerpent/TooltipLeftEdge" dimension="Width" /></Dim>
                <Dim type="TopEdge" ><ImageDim name="GlossySerpent/TooltipTopEdge" dimension="Height" /></Dim>
                <Dim type="RightEdge" >
                    <OperatorDim op="Subtract">
                        <UnifiedDim scale="1" type="RightEdge" />
                        <ImageDim name="GlossySerpent/TooltipRightEdge" dimension="Width" />
                    </OperatorDim>
                </Dim>
                <Dim type="BottomEdge" >
                    <OperatorDim op="Subtract">
                        <UnifiedDim scale="1" type="BottomEdge" />
                        <ImageDim name="GlossySerpent/TooltipBottomEdge" dimension="Height" />
                    </OperatorDim>
                </Dim>
            </Area>
        </NamedArea>
        <ImagerySection name="main">
            <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 component="TopLeftCorner" name="GlossySerpent/TooltipTopLeft" />
                <Image component="TopRightCorner" name="GlossySerpent/TooltipTopRight" />
                <Image component="BottomLeftCorner" name="GlossySerpent/TooltipBottomLeft" />
                <Image component="BottomRightCorner" name="GlossySerpent/TooltipBottomRight" />
                <Image component="LeftEdge" name="GlossySerpent/TooltipLeftEdge" />
                <Image component="RightEdge" name="GlossySerpent/TooltipRightEdge" />
                <Image component="TopEdge" name="GlossySerpent/TooltipTopEdge" />
                <Image component="BottomEdge" name="GlossySerpent/TooltipBottomEdge" />
                <Image component="Background" name="GlossySerpent/TooltipMiddle" />
            </FrameComponent>
        </ImagerySection>
       
        <ImagerySection name="label">
            <TextComponent>
                <Area>
                    <Dim type="LeftEdge" ><ImageDim name="GlossySerpent/TooltipLeftEdge" dimension="Width" /></Dim>
                    <Dim type="TopEdge" ><ImageDim name="GlossySerpent/TooltipTopEdge" dimension="Height" /></Dim>
                    <Dim type="RightEdge" >
                        <OperatorDim op="Subtract">
                            <UnifiedDim scale="1" type="RightEdge" />
                            <ImageDim name="GlossySerpent/TooltipRightEdge" dimension="Width" />
                        </OperatorDim>
                    </Dim>
                    <Dim type="BottomEdge" >
                        <OperatorDim op="Subtract">
                            <UnifiedDim scale="1" type="BottomEdge" />
                            <ImageDim name="GlossySerpent/TooltipBottomEdge" dimension="Height" />
                        </OperatorDim>
                    </Dim>
                </Area>
                <Colours topLeft="FFFFE6DA" topRight="FFFFE6DA" bottomLeft="FFFFFBFA" bottomRight="FFFFFBFA" />
                <VertFormat type="CentreAligned" />
                <HorzFormat type="CentreAligned" />
            </TextComponent>
        </ImagerySection>
       
        <StateImagery name="Enabled">
            <Layer>
                <Section section="main">
                    <Colours topLeft="BFCDCDCD" topRight="BFCDCDCD" bottomLeft="BFCDCDCD" bottomRight="BFCDCDCD" />
                </Section>
                <Section section="label" />
            </Layer>
        </StateImagery>
        <StateImagery name="Disabled">
            <Layer>
                <Section section="main">
                    <Colours topLeft="BFEAEAEA" topRight="BFEAEAEA" bottomLeft="BFEAEAEA" bottomRight="BFEAEAEA" />
                </Section>
                <Section section="label" />
            </Layer>
        </StateImagery>

        <AnimationDefinition name="FadeIn" duration="0.33" replayMode="once">
            <Affector property="Alpha" interpolator="float">
                <KeyFrame position="0" sourceProperty="Alpha" />
                <KeyFrame position="0.33" value="1" progression="linear" />
            </Affector>
           
            <Subscription event="TooltipActive" action="Start" />
        </AnimationDefinition>
       
        <AnimationDefinition name="FadeOut" duration="0.33" replayMode="once">
            <Affector property="Alpha" interpolator="float">
                <KeyFrame position="0" sourceProperty="Alpha" />
                <KeyFrame position="0.33" value="0" progression="linear" />
            </Affector>
            <Affector property="Visible" interpolator="bool">
                <KeyFrame position="0" sourceProperty="Visible" />
                <KeyFrame position="0.33" value="false" progression="discrete" />
            </Affector>
           
            <Subscription event="TooltipInactive" action="Start" />
        </AnimationDefinition>

    </WidgetLook>


I'm using v0.8.7. I used 0.8.2 version and it doesn't draw it too.

JonLord
Just popping in
Just popping in
Posts: 9
Joined: Wed Nov 06, 2013 03:11

Re: Tooltip doesn't draw!

Postby JonLord » Fri Apr 29, 2016 20:45

I solved it!
The problem was in injectPulse, i only called for System and i had to called for GUICOntext too.

Thanks

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Tooltip doesn't draw!

Postby Ident » Sat Apr 30, 2016 16:00

Hah , i actually wanted to suggest that next ;) The Tooltip relies on the correct time being entered, a lot of other elements are not affected by time.

Thanks for posting the solution.
CrazyEddie: "I don't like GUIs"


Return to “Help”

Who is online

Users browsing this forum: No registered users and 25 guests