Page 1 of 1

round frame corner problem

Posted: Mon Jul 03, 2006 07:43
by angela4et
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 :)

Posted: Mon Jul 03, 2006 13:54
by Rackle
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.

Posted: Tue Jul 04, 2006 11:25
by Dalfy
Vanilla use rounded frame border maybe you can look at the skin definition file for Vanilla as well

Posted: Tue Jul 04, 2006 13:56
by Rackle
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">
        <Dim type="LeftEdge">
          <AbsoluteDim value="0" />
        <Dim type="TopEdge">
          <AbsoluteDim value="0" />
        <Dim type="RightEdge">
          <UnifiedDim scale="1" type="RightEdge" />
        <Dim type="BottomEdge">
          <UnifiedDim scale="1" offset="-4" type="BottomEdge" />

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.

Posted: Tue Jul 04, 2006 14:25
by lindquist
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