I’ve finished the framework for XML defined UI layouts ( with plug in defined controls)

Simple UI defined by XML This UI item was loaded from the XML following the break. The various control types are defined in code, but are set up to be loaded from external sources (.net plug-ins and/or scripting languages that get bound). This will allow the entire UI layout to be changed with out modifying the base code.

The system supports static and dynamic values, getting UI values from a Global Value Cache that will be kept updated as values change. This makes it simple for UI components to use game data for display with out knowing the exact data layout.


<?xml version=”1.0″?>
<ElementDefinition xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>
<Name>SampleFrame</Name>
<ValueName />
<Position>
<X>100</X>
<Y>200</Y>
</Position>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<BackgroundColor>White</BackgroundColor>
<ForegroundColor>Black</ForegroundColor>
<Children>
<ElementDefinition>
<Name>Frame</Name>
<ValueName />
<Position>
<X>0</X>
<Y>0</Y>
</Position>
<Size>
<Width>320</Width>
<Height>284</Height>
</Size>
<BackgroundColor>White</BackgroundColor>
<ForegroundColor>Black</ForegroundColor>
<Children>
<ElementDefinition>
<Name>GroupBox</Name>
<ValueName>Group</ValueName>
<Position>
<X>10</X>
<Y>10</Y>
</Position>
<Size>
<Width>300</Width>
<Height>150</Height>
</Size>
<BackgroundColor>White</BackgroundColor>
<ForegroundColor>Black</ForegroundColor>
<Children>
<ElementDefinition>
<Name>Label</Name>
<ValueName>Frame Time</ValueName>
<Position>
<X>5</X>
<Y>5</Y>
</Position>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<BackgroundColor>White</BackgroundColor>
<ForegroundColor>Black</ForegroundColor>
<Children />
<Options />
</ElementDefinition>
<ElementDefinition>
<Name>ValueLabel</Name>
<ValueName>DynamicVal</ValueName>
<Position>
<X>100</X>
<Y>5</Y>
</Position>
<Size>
<Width>0</Width>
<Height>0</Height>
</Size>
<BackgroundColor>White</BackgroundColor>
<ForegroundColor>Black</ForegroundColor>
<Children />
<Options />
</ElementDefinition>
<ElementDefinition>
<Name>Picture</Name>
<ValueName />
<Position>
<X>5</X>
<Y>25</Y>
</Position>
<Size>
<Width>128</Width>
<Height>128</Height>
</Size>
<BackgroundColor>White</BackgroundColor>
<ForegroundColor>Black</ForegroundColor>
<Children />
<Options>
<OptionValue>
<Name>Image</Name>
<Value>kspaceduel.png</Value>
</OptionValue>
<OptionValue>
<Name>ClampImage</Name>
<Value>False</Value>
</OptionValue>
</Options>
</ElementDefinition>
</Children>
<Options />
</ElementDefinition>
</Children>
<Options>
<OptionValue>
<Name>BackgroundTexture</Name>
<Value>brushed.png</Value>
</OptionValue>
<OptionValue>
<Name>RepeatTexture</Name>
<Value>True</Value>
</OptionValue>
</Options>
</ElementDefinition>
</Children>
<Options />
</ElementDefinition>