MyGUI layers        

MyGUI 3.0+ description.

MyGUI layers is order of widgets rendering. First layer in list is lowest (i.e. renders behind other layers).

Default config file for layers is core_layer.xml (or MyGUI_Layers.xml for 3.2.0+).

Main properties are:

  • type: layer type, here are built-in types
    • SharedLayer : Simple layer without overlapping. Overlapping widgets may be drawn in incorrect order on it. Whole SharedLayer renders in one batch;
    • OverlappedLayer : When you have overlapping widgets on one layer (for example windows) you should use such layer. Batch per root widget, so if you widgets on layer not intended to overlap each other use SharedLayer;
    • other types: it is also possible to add your own types (see UnitTest_Layers for RTTLayer example).
  • name: layer name identifier used in skins, layouts and in code.
  • properties:
    • Pick boolean: this sets widgets possibility to interact with mouse, if this property set to false mouse pointer will ignore widgets for all cases (so you won't be able to click on Button and so on and you also can click "through" it if there's something behind).
    • other properties: it is also possible to add your own properties (see UnitTest_Layers for RTTLayer layer custom properties).

Here's short example:

<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layer" version="1.2">
	<!-- (Pick false) here's unpickable layer that basically used only for displaying background image and not for any interaction -->
	<Layer type="SharedLayer" name="Wallpaper">
		<Property key="Pick" value="false"/>
	<!-- (type SharedLayer) Main layer - usually used for most GUI items that won't be moved in runtime -->
	<Layer type="SharedLayer" name="Main">
		<Property key="Pick" value="true"/>
	<!-- (type OverlappedLayer) Overlapped layer - usually used for windows, pop-up messages and hints -->
	<Layer type="OverlappedLayer" name="Overlapped">
		<Property key="Pick" value="true"/>
	<!-- (name Pointer, Pick false) Pointer layer - mouse pointer drawn here, don't forget set Pick to false -->
	<Layer type="SharedLayer" name="Pointer">
		<Property key="Pick" value="false"/>

You can change core_layer.xml in any way you want. For example you can add layers, delete any or set pointer on Back skin or anywhere you want :-) If you deleting some layers you should replace them to other in skin and pointer files (if used).

There are few places where they used in default MyGUI_Media:

  • Layer "Pointer" for pointer in core_settings.xml
  • Some widgets skins in core_skin.xml :
    • ItemBox drag'n'drop layer
    • ComboBox dropdown list layer
    • Message layer
    • MenuBar and Popup submenus layer


Contributors to this page: sleo257 points  , jacmoe180265 points  and Beauty14565 points  .
Page last modified on Sunday 11 of September, 2011 10:35:28 UTC by sleo257 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.