round frame corner problem

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

angela4et
Just popping in
Just popping in
Posts: 7
Joined: Mon Jul 03, 2006 06:36
Contact:

round frame corner problem

Postby angela4et » Mon Jul 03, 2006 07:43

hi guys..
now i am doing a chat bubble, the bubble has a round or elliptical frame. this frame is the frame of a FrameWindow, and it also has a yellow color background. since my frame has four round corners, the squarish background will go out of the frame at the corners, anybody got any idea how to fit the background with the frame nicely ?? thanks alooooooooot :)

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Mon Jul 03, 2006 13:54

There's a post about that somewhere in these forums. What I remember from it is that right now Cegui uses rectangular regions for everything. In order to have your text fit within your rounded corners you have to shrink the inner portion of the frame. This would be within the .looknfeel file.

Open TaharezLook.looknfeel. The first item is TaharezLook/Button. The first ImagerySection defines the label at absolute positions (0,0) and a width and height of 100%. Then it defines the edges the same way. If your corner are rounded then a portion of the label would stick out from the corners.

I also plan on using rounded corners so will face that same problem. My plan is to create my own looknfeel. The corners will have fixed height width, determined by the image height and width. The "label" part would then have:
  • left: 0 + image width
  • top: 0 + image height
  • width: widget width - image width - image width
  • height: widget height - image heigh - image height


Hopefully this makes sense.

User avatar
Dalfy
CEGUI Team (Retired)
Posts: 130
Joined: Tue Oct 11, 2005 16:13
Location: Paris, FRANCE
Contact:

Postby Dalfy » Tue Jul 04, 2006 11:25

Vanilla use rounded frame border maybe you can look at the skin definition file for Vanilla as well

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Postby Rackle » Tue Jul 04, 2006 13:56

From Vanilla.imageset:

Code: Select all

<Image Name="FrameTopLeft" XPos="1" YPos="1" Width="6" Height="6" />


I take this to mean that the top left corder is a 6x6 pixel image.


From Vanilla.looknfeel:

Code: Select all

<WidgetLook name="Vanilla/Button">
  <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" offset="-4" type="BottomEdge" />
        </Dim>
       </Area>


I would have expected the BottomEdge to have an offset of -6 rather than -4. I would also have expected LeftEdge and TopEdge to have an offset="+6" and the RightEdge to have an offset="-6" rather than nothing.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Tue Jul 04, 2006 14:25

that does look kinda odd
tho in reality you dont need the full corner size as offset. being round it's more like half that


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests