[SOLVED]Looknfeel FrameComponent has gap

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

xyysnybzi
Just popping in
Just popping in
Posts: 7
Joined: Fri Jan 23, 2015 14:03

[SOLVED]Looknfeel FrameComponent has gap

Postby xyysnybzi » Sat Jan 24, 2015 05:28

Hi!
1. I use photoshop crop a button image to nine sub images
2. Add the nine images into a image with 2 pixels between each other
3. Create a button using FrameComponent and use the nine image
4. I got the result that the final image has gap between the nine element

this is my looknfeel code:

Code: Select all

<ImagerySection name="normal_imagery">
   <FrameComponent>
      <Area>
         <Dim type="LeftEdge">
            <AbsoluteDim value="0" />
         </Dim>
         <Dim type="TopEdge">
            <AbsoluteDim value="0" />
         </Dim>
         <Dim type="RightEdge">
            <UnifiedDim scale="1" offset="0" type="RightEdge" />
         </Dim>
         <Dim type="BottomEdge">
            <UnifiedDim scale="1" offset="0" type="BottomEdge" />
         </Dim>
      </Area>
      <Image component="TopLeftCorner" name="Arum/btn_blue_normal_LT"/>
      <Image component="TopRightCorner" name="Arum/btn_blue_normal_RT"/>
      <Image component="BottomLeftCorner" name="Arum/btn_blue_normal_LB"/>
      <Image component="BottomRightCorner" name="Arum/btn_blue_normal_RB"/>
      <Image component="LeftEdge" name="Arum/btn_blue_normal_L"/>
      <Image component="RightEdge" name="Arum/btn_blue_normal_R"/>
      <Image component="TopEdge" name="Arum/btn_blue_normal_T"/>
      <Image component="BottomEdge" name="Arum/btn_blue_normal_B"/>
      <Image component="BackGround" name="Arum/btn_blue_normal_M"/>
      <VertFormat type="Stretched" />
      <HorzFormat type="Stretched" />
   </FrameComponent>
</ImagerySection>



this is my imageset code:

Code: Select all

<Imageset Name="Arum" Imagefile="Arum.png" NativeHorzRes="256" NativeVertRes="256" AutoScaled="false">
    <Image Name="btn_blue_normal_B" XPos="2" YPos="2" Width="176" Height="25"/>
    <Image Name="btn_blue_normal_L" XPos="180" YPos="2" Width="25" Height="41"/>
    <Image Name="btn_blue_normal_LB" XPos="207" YPos="2" Width="25" Height="25"/>
    <Image Name="btn_blue_normal_LT" XPos="2" YPos="45" Width="25" Height="27"/>
    <Image Name="btn_blue_normal_M" XPos="29" YPos="45" Width="176" Height="41"/>
    <Image Name="btn_blue_normal_R" XPos="207" YPos="45" Width="25" Height="41"/>
    <Image Name="btn_blue_normal_RB" XPos="2" YPos="88" Width="25" Height="25"/>
    <Image Name="btn_blue_normal_RT" XPos="29" YPos="88" Width="25" Height="27"/>
    <Image Name="btn_blue_normal_T" XPos="56" YPos="88" Width="176" Height="27"/>
</Imageset>

The btn_blue_normal_LT and btn_blue_normal_T are not border upon

If i use one button image and create image definition in CEED, it is ok. but when the atlas update, all the positions may need update too.
so i want prepare crop it, and then i can update all the positions when make atlas. is it right?
Last edited by xyysnybzi on Tue Jan 27, 2015 18:36, edited 1 time in total.

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

Re: Looknfeel FrameComponent has gap

Postby Ident » Sat Jan 24, 2015 10:33

The pixels aroudn your cropped image are used for interpolation. You usually need to add a frame of pixels around each image, whereas the pixels are used for bilinear interpolation so they must be set right (right colour AND transparency). Transparency is a bit tricky in photoshop because you cant explicitly show the alpha values... If you have a gap you might wanna expand the relevant parts with an extra pixel around that edge, being the same colour as the outer pixel line inside the cropped area.

Please tell me if this helped!
CrazyEddie: "I don't like GUIs"

xyysnybzi
Just popping in
Just popping in
Posts: 7
Joined: Fri Jan 23, 2015 14:03

Re: Looknfeel FrameComponent has gap

Postby xyysnybzi » Tue Jan 27, 2015 18:33

Yes, it is helpful, thank you! I use TexturePacker to add a frame of pixels around each image and solve it!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 11 guests