Create window skin - XML attributes

mrmclovin

31-01-2010 15:40:35

Hello!

Im trying to get my custom window skin working but I have trouble to understand the XML description.

<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin">
<Skin name = "Skin_name" size = "width height (size in texture in pixels)" material = "your_material_name" >

<Child type="any_widget_type" skin="any_skin" offset = "left top width height (offset in widget in pixels)" align = "child_skin_alignment [another_alignment]" name = "element_name">
</Child>

<BasisSkin type="SubSkin" offset = "left top width height (offset in widget in pixels)" align = "skin_element_alignment [another_alignment]">
<State name="state_name" offset = "left top width height (texture offset in pixels)"/>
[you can have many states]
</BasisSkin>

<BasisSkin type="TextSimple" offset = "left top width height (offset in widget in pixels)" align = "child_skin_alignment [another_alignment]">
<State name="state_name" colour="colour"/>
</BasisSkin>

</Skin>
</MyGUI>


First of all, is the Skin element outdated? in my media files it's structured like this:
<MyGUI type="Resource" version="1.1">
<Resource type="ResourceSkin" name = "myskin" size = "76 78" texture = "skin.png">


Second Im confused about the notions in the XML files. Can you ellaborate the descriptions a little more than you do on the wiki!?
<Skin name = "Skin_name" size = "width height (size in texture in pixels)" material = "your_material_name" >
width height (size in texture in pixels) ?? Do you mean width/height Of texture-file?

<BasisSkin type="SubSkin" offset = "left top width height (offset in widget in pixels)" align = "skin_element_alignment [another_alignment]">
Is the offset depended on alignment? If I set align="Right Bottom" and offset="2 5 4 4" it means 2px from Right edge and 5px from bottom edge? Am I correct? If not, can you give a description of what align is?

Altren

31-01-2010 20:24:12

First of all, is the Skin element outdated?Here's first line from page that you quoted hereWarning: very old page, skin format was changed in MyGUI 3.0 (old skins still supported, but better use new format)

I'm going to rewrite that page now, so wait a bit.

Altren

31-01-2010 21:23:28

Done. Now please ask what it still not clear.

mrmclovin

04-02-2010 18:17:38

Offset and align is properties of child widget inside skin, they works exactly as position and align in layout files and in code when you creating widgets
That's a very un-descriptive explaination :)
What does Align do when I set an absolute offset? If I set an offset it means that it will be place right there? Can you give a more elaborated explaination of the align?

Size property is default widget size, subskins and child widgets alignment also rely on this size
But how about re-sizeable widgets. What inpact has the "default" size of widget then?

In my case Im making a (re-sizeable) window. How does this change the absolute offsets?

Somehow I managed to do my resizeable window, but I still don't know how I did it and what some numbers mean... It's important that you give som basic and advanced examples. It'll make skin production more productive!

I give you this picture (attachment) representing a blueprint of two widgets. One is a resizeable window and the other is a transparent Panel skin with a bottom border/text only. The bottom border should always be att the bottom no matter the size of the widget. Can you write a tutorial of how you would've set up the XML for these two widgets and post it on the forum. I will then arrange it to be published on the Wiki!