Text clipping / widget size

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

Jacky_J
Just popping in
Just popping in
Posts: 3
Joined: Fri Oct 13, 2006 04:31

Text clipping / widget size

Postby Jacky_J » Wed Jan 10, 2007 06:16

I have a minimalist widget for displaying text without frames / backgrounds. I'm trying to create a function that will allow you to add text to the screen by specifying position, font, text, etc... However, i don't want to have to specify the size of the widget. If the widget is too small, text gets clipped.

So is there a way disable clipping?

If not, how about setting the size of the widget based on text width. i found this thread: http://www.cegui.org.uk/phpBB2/viewtopi ... =text+size
but seems way too old and i couldn't find the method "absoluteToRelativeX" anywhere.

Or maybe i'm going the wrong direction with this whole text thing and there's an easier way of getting a simple text string on the screen?

here's the widget code (i'm using a DefaultWindow as the type):

Code: Select all

<WidgetLook name="Jacky/Text">
      <PropertyDefinition name="TextColour" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFCCCCCC br:FFCCCCCC" redrawOnWrite="true" />
      <ImagerySection name="Label">
         <TextComponent>
            <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>
            <VertFormat type="CentreAligned" />
            <HorzFormat type="CentreAligned" />         
         </TextComponent>
      </ImagerySection>
      <StateImagery name="Enabled">
         <Layer>
            <Section section="Label">
               <ColourRectProperty name="TextColour" />
            </Section>            
         </Layer>
      </StateImagery>
      <StateImagery name="Disabled" />
   </WidgetLook>   



Thanks

Return to “Help”

Who is online

Users browsing this forum: No registered users and 25 guests