How to add text on imagebutton or image?
Posted: Thu Feb 19, 2009 05:48
How to add text on imagebutton or image?
Can they be added two layers of text ?How?
Thanks !
Can they be added two layers of text ?How?
Thanks !
The official forum for CEGUI
http://cegui.org.uk/forum/
Code: Select all
<ImagerySection name="text1">
<TextComponent>
<Area>
....
</Area>
<VertFormat type="TopAligned" />
<HorzFormat type="WordWrapCentreAligned" />
</TextComponent>
</ImagerySection>
<ImagerySection name="text2">
<TextComponent>
<Area>
....
</Area>
<VertFormat type="TopAligned" />
<HorzFormat type="WordWrapCentreAligned" />
</TextComponent>
</ImagerySection>
<StateImagery name="Normal">
<Layer>
<Section section="text1" />
<Section section="text2" />
....
</Layer>
</StateImagery>
Code: Select all
<ImagerySection name="text1">
<TextComponent>
<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" >
<DimOperator op="Multiply">
<AbsoluteDim value="0.5" />
</DimOperator>
</UnifiedDim>
</Dim>
</Area>
<VertFormat type="CentreAligned" />
<HorzFormat type="WordWrapCentreAligned" />
</TextComponent>
</ImagerySection>
<ImagerySection name="text2">
<TextComponent>
<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>
<VertFormat type="CentreAligned" />
<HorzFormat type="WordWrapCentreAligned" />
</TextComponent>
</ImagerySection>
Code: Select all
<StateImagery name="Normal">
<Layer>
<Section look="WindowsLook/Button" section="normal" />
<Section section="icon" />
<Section section="text1">
<Colours topLeft="FFFFFFFF" topRight="FFFFFFFF" bottomLeft="FFFFFFFF" bottomRight="FFFFFFFF" />
</Section>
<Section section="text2">
<Colours topLeft="FFFF0000" topRight="FFFF0000" bottomLeft="FFFF0000" bottomRight="FFFF0000" />
</Section>
</Layer>
</StateImagery>
Code: Select all
<PropertyDefinition name="Text2" redrawOnWrite="true" />
Code: Select all
<ImagerySection name="text2">
<TextComponent>
<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>
<TextProperty name="Text2" />
<VertFormat type="CentreAligned" />
<HorzFormat type="WordWrapCentreAligned" />
</TextComponent>
</ImagerySection>
Code: Select all
<ImagerySection name="text1">
<TextComponent>
<Area>
<Dim type="LeftEdge">
<AbsoluteDim value="1"/>
</Dim>
<Dim type="TopEdge">
<AbsoluteDim value="1"/>
</Dim>
<Dim type="Width">
<UnifiedDim scale="2" type="Width"/>
</Dim>
<Dim type="Height">
<UnifiedDim scale="2" type="Height"/>
</Dim>
</Area>
<VertFormat type="TopAligned"/>
<HorzFormat type="WordWrapLeftAligned"/>
</TextComponent>
Code: Select all
<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>
Code: Select all
<PropertyDefinition name="VertLabelFormatting" initialValue="CentreAligned" />
<PropertyDefinition name="HorzLabelFormatting" initialValue="CentreAligned" />
<PropertyDefinition name="TextShadowColour" initialValue="FF000000" redrawOnWrite="true" />
<PropertyDefinition name="TextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
Code: Select all
<ImagerySection name="label">
<TextComponent>
<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>
<ColourProperty name="TextShadowColour" />
<VertFormatProperty name="VertLabelFormatting" />
<HorzFormatProperty name="HorzLabelFormatting" />
</TextComponent>
<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>
Code: Select all
<StateImagery name="Normal">
<Layer>
<Section section="normal" />
<Section section="label" />
</Layer>
</StateImagery>