Code: Select all
<WidgetLook name="TFLook/Button" >
<Property Name="Font" Value="Arial-30" />
<Property Name="Alpha" Value="0.5" />
<ImagerySection name="normal_imagery">
. . .
Then an instance of the button in a layout file:
Code: Select all
<Window Type="TFLook/WindowWith4Blocks" Name="MainMenu">
. . .
<Window Type="TFLook/Button" Name="MainMenu/StartBtn">
<Property Name="Text" Value="start" />
<!-- <Property Name="Font" Value="Arial-30" /> -->
<!-- <Property Name="Alpha" Value="0.5" /> -->
<Property Name="UnifiedPosition" Value="{{0,96},{0,0}}" />
<Property Name="UnifiedSize" Value="{{0,200},{0,113}}" />
</Window>
But the button ends up using the CEGUI::System-wide default-font instead of the one set in the looknfeel. Uncommenting the "<!-- <Property Name="Font" . . ." in the layout file is the only way I can get it to work. Same with the "Alpha" property.
Here is my full scheme file:
Code: Select all
<?xml version="1.0" ?>
<!--
Copyright (c)2009-2010, Voxoid LLC. All Rights Reserved.
-->
<GUIScheme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="xsd/GUIScheme.xsd"
Name="TFLook">
<Imageset Name="TFLook" Filename="TFLook.imageset" />
<Font Name="Arial-18" Filename="arial-18.font" />
<Font Name="Arial-22" Filename="arial-22.font" />
<Font Name="Arial-30" Filename="arial-30.font" />
<Font Name="Arial-52" Filename="arial-52.font" />
<LookNFeel Filename="TFWindow.looknfeel" />
<LookNFeel Filename="TFButton.looknfeel" />
<!-- <LookNFeel Filename="TFTitle.looknfeel" /> -->
<WindowRendererSet Filename="CEGUIFalagardWRBase" />
<FalagardMapping
WindowType="TFLook/Window"
TargetType="CEGUI/FrameWindow"
Renderer="Falagard/FrameWindow"
LookNFeel="TFLook/Window" />
<FalagardMapping
WindowType="TFLook/WindowWith4Blocks"
TargetType="CEGUI/FrameWindow"
Renderer="Falagard/FrameWindow"
LookNFeel="TFLook/WindowWith4Blocks" />
<FalagardMapping
WindowType="TFLook/Titlebar"
TargetType="CEGUI/Titlebar"
Renderer="Falagard/Titlebar"
LookNFeel="TFLook/Titlebar" />
<FalagardMapping
WindowType="TFLook/Button"
TargetType="CEGUI/PushButton"
Renderer="Falagard/Button"
LookNFeel="TFLook/Button" />
<FalagardMapping
WindowType="TFLook/HelpButton"
TargetType="CEGUI/PushButton"
Renderer="Falagard/Button"
LookNFeel="TFLook/HelpButton" />
<FalagardMapping
WindowType="TFLook/ExitButton"
TargetType="CEGUI/PushButton"
Renderer="Falagard/Button"
LookNFeel="TFLook/ExitButton" />
</GUIScheme>
Layout file:
Code: Select all
<?xml version="1.0" ?>
<GUILayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="xsd/GUILayout.xsd" >
<Window Type="DefaultGUISheet" Name="root">
<Window Type="TFLook/WindowWith4Blocks" Name="MainMenu">
<Property Name="Text" Value="menu" />
<Property Name="AlwaysOnTop" Value="True" />
<Property Name="VerticalAlignment" Value="Bottom" />
<Property Name="HorizontalAlignment" Value="Centre" />
<Property Name="UnifiedPosition" Value="{{0,0},{0,300}}" />
<Property Name="UnifiedSize" Value="{{0,741},{0,429}}" />
<!-- <Property Name="TitleImage" Value="set:TFLook image:ttlMainMenu" /> -->
<Window Type="TFLook/Button" Name="MainMenu/StartBtn">
<Property Name="Text" Value="start" />
<!-- <Property Name="Font" Value="Arial-30" /> -->
<Property Name="Alpha" Value="0.5" />
<Property Name="UnifiedPosition" Value="{{0,96},{0,0}}" />
<Property Name="UnifiedSize" Value="{{0,200},{0,113}}" />
</Window>
<Window Type="TFLook/Button" Name="MainMenu/OptionsBtn">
<Property Name="Text" Value="options" />
<Property Name="Font" Value="Arial-30" />
<Property Name="HorizontalAlignment" Value="Centre" />
<Property Name="UnifiedPosition" Value="{{0,0},{0,0}}" />
<Property Name="UnifiedSize" Value="{{0,200},{0,113}}" />
</Window>
<Window Type="TFLook/Button" Name="MainMenu/HighScoresBtn">
<Property Name="Text" Value="high scores" />
<Property Name="Font" Value="Arial-30" />
<Property Name="HorizontalAlignment" Value="Right" />
<Property Name="UnifiedPosition" Value="{{0,-96},{0,0}}" />
<Property Name="UnifiedSize" Value="{{0,200},{0,113}}" />
</Window>
<Window Type="TFLook/HelpButton" Name="MainMenu/HelpBtn">
<Property Name="Text" Value="?" />
<Property Name="Font" Value="Arial-22" />
<Property Name="HorizontalAlignment" Value="Left" />
<Property Name="UnifiedPosition" Value="{{0,176},{0,80}" />
<Property Name="UnifiedSize" Value="{{0,50},{0,78}}" />
</Window>
<Window Type="TFLook/ExitButton" Name="MainMenu/ExitBtn">
<Property Name="Text" Value="exit" />
<Property Name="Font" Value="Arial-22" />
<Property Name="HorizontalAlignment" Value="Right" />
<Property Name="UnifiedPosition" Value="{{0,-167},{0,80}" />
<Property Name="UnifiedSize" Value="{{0,68},{0,78}}" />
</Window>
</Window>
</Window>
</GUILayout>
And button looknfeel file:
Code: Select all
<?xml version="1.0" ?>
<!--
Copyright (c)2009-2010, Voxoid LLC. All Rights Reserved.
-->
<Falagard xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="xsd/Falagard.xsd">
<WidgetLook name="TFLook/Button" >
<Property Name="Font" Value="Arial-30" />
<Property Name="Alpha" Value="0.5" />
<ImagerySection name="normal_imagery">
<!-- left -->
<ImageryComponent>
<Area>
<Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="Width">
<ImageDim
imageset="TFLook"
image="btnNormalLeft"
dimension="Width" />
</Dim>
<Dim type="Height"><UnifiedDim scale="1.0" type="Height" /></Dim>
</Area>
<Image imageset="TFLook" image="btnNormalLeft" />
<VertFormat type="CentreAligned" />
</ImageryComponent>
<!-- right -->
<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>
<Image imageset="TFLook" image="btnNormalRight" />
<VertFormat type="CentreAligned" />
<HorzFormat type="RightAligned" />
</ImageryComponent>
<!-- middle -->
<ImageryComponent>
<Area>
<Dim type="LeftEdge">
<ImageDim
imageset="TFLook"
image="btnNormalLeft"
dimension="Width" />
</Dim>
<Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="RightEdge">
<UnifiedDim scale="1" type="Width">
<DimOperator op="Subtract">
<ImageDim
imageset="TFLook"
image="btnNormalRight"
dimension="Width"
/>
</DimOperator>
</UnifiedDim>
</Dim>
<Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim>
</Area>
<Image imageset="TFLook" image="btnNormalMiddle" />
<VertFormat type="CentreAligned" />
<HorzFormat type="Stretched" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="hover_imagery">
<ImageryComponent>
<Area>
<Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="Width">
<ImageDim
imageset="TFLook"
image="btnHoveredLeft"
dimension="Width" />
</Dim>
<Dim type="Height"><UnifiedDim scale="1.0" type="Height" /></Dim>
</Area>
<Image imageset="TFLook" image="btnHoveredLeft" />
<VertFormat type="CentreAligned" />
</ImageryComponent>
<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>
<Image imageset="TFLook" image="btnHoveredRight" />
<VertFormat type="CentreAligned" />
<HorzFormat type="RightAligned" />
</ImageryComponent>
<ImageryComponent>
<Area>
<Dim type="LeftEdge">
<ImageDim
imageset="TFLook"
image="btnHoveredLeft"
dimension="Width" />
</Dim>
<Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="RightEdge">
<UnifiedDim scale="1" type="Width">
<DimOperator op="Subtract">
<ImageDim
imageset="TFLook"
image="btnHoveredRight"
dimension="Width"
/>
</DimOperator>
</UnifiedDim>
</Dim>
<Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim>
</Area>
<Image imageset="TFLook" image="btnHoveredMiddle" />
<VertFormat type="CentreAligned" />
<HorzFormat type="Stretched" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="pushed_imagery">
<ImageryComponent>
<Area>
<Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="Width">
<ImageDim
imageset="TFLook"
image="btnClickedLeft"
dimension="Width" />
</Dim>
<Dim type="Height"><UnifiedDim scale="1.0" type="Height" /></Dim>
</Area>
<Image imageset="TFLook" image="btnClickedLeft" />
<VertFormat type="CentreAligned" />
</ImageryComponent>
<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>
<Image imageset="TFLook" image="btnClickedRight" />
<VertFormat type="CentreAligned" />
<HorzFormat type="RightAligned" />
</ImageryComponent>
<ImageryComponent>
<Area>
<Dim type="LeftEdge">
<ImageDim
imageset="TFLook"
image="btnClickedLeft"
dimension="Width" />
</Dim>
<Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="RightEdge">
<UnifiedDim scale="1" type="Width">
<DimOperator op="Subtract">
<ImageDim
imageset="TFLook"
image="btnClickedRight"
dimension="Width"
/>
</DimOperator>
</UnifiedDim>
</Dim>
<Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim>
</Area>
<Image imageset="TFLook" image="btnClickedMiddle" />
<VertFormat type="CentreAligned" />
<HorzFormat type="Stretched" />
</ImageryComponent>
</ImagerySection>
<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>
<VertFormat type="CentreAligned" />
<HorzFormat type="WordWrapCentreAligned" />
</TextComponent>
</ImagerySection>
<StateImagery name="Normal">
<Layer>
<Section section="normal_imagery" />
<Section section="label" />
</Layer>
</StateImagery>
<StateImagery name="Hover">
<Layer>
<Section section="hover_imagery" />
<Section section="label" />
</Layer>
</StateImagery>
<StateImagery name="Pushed">
<Layer>
<Section section="pushed_imagery" />
<Section section="label" />
</Layer>
</StateImagery>
<StateImagery name="Disabled">
<Layer>
<Section section="normal_imagery">
<Colours
topLeft="FF7F7F7F"
topRight="FF7F7F7F"
bottomLeft="FF7F7F7F"
bottomRight="FF7F7F7F" />
</Section>
<Section section="label">
<Colours
topLeft="FF7F7F7F"
topRight="FF7F7F7F"
bottomLeft="FF7F7F7F"
bottomRight="FF7F7F7F"
/>
</Section>
</Layer>
</StateImagery>
</WidgetLook>
<!-- ************************************************************************************************* -->
<WidgetLook name="TFLook/HelpButton">
<Property Name="Font" Value="Arial-22" />
<PropertyDefinition name="VertLabelFormatting" initialValue="CentreAligned" />
<PropertyDefinition name="HorzLabelFormatting" initialValue="CentreAligned" />
<PropertyDefinition name="NormalImage" initialValue="" redrawOnWrite="true" />
<PropertyDefinition name="HoverImage" initialValue="" redrawOnWrite="true" />
<PropertyDefinition name="PushedImage" initialValue="" redrawOnWrite="true" />
<PropertyDefinition name="DisabledImage" initialValue="" redrawOnWrite="true" />
<PropertyDefinition name="VertImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
<PropertyDefinition name="HorzImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
<ImagerySection name="normal">
<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>
<Image imageset="TFLook" image="btnHelpNormal" />
<VertFormatProperty name="VertImageFormatting" />
<HorzFormatProperty name="HorzImageFormatting" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="hover">
<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>
<Image imageset="TFLook" image="btnHelpHovered" />
<VertFormatProperty name="VertImageFormatting" />
<HorzFormatProperty name="HorzImageFormatting" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="pushed">
<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>
<Image imageset="TFLook" image="btnHelpClicked" />
<VertFormatProperty name="VertImageFormatting" />
<HorzFormatProperty name="HorzImageFormatting" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="label">
<TextComponent>
<Area>
<Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge"><AbsoluteDim value="8" /></Dim>
<Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim>
<Dim type="Height"><AbsoluteDim value="20" /></Dim>
</Area>
<VertFormat type="TopAligned" />
<HorzFormat type="WordWrapCentreAligned" />
</TextComponent>
</ImagerySection>
<StateImagery name="Normal">
<Layer>
<Section section="normal" />
<Section section="label" />
</Layer>
</StateImagery>
<StateImagery name="Hover">
<Layer>
<Section section="hover" />
<Section section="label" />
</Layer>
</StateImagery>
<StateImagery name="Pushed">
<Layer>
<Section section="pushed" />
<Section section="label" />
</Layer>
</StateImagery>
<StateImagery name="PushedOff">
<Layer>
<Section section="hover" />
<Section section="label" />
</Layer>
</StateImagery>
<StateImagery name="Disabled">
<Layer>
<Section section="normal">
<Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
</Section>
<Section section="label">
<Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
</Section>
</Layer>
</StateImagery>
</WidgetLook>
<!-- ************************************************************************************************* -->
<WidgetLook name="TFLook/ExitButton">
<Property Name="Font" Value="Arial-22" />
<PropertyDefinition name="VertLabelFormatting" initialValue="CentreAligned" />
<PropertyDefinition name="HorzLabelFormatting" initialValue="CentreAligned" />
<PropertyDefinition name="NormalImage" initialValue="" redrawOnWrite="true" />
<PropertyDefinition name="HoverImage" initialValue="" redrawOnWrite="true" />
<PropertyDefinition name="PushedImage" initialValue="" redrawOnWrite="true" />
<PropertyDefinition name="DisabledImage" initialValue="" redrawOnWrite="true" />
<PropertyDefinition name="VertImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
<PropertyDefinition name="HorzImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
<ImagerySection name="normal">
<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>
<Image imageset="TFLook" image="btnExitNormal" />
<VertFormatProperty name="VertImageFormatting" />
<HorzFormatProperty name="HorzImageFormatting" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="hover">
<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>
<Image imageset="TFLook" image="btnExitHovered" />
<VertFormatProperty name="VertImageFormatting" />
<HorzFormatProperty name="HorzImageFormatting" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="pushed">
<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>
<Image imageset="TFLook" image="btnExitClicked" />
<VertFormatProperty name="VertImageFormatting" />
<HorzFormatProperty name="HorzImageFormatting" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="label">
<TextComponent>
<Area>
<Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge"><AbsoluteDim value="8" /></Dim>
<Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim>
<Dim type="Height"><AbsoluteDim value="20" /></Dim>
</Area>
<VertFormat type="TopAligned" />
<HorzFormat type="WordWrapCentreAligned" />
</TextComponent>
</ImagerySection>
<StateImagery name="Normal">
<Layer>
<Section section="normal" />
<Section section="label" />
</Layer>
</StateImagery>
<StateImagery name="Hover">
<Layer>
<Section section="hover" />
<Section section="label" />
</Layer>
</StateImagery>
<StateImagery name="Pushed">
<Layer>
<Section section="pushed" />
<Section section="label" />
</Layer>
</StateImagery>
<StateImagery name="PushedOff">
<Layer>
<Section section="hover" />
<Section section="label" />
</Layer>
</StateImagery>
<StateImagery name="Disabled">
<Layer>
<Section section="normal">
<Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
</Section>
<Section section="label">
<Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" />
</Section>
</Layer>
</StateImagery>
</WidgetLook>
</Falagard>