Discussion:
What Are Skins?
(too old to reply)
Steve
2007-08-16 19:39:26 UTC
Permalink
Please excuse my ignorance of the basics of MP. What are skins?

Thanks!

Steve
Bizzare
2007-09-07 12:18:16 UTC
Permalink
Post by Steve
Please excuse my ignorance of the basics of MP. What are skins?
Thanks!
Steve
Yo Steve!

Yes, good question. I have included a section out of my WMP skinning
guide (not finished, or published anywhere yet) that might help. Let
me know if it does!

Cheers


Biz

----------------------------------------
WMP Skins

WMP skins are, at a basic level, very easy to create. Usually they are
a combination of graphics and code; but it is actually possible to
create a WMP skin with very little coding knowledge and no graphics
whatsoever! Naturally it would look a little, err... plain and boring,
and it won't have very exciting features; but it would get the job
done. We'll see an example of a text-only skin later.

What is a Skin?

A WMP skin is actually a collection of one or more files (if you can
have a collection of just one!) parcelled up in a zip file. Typically
there are 3 different types of file that make up a skin:

Skin definition file - a text file that defines all the different
parts of the skin
Javascript file(s) - one or more text file(s) that contain script code
to actually do stuff
Graphics file(s) - these make up how the skin actually looks
Let's have a closer look...

Skin Definition File

This is a plain text file, written in a special way using tags, like
HTML. Actually, to be precise it's an XML file and as such the way you
write it has to obey XML document rules, e.g. it needs to be well-
formed. More about this later.

The Skin Definition File (SDF) is the core of your skin. You have to
have one to have a skin - just having a bunch of graphics won't do,
and the SDF file has to have the extension .wms otherwise WMP won't
recognise it.

So what is the SDF for? It lists all the elements that make up your
skin. Elements are things like views, subviews, buttons, sliders, bits
of text, graphics, visualisations, video etc. All possible elements
are listed in the SDK, so this is the place to look them up. Each
element is defined in a tag, and can have one or more properties or
attributes like backgroundColor. Some elements can have other elements
nested inside them, like the theme element - in the example below it
has the view element contained inside it.

Here's a short SDF:

<theme title="Texty">
<view id="mainView" width="300" height="300" backgroundColor="#00FF00"
title="Texty - The Text-only WMP Skin!" titleBar="True">
<text value="Hello World" />
</view>
</theme>

The < and > brackets make element tags, with the first word defining
the element type. Each tag has to be closed in some way in order to
make the SDF XML well-formed.
What this means is for each element tag <element...> you either have a
closing tag e.g. </element> or you close the element tag using a
backslash at the end e.g. <element... />. For elements that contain
other elements you would use a closing tag (because you need a start
and an end point), otherwise it's shorter and neater to close the tag
at the end.
So <theme...> is the opening tag for a theme element and </theme> is
it's closing tag, and it contains a view element, which in turn
contains a text element. The text element doesn't (and actually can't)
contain anything, so it's tag is closed using .../>

This is pretty much the bare minimum you can write to make a WMP skin.
All WMP skins need a theme and at least one view element defined in
the SDF, otherwise they won't work. Beyond that there is no limit -
you can create as many views and put as many buttons, sliders, etc. as
you like. If you need to know more about XML, tags, elements, well-
formedness and other related stuff, there are lots of sites on the
subject so have a Google.

You can try this SDF out. Copy the text, open notepad, paste the text
into the blank file and save it as texty.txt. Then use the windows
explorer to change the extension from .txt to .wms and finally double-
click the file and it will open in WMP...

Voila! It's a WMP skin!
Mind you, it doesn't do much - it's just a big green rectangle with
the words Hello World and a menu bar - but that's because there is
virtually nothing defined in the SDF, like I said, just the bare
minimum.
----------------------------------------

Loading...