MyGUI skin creating        
Print

Table of contents

Skin format

MyGUI 3.0 skin format description. For skin examples look at Media/MyGUI_Media/core_skin.xml - all default skins described there.

<?xml version="1.0" encoding="UTF-8"?>
 
 <MyGUI type="Resource" version="1.1">
 
 	<Resource type="ResourceSkin" name = "__Skin_name__" size = "__width height__" texture = "__Texture_file_name__" >
 	<!- Size property is default widget size, subskins and child widgets alignment also rely on this size -->
 		<Property key="__Property_name__" value = "__Property_value__" /> 
 		<!- Some widet types have special properties, you can specify them in skin instead setting properties for each widget copy in layout or in code -->
 
 		<Child type="__Widget_type__" skin="__Some_skin_name__" offset = "__left top width height__" align = "__Some_align__" name = "__Child_widget_name__">
 		<!- 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 -->
 			<Property key="__Property_name__" value = "__Property_value__" />
 			<!- Child widgets also may have some properties --> 
 		</Child>
 		<!- Skin may have child widgets, for example Window have buttons on it and each button is child widget -->
 
 		<BasisSkin type="__SubSkin_type__" offset = "__left top width height__" align = "__Some_align__">
 		<!- Offset and align here works same way as for child widgets -->
 			<State name="__state_name__" offset = "__left top width height__"/>
 			<!- Here is defined part of texture for different widget states. ''Offset'' is offset in texture that shown part of it that will be rendered. -->
 		</BasisSkin>
 		<!- ''BasisSkin'' with type ''MainSkin'' or ''SubSkin'' is an actual part of texture that will be rendered.
 			Usually skins contain one part (part of texture stretched over whole widget) - SubSkin_type should be ''MainSkin'',
 				      three parts (left part, stretched central part and right part) - SubSkin_type should be ''SubSkin''
 				      or nine parts (one in center and 8 around) - SubSkin_type should be SubSkin.
 			You may have any amount of ''BasisSkin'' elements one for each texture part.
 		-->
 
 		<BasisSkin type="SimpleText" offset = "__left top width height__" align = "__Some_align__">
 		<!- Offset and align here works same way as for child widgets -->
 			<State name="__state_name__" colour="__R G B or #RRGGBB (hex)__"/>
 			<!- ''SimpleText'' may contain state description, it is optional. If it contain node - default colour will be used for all states. -->
 		</BasisSkin>
 		<!- ''SimpleText'' is place where widget text is placed. Also if this text should be selectable or editable you should use ''EditText'' type instead. >
 	</Resource>
 
 	<!- Lots of other skins here ... -->
 </MyGUI>

 
MainSkin - subskin for whole widget, ignore alignment (works faster)
SubSkin - any size subskin with alignment
SimpleText - simple text with colour (works faster)
EditText - text for editing and selecting

Possible colour values are R G B (colour mask from 0. to 1.) (1. 0. 0. - red) or hex color (#FF0000 - red).

Possible skin_alignment values can be found in align table. Multiply alignment specified with spaces between alignments

align = "HStretch Top"

it is the same as

HStretch  | Top

(binary |) in code.

Possible property_name values can be found in skin properties table. (warning - outdated)

also follow some rules:

  • if skin have one subskin then it must have type "MainSkin" else subskins must have type "SubSkin"
  • if text not intended for editing selecting or copying then it should have type "SimpleText"

 

Pointer format

For pointer examples look at Media/MyGUI_Media/core_pointer.xml

<Resource type="ResourceImageSetPointer" name="__Pointer_name__">
 		<Property key="Point" value="__x y (hto spot position)__"/>
 		<Property key="Size" value="__width height__"/>
 		<Property key="Resource" value="__Image_resource_name(not texture - it is ResourceImageSet defined somewhere in XML)__"/>
 	</Resource>

 


Contributors to this page: jacmoe133512 points  and OgreWikiBot .
Page last modified on Saturday 01 of May, 2010 05:06:02 UTC by jacmoe133512 points .


The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.
As an exception, any source code contributed within the content is released into the Public Domain.