[SOLVED] No Image Transparency in a StaticImage element.

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

Dreadis
Just popping in
Just popping in
Posts: 1
Joined: Sun Apr 26, 2009 01:35

[SOLVED] No Image Transparency in a StaticImage element.

Postby Dreadis » Sun Apr 26, 2009 01:59

Hi, I am very new to CEGUY I used the last three days to create a own template. Basically I made an image file with a couple of images and edited the TaharezLook.looknfeel file. Copied the "button" element and set every of my images as a button. But I also used images just to make my GUI a bit better looking. After some time I got it to use the StaticImage element that my image is displayed in it. Now I have the next problem and this time I didn't get a solution. That the displayed image has no transparency any more. Did I missed something in my XML code or is it maybe not possible to display the transparency in the StaticImage element?

I hope maybe here can someone help me.
Gretings
Dreadis

.scheme

Code: Select all

<FalagardMapping WindowType="TaharezLook/Bottombar"      TargetType="DefaultWindow"  Renderer="Falagard/StaticImage"       LookNFeel="TaharezLook/Bottombar" />


.looknfeel

Code: Select all

   
<!--
    ***************************************************
        TaharezLook/Bottombar
    ***************************************************
    -->
    <WidgetLook name="TaharezLook/Bottombar">
      <PropertyDefinition name="ImageColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
      <PropertyDefinition name="FrameColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
      <PropertyDefinition name="BackgroundColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
        <PropertyDefinition name="VertFormatting" initialValue="Stretched" redrawOnWrite="true" />
        <PropertyDefinition name="HorzFormatting" initialValue="Stretched" redrawOnWrite="true" />
        <Property name="BackgroundEnabled" value="True" />
        <Property name="FrameEnabled" value="True" />
      <ImagerySection name="normal">
            <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>
                <HorzFormat type="Tiled" />
                     <Image type="LeftEdge" imageset="TaharezLook" image="BottombarLeft" />
                <Image type="RightEdge" imageset="TaharezLook" image="BottombarRight" />
                <Image type="Background" imageset="TaharezLook" image="BottombarMiddle" />
            </FrameComponent>
            <ImageryComponent>
                <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>
                <ImageProperty name="NormalImage" />
                <VertFormatProperty name="VertImageFormatting" />
                <HorzFormatProperty name="HorzImageFormatting" />
            </ImageryComponent>
        </ImagerySection>
        <ImagerySection name="image_withframe">
            <ImageryComponent>
                <Area>
               <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="StaticLeft" dimension="Width" /></Dim>
               <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="StaticTop" dimension="Height" /></Dim>
               <Dim type="RightEdge" >
                  <UnifiedDim scale="1" type="RightEdge">
                     <DimOperator op="Subtract">
                        <ImageDim imageset="TaharezLook" image="StaticRight" dimension="Width" />
                     </DimOperator>
                  </UnifiedDim>
               </Dim>
               <Dim type="BottomEdge" >
                  <UnifiedDim scale="1" type="BottomEdge">
                     <DimOperator op="Subtract">
                        <ImageDim imageset="TaharezLook" image="StaticBottom" dimension="Height" />
                     </DimOperator>
                  </UnifiedDim>
               </Dim>
            </Area>
                <ImageProperty name="Image" />
                <ColourRectProperty name="ImageColours" />
                <VertFormatProperty name="VertFormatting" />
                <HorzFormatProperty name="HorzFormatting" />
            </ImageryComponent>
        </ImagerySection>
        <ImagerySection name="image_noframe">
            <ImageryComponent>
                <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>
            <HorzFormat type="Stretched" />
            <VertFormat type="Stretched" />
                <ImageProperty name="Image" />
                <ColourRectProperty name="ImageColours" />
                <VertFormatProperty name="VertFormatting" />
                <HorzFormatProperty name="HorzFormatting" />
            </ImageryComponent>
        </ImagerySection>
       <StateImagery name="Enabled">
        <Layer>
         <Section section="normal" />
         <Section section="label">
           <ColourProperty name="NormalTextColour" />
         </Section>
        </Layer>
      </StateImagery>
        <StateImagery name="Disabled" />
        <StateImagery name="EnabledFrame">
            <Layer>
                <Section look="TaharezLook/StaticShared" section="frame" />
            </Layer>
        </StateImagery>
        <StateImagery name="DisabledFrame">
            <Layer>
                <Section look="TaharezLook/StaticShared" section="frame" />
            </Layer>
        </StateImagery>
        <StateImagery name="WithFrameEnabledBackground">
            <Layer>
                <Section look="TaharezLook/StaticShared" section="background" />
            </Layer>
        </StateImagery>
        <StateImagery name="WithFrameDisabledBackground">
            <Layer>
                <Section look="TaharezLook/StaticShared" section="background" />
            </Layer>
        </StateImagery>
        <StateImagery name="NoFrameEnabledBackground">
            <Layer>
                <Section look="TaharezLook/StaticShared" section="background_noframe" />
            </Layer>
        </StateImagery>
        <StateImagery name="NoFrameDisabledBackground">
            <Layer>
                <Section look="TaharezLook/StaticShared" section="background_noframe" />
            </Layer>
        </StateImagery>
        <StateImagery name="WithFrameImage">
            <Layer>
                <Section section="image_withframe" />
            </Layer>
        </StateImagery>
        <StateImagery name="NoFrameImage">
            <Layer>
                <Section section="image_noframe" />
            </Layer>
        </StateImagery>
    </WidgetLook>
   
   



.imageset

Code: Select all

<Image Name="BottombarLeft" XPos="35" YPos="178" Width="120" Height="43" />
      <Image Name="BottombarMiddle" XPos="155" YPos="178" Width="70" Height="43" />
      <Image Name="BottombarRight" XPos="225" YPos="178" Width="65" Height="43" />




EDIT: I solved the problem.
Without

Code: Select all

<PropertyDefinition name="ImageColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
<PropertyDefinition name="FrameColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />
<PropertyDefinition name="BackgroundColours" initialValue="tl:FFFFFFFF tr:FFFFFFFF bl:FFFFFFFF br:FFFFFFFF" redrawOnWrite="true" />

It worked.

Return to “Help”

Who is online

Users browsing this forum: Baidu [Spider] and 26 guests