I want "staticimage" to load 2 images and 2 texts:
background // skill image
fontground // effect image
text1 // shortcut key
text2 // level
my .looknfeel:
Code: Select all
<!--
***************************************************
Test/StaticImage
***************************************************
-->
<WidgetLook name="Test/StaticImage">
<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" />
<PropertyDefinition name="VertLabelFormatting" initialValue="BottomAligned" />
<PropertyDefinition name="HorzLabelFormatting" initialValue="RightAligned" />
<PropertyDefinition name="TextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
<PropertyDefinition name="image2" initialValue="" redrawOnWrite="true" />
<ImagerySection name="label">
<TextComponent>
<Area>
<Dim type="LeftEdge"><AbsoluteDim value="-2" /></Dim>
<Dim type="TopEdge"><AbsoluteDim value="-2" /></Dim>
<Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim>
<Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim>
</Area>
<ColourProperty name="TextColour" />
<VertFormatProperty name="VertLabelFormatting" />
<HorzFormatProperty name="HorzLabelFormatting" />
</TextComponent>
</ImagerySection>
<ImagerySection name="image_noframe2">
<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="Image2" />
<ColourRectProperty name="ImageColours" />
<VertFormatProperty name="VertFormatting" />
<HorzFormatProperty name="HorzFormatting" />
</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="Test" image="StaticRight" dimension="Width" />
</DimOperator>
</UnifiedDim>
</Dim>
<Dim type="BottomEdge" >
<UnifiedDim scale="1" type="BottomEdge">
<DimOperator op="Subtract">
<ImageDim imageset="Test" 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>
<ImageProperty name="Image" />
<ColourRectProperty name="ImageColours" />
<VertFormatProperty name="VertFormatting" />
<HorzFormatProperty name="HorzFormatting" />
</ImageryComponent>
</ImagerySection>
<StateImagery name="Enabled" />
<StateImagery name="Disabled" />
<StateImagery name="EnabledFrame">
<Layer>
<Section look="Test/StaticShared" section="frame" />
</Layer>
</StateImagery>
<StateImagery name="DisabledFrame">
<Layer>
<Section look="Test/StaticShared" section="frame" />
</Layer>
</StateImagery>
<StateImagery name="WithFrameEnabledBackground">
<Layer>
<Section look="Test/StaticShared" section="background" />
</Layer>
</StateImagery>
<StateImagery name="WithFrameDisabledBackground">
<Layer>
<Section look="Test/StaticShared" section="background" />
</Layer>
</StateImagery>
<StateImagery name="NoFrameEnabledBackground">
<Layer>
<Section look="Test/StaticShared" section="background_noframe" />
</Layer>
</StateImagery>
<StateImagery name="NoFrameDisabledBackground">
<Layer>
<Section look="Test/StaticShared" section="background_noframe" />
</Layer>
</StateImagery>
<StateImagery name="WithFrameImage">
<Layer>
<Section section="image_withframe" />
<Section section="label" />
</Layer>
</StateImagery>
<StateImagery name="NoFrameImage">
<Layer>
<Section section="image_noframe" />
<Section section="image_noframe2" />
<Section section="label" />
</Layer>
</StateImagery>
</WidgetLook>
my imageset:
Code: Select all
<?xml version="1.0" ?>
<Imageset Name="Test" Imagefile="Test.tga" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true">
.......
<Image Name="Goods" XPos="61" YPos="192" Width="31" Height="31" />
<Image Name="Goods2" XPos="100" YPos="192" Width="31" Height="31" />
</Imageset>
my code:
Code: Select all
CEGUI::Window *goods = winMgr.createWindow((CEGUI::utf8*)"Test/StaticImage","goods");
goods->setPosition(CEGUI::UVector2(CEGUI::UDim(0.5f,0), CEGUI::UDim(0.5f,0)));
goods->setSize(CEGUI::UVector2(CEGUI::UDim(0.0f,31), CEGUI::UDim(0.0f,31)));
goods->setProperty("FrameEnabled","false");
goods->setProperty("BackgroundEnabled","false");
CEGUI::Imageset* imgset = CEGUI::ImagesetManager::getSingleton().getImageset((CEGUI::utf8*)"Test");
goods->setProperty("Image", CEGUI::PropertyHelper::imageToString(&imgset->getImage((CEGUI::utf8*)"Goods")));
goods->setProperty("Image2", CEGUI::PropertyHelper::imageToString(&imgset->getImage((CEGUI::utf8*)"Goods2")));
goods->setText("123");
At first,I think it is easy to realize 2 texts.But I fail to do it.
Because I cannot find where to set the text by the name of text.
So I only realize 1 text .
Then, I also want to realize 2 images.The same question appears.
And the error is occur at "Image2".
It seems that "staticimage" accepts only 1 image and 1 text.
At last, I have to appeal the forum.
I want to konw whether "staticimage" can realize what I say or not.
Sorry my English.