For those interested in complex skinning (you out there, Weavus?), I'm starting this thread to discuss the best way to do the complex skinning. Currently, my design will also allow the source code to be used for other projects as well.
Anyway, here's what I've put down so far:
Notes on Complex Skinning:
XMl files will define two primary things:
Resources and Layouts.
Resources are those items which can be used globally in the skin, and are defined exactly once.
Once Images are defined, they can be used anywhere images are defined in layouts, in use as masks,
backgrounds, etc.
Resources:
Fonts
Defined by an XPR file.
Images
Any image file
Layouts will consist of images, text, and special fields.
Images will have several attributes, including Mask Image, AlphaEnable, and AlphaColor. Sources can
include fixed (skin directory based), local (such as screenshots), and generated.
I plan on creating a fairly generic skin renderer, which could be used on other things as
well (such as a media player, dashboard, or game interface).
Fonts and masks must be defined as resources.
Here's an example of a partial skin definition xml file:
QUOTE |
<Skin> <Resources> <Font Name="Font16"> <File>Font16.xpr</File> </Font> <Image Name="ShotMask"> <File>Mask1.jpg</File> </Image> </Resources> <Layouts> <Layout Name="Menu"> <LayoutElement Type=Image> <Source>Fixed</Source> <File>MenuBack.jpg</File> </LayoutElement> <LayoutElement Type=Image> <Source>Local</Source> <Tag>CoverShot</Tag> <AutoBasename>MXM_COVER</AutoBasename> <Location>40,50</Location> <Size>200,300</Size> </LayoutElement> <LayoutElement Type=Image> <Source>Local</Source> <Tag>ScreenShot1</Tag> <AutoBasename>MXM_SS1</AutoBasename> <Location>240,250</Location> <Size>64,64</Size> <Mask>ShotMask</Mask> </LayoutElement> <LayoutElement Type=Image> <Source>Local</Source> <Tag>ScreenShot2</Tag> <AutoBasename>MXM_SS2</AutoBasename> <Location>340,250</Location> <Size>64,64</Size> <Mask>ShotMask</Mask> </LayoutElement> <LayoutElement Type=TextBox> <Source>Local</Source> <Tag>LongDescr</Tag> <Location>240,50</Location> <Size>200,175</Size> <Justify>Center</Justify> <Font>Font16</Font> <Color>0xffffffff</Color> <Shadow>0x80000000</Shadow> </LayoutElement Type=MenuChoice> <Font>Font16</Font> <Location>100,350</Location> <Size>450,50</Size> <Resize>KeepAspect</Resize> <NumChoices>1</NumChoices> <Orientation>LeftRight</Orientation> <Color>0xffffffff</Color> <Shadow>0x80000000</Shadow> <LayoutElement Type=MenuArrowLeft> <Location>50,350</Location> <Size>50,50</Size> <Color>0xffffffff</Color> <Shadow>0x80000000</Shadow> </LayoutElement> <LayoutElement Type=MenuArrowRight> <Location>500,350</Location> <Size>50,50</Size> <Color>0xffffffff</Color> <Shadow>0x80000000</Shadow> </LayoutElement> </Layout> </Layouts>
|
From a programming standpoint, "special things" like menus will be handled by the application through an inherited class or via registered callbacks. The skin class will handle resource management, up to a point.
Technically, as I've envisioned it, you'd even be able to use video files as masks, and other, more complex interactions may also be utilized (bumpmapping, for example) for cool visual effects.
At any rate, there will be a new release tonight, alas, without the complex skinning yet.