MyGUI skin creating

From Ogre Wiki

Jump to: navigation, search

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>
Personal tools
administration