Marko Pintera před 10 roky
rodič
revize
57cc31e562

+ 2 - 1
BansheeEngine/Include/BsGUILayoutUtility.h

@@ -14,7 +14,8 @@ namespace BansheeEngine
 	{
 	public:
 		/**
-		 * Calculates optimal size of a GUI element.
+		 * Calculates optimal size of a GUI element. This is the size that allows the GUI element to properly display all of
+		 * its content.
 		 */
 		static Vector2I calcOptimalSize(const GUIElementBase* elem);
 

+ 8 - 7
BansheeEngine/Include/BsGUIOptions.h

@@ -5,8 +5,9 @@
 namespace BansheeEngine
 {
 	/**
-	 * @brief	Controls GUI element properties, possibly by overriding
-	 *			the default properties specified in GUI element style.
+	 * @brief	Controls GUI element layout options, possibly by overriding
+	 *			the default options specified in GUI element style. These options
+	 *			control GUI element placement and size in a GUI layout.
 	 */
 	class BS_EXPORT GUIOption
 	{
@@ -28,32 +29,32 @@ namespace BansheeEngine
 		/**
 		 * @brief	Constructs a GUI option notifying the GUI layout that this element should be positioned
 		 *			at this offset from the parent GUI panel. This option is ignored if element is part of a 
-		 layout since it controls its placement.
+		 *			layout since it controls its placement.
 		 */
 		static GUIOption position(INT32 x, INT32 y);
 
 		/**
 		 * @brief	Constructs a GUI option notifying the GUI layout that this element has a fixed width.
-		 *			This will override width property set in element style.
+		 *			This will override the width property set in element style.
 		 */
 		static GUIOption fixedWidth(UINT32 value);
 
 		/**
 		 * @brief	Constructs a GUI option notifying the GUI layout that this element has a flexible width with
-		 *			optional min/max constraints (value of 0 means no constraint). This will override width property 
+		 *			optional min/max constraints (value of 0 means no constraint). This will override the width property 
 		 *			set in element style.
 		 */
 		static GUIOption flexibleWidth(UINT32 min = 0, UINT32 max = 0);
 
 		/**
 		 * @brief	Constructs a GUI option notifying the GUI layout that this element has a fixed height.
-		 *			This will override height property set in element style.
+		 *			This will override the height property set in element style.
 		 */
 		static GUIOption fixedHeight(UINT32 value);
 
 		/**
 		 * @brief	Constructs a GUI option notifying the GUI layout that this element has a flexible height with
-		 *			optional min/max constraints (value of 0 means no constraint). This will override height property 
+		 *			optional min/max constraints (value of 0 means no constraint). This will override the height property 
 		 *			set in element style.
 		 */
 		static GUIOption flexibleHeight(UINT32 min = 0, UINT32 max = 0);

+ 2 - 2
BansheeEngine/Include/BsGUIProgressBar.h

@@ -7,8 +7,8 @@
 namespace BansheeEngine
 {
 	/**
-	 * @brief	Contains a background image and a fill image that
-	 *			is scaled depending on the percentage set by the user.
+	 * @brief	GUI element containing a background image and a fill image that
+	 *			is scaled depending on the percentage set by the caller.
 	 */
 	class BS_EXPORT GUIProgressBar : public GUIElementContainer
 	{

+ 2 - 4
BansheeEngine/Include/BsGUIRenderTexture.h

@@ -6,10 +6,8 @@
 namespace BansheeEngine
 {
 	/**
-	 * @brief	Allows you to display a render texture in the GUI.
-	 * 			
-	 * @note	Has the same functionality as GUITexture, but also forwards any input to the control
-	 * 			to underlying GUI elements.
+	 * @brief	Allows you to display a render texture in the GUI. Has the same functionality as GUITexture, but also forwards
+	 *			any input to underlying GUI elements being rendered on the provided render texture.
 	 */
 	class BS_EXPORT GUIRenderTexture : public GUITexture
 	{

+ 13 - 12
MBansheeEngine/GUI/GUIButton.cs

@@ -38,12 +38,12 @@ namespace BansheeEngine
         /// </summary>
         /// <param name="content">Content to display on the button.
         /// </param>
-        /// <param name="style">Optional style to use for the element. Style controls the look
-        /// of the element, as well as default layout options. Style will be retrieved
-        /// from the active GUISkin. If not specified default button style is used.
+        /// <param name="style">Optional style to use for the element. Style controls the look of the element, as well as 
+        /// default layout options. Style will be retrieved from the active GUISkin. If not specified default element style 
+        /// is used.
         /// </param>
-        /// <param name="options">Options that allow you to control how is the element 
-        /// positioned and sized. This will override any similar options set by style.
+        /// <param name="options">Options that allow you to control how is the element positioned and sized. This will 
+        /// override any similar options set by style.
         /// </param>
         public GUIButton(GUIContent content, string style, params GUIOption[] options)
         {
@@ -55,9 +55,9 @@ namespace BansheeEngine
         /// </summary>
         /// <param name="content">Content to display on the button.
         /// </param>
-        /// <param name="style">Optional style to use for the element. Style controls the look
-        /// of the element, as well as default layout options. Style will be retrieved
-        /// from the active GUISkin. If not specified default button style is used.
+        /// <param name="style">Optional style to use for the element. Style controls the look of the element, as well as 
+        /// default layout options. Style will be retrieved from the active GUISkin. If not specified default element style 
+        /// is used.
         /// </param>
         public GUIButton(GUIContent content, string style)
         {
@@ -69,8 +69,8 @@ namespace BansheeEngine
         /// </summary>
         /// <param name="content">Content to display on the button.
         /// </param>
-        /// <param name="options">Options that allow you to control how is the element 
-        /// positioned and sized. This will override any similar options set by style.
+        /// <param name="options">Options that allow you to control how is the element positioned and sized. This will 
+        /// override any similar options set by style.
         /// </param>
         public GUIButton(GUIContent content, params GUIOption[] options)
         {
@@ -78,7 +78,7 @@ namespace BansheeEngine
         }
 
         /// <summary>
-        /// Creates a new button with the specified label.
+        /// Updates the contents displayed on the button.
         /// </summary>
         /// <param name="content">Content to display on the button.</param>
         public void SetContent(GUIContent content)
@@ -132,7 +132,8 @@ namespace BansheeEngine
         }
 
         [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(GUIButton instance, GUIContent content, string style, GUIOption[] options);
+        private static extern void Internal_CreateInstance(GUIButton instance, GUIContent content, string style, 
+            GUIOption[] options);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void Internal_SetContent(IntPtr nativeInstance, GUIContent content);

+ 6 - 6
MBansheeEngine/GUI/GUIContent.cs

@@ -3,8 +3,8 @@
 namespace BansheeEngine
 {
     /// <summary>
-    /// Holds data used for displaying content in a GUIElement. 
-    /// Content can consist of a string, image, a tooltip or none of those.
+    /// Holds data used for displaying content in a GUIElement.  Content can consist of a string, image, a tooltip or none 
+    /// of those.
     /// </summary>
     public sealed class GUIContent
     {
@@ -81,8 +81,8 @@ namespace BansheeEngine
         /// </summary>
         /// <param name="text">Textual portion of the content to be displayed as label in GUI elements.
         /// </param>
-        /// <param name="image">Image to be displayed on top of the GUI element. Image will be placed to the
-        /// right or to the left of the text depending on active GUI style.
+        /// <param name="image">Image to be displayed on top of the GUI element. Image will be placed to the right or to the 
+        /// left of the text depending on active GUI style.
         /// </param>
         public GUIContent(LocString text, SpriteTexture image)
         {
@@ -95,8 +95,8 @@ namespace BansheeEngine
         /// </summary>
         /// <param name="text">Textual portion of the content to be displayed as label in GUI elements.
         /// </param>
-        /// <param name="image">Image to be displayed on top of the GUI element. Image will be placed to the
-        /// right or to the left of the text depending on active GUI style.
+        /// <param name="image">Image to be displayed on top of the GUI element. Image will be placed to the right or to the 
+        /// left of the text depending on active GUI style.
         /// </param>
         /// <param name="tooltip">Tooltip to be displayed when user hovers over a GUI element.
         /// </param>

+ 17 - 22
MBansheeEngine/GUI/GUIElement.cs

@@ -5,9 +5,8 @@ using System.Runtime.CompilerServices;
 namespace BansheeEngine
 {
     /// <summary>
-    /// Base class for all GUI elements. Every GUI element can at least
-    /// be positioned in it's parent layout/panel and be hidden/visible,
-    /// focused/unfocused and assigned a context menu.
+    /// Base class for all GUI elements. Every GUI element can at least be positioned in it's parent layout/panel and be 
+    /// hidden/visible, focused/unfocused and assigned a context menu.
     /// </summary>
     public abstract class GUIElement : ScriptObject
     {
@@ -26,8 +25,7 @@ namespace BansheeEngine
         }
 
         /// <summary>
-        /// Gets or sets non-clipped bounds of the GUI element including the margins. 
-        /// Relative to a parent GUI panel.
+        /// Gets or sets non-clipped bounds of the GUI element including the margins. Relative to a parent GUI panel.
         /// </summary>
         public Rect2I VisualBounds
         {
@@ -51,13 +49,11 @@ namespace BansheeEngine
         }
 
         /// <summary>
-        /// Destroys this element and all its children. Removes the element
-        /// from parent layout/panel.
+        /// Destroys this element and all its children. Removes the element from parent layout/panel.
         /// </summary>
         /// <remarks>
-        /// Calling methods on a destroyed element is a no-operation.
-        /// Destroyed elements aren't allowed to be assigned as children
-        /// of other elements, or be parents of other elements.
+        /// Calling methods on a destroyed element is a no-operation. Destroyed elements aren't allowed to be assigned as 
+        /// children of other elements, or be parents of other elements.
         /// </remarks>
         public virtual void Destroy()
         {
@@ -70,8 +66,8 @@ namespace BansheeEngine
         /// <param name="x">X position of the element in pixels, relative to parent GUI panel.</param>
         /// <param name="y">Y position of the element in pixels, relative to parent GUI panel.</param>
         /// <remarks>
-        /// Be aware that this value will be ignored if GUI element is part of a layout because the 
-        /// layout controls placement of child elements.
+        /// Be aware that this value will be ignored if GUI element is part of a layout because the layout controls placement 
+        /// of child elements.
         /// </remarks>
         public void SetPosition(int x, int y)
         {
@@ -88,13 +84,13 @@ namespace BansheeEngine
         }
 
         /// <summary>
-        /// Sets a flexible element width. Element will be resized according to its 
-        /// contents and parent layout but will always stay within the provided range.
+        /// Sets a flexible element width. Element will be resized according to its contents and parent layout but will always
+        /// stay within the provided range.
         /// </summary>
         /// <param name="minWidth">Minimum width in pixels. Element will never be smaller than this width.
         /// </param>
-        /// <param name="maxWidth">Maximum width in pixels. Element will never be larger than this width.
-        /// Specify zero for unlimited width.
+        /// <param name="maxWidth">Maximum width in pixels. Element will never be larger than this width. Specify zero for 
+        /// unlimited width.
         /// </param>
         public void SetFlexibleWidth(int minWidth, int maxWidth)
         {
@@ -111,13 +107,13 @@ namespace BansheeEngine
         }
 
         /// <summary>
-        /// Sets a flexible element height. Element will be resized according to its 
-        /// contents and parent layout but will always stay within the provided range.
+        /// Sets a flexible element height. Element will be resized according to its contents and parent layout but will 
+        /// always stay within the provided range.
         /// </summary>
         /// <param name="minHeight">Minimum height in pixels. Element will never be smaller than this height.
         /// </param>
-        /// <param name="maxHeight">Maximum height in pixels. Element will never be larger than this height.
-        /// Specify zero for unlimited width.
+        /// <param name="maxHeight">Maximum height in pixels. Element will never be larger than this height. Specify zero for 
+        /// unlimited height.
         /// </param>
         public void SetFlexibleHeight(int minHeight, int maxHeight)
         {
@@ -146,8 +142,7 @@ namespace BansheeEngine
         }
 
         /// <summary>
-        /// Triggered by the native interop object when the keyboard
-        /// focus of this element changes.
+        /// Triggered by the native interop object when the keyboard focus of this element changes.
         /// </summary>
         private void InternalOnFocusChanged(bool focus)
         {

+ 5 - 7
MBansheeEngine/GUI/GUIElementStyle.cs

@@ -38,9 +38,8 @@ namespace BansheeEngine
 	};
 
     /// <summary>
-    /// GUI element style that determines the look of a GUI element, as well as
-    /// the element's default layout options. Different looks can be provided
-    /// for different element states.
+    /// GUI element style that determines the look of a GUI element, as well as the element's default layout options. 
+    /// Different looks can be provided for different element states.
     /// </summary>
     public sealed class GUIElementStyle : ScriptObject
     {
@@ -286,11 +285,10 @@ namespace BansheeEngine
         }
 
         /// <summary>
-        /// Registers a new sub-style that is used by complex GUI elements that contain
-        /// one or multiple sub-elements.
+        /// Registers a new sub-style that is used by complex GUI elements that contain one or multiple sub-elements.
         /// </summary>
-        /// <param name="guiType">Name of the sub-element this style is to be used for. 
-        /// This depends on GUI element the style is applied to.
+        /// <param name="guiType">Name of the sub-element this style is to be used for.  This depends on GUI element the style
+        /// is applied to.
         /// </param>
         /// <param name="styleName">Name of the style in GUI skin to use for the sub-element.
         /// </param>

+ 42 - 1
MBansheeEngine/GUI/GUILabel.cs

@@ -3,35 +3,76 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// GUI element that displays text.
+    /// </summary>
     public sealed class GUILabel : GUIElement
     {
+        /// <summary>
+        /// Creates a new label element.
+        /// </summary>
+        /// <param name="content">Content to display on the label.
+        /// </param>
+        /// <param name="style">Optional style to use for the element. Style controls the look of the element, as well as 
+        /// default layout options. Style will be retrieved from the active GUISkin. If not specified default element style 
+        /// is used.
+        /// </param>
+        /// <param name="options">Options that allow you to control how is the element  positioned and sized. This will 
+        /// override any similar options set by style.
+        /// </param>
         public GUILabel(GUIContent content, string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, content, style, options);
         }
 
+        /// <summary>
+        /// Creates a new label element.
+        /// </summary>
+        /// <param name="content">Content to display on the label.
+        /// </param>
+        /// <param name="style">Optional style to use for the element. Style controls the look of the element, as well as 
+        /// default layout options. Style will be retrieved from the active GUISkin. If not specified default element style 
+        /// is used.
+        /// </param>
         public GUILabel(GUIContent content, string style = "")
         {
             Internal_CreateInstance(this, content, style, new GUIOption[0]);
         }
 
+        /// <summary>
+        /// Creates a new label element.
+        /// </summary>
+        /// <param name="content">Content to display on the label.
+        /// </param>
+        /// <param name="options">Options that allow you to control how is the element positioned and sized. This will 
+        /// override any similar options set by style.
+        /// </param>
         public GUILabel(GUIContent content, params GUIOption[] options)
         {
             Internal_CreateInstance(this, content, "", options);
         }
 
+        /// <summary>
+        /// Updates the contents display on the label.
+        /// </summary>
+        /// <param name="content">Content to display on the label.</param>
         public void SetContent(GUIContent content)
         {
             Internal_SetContent(mCachedPtr, content);
         }
 
+        /// <summary>
+        /// Colors the element with a specific tint.
+        /// </summary>
+        /// <param name="color">Tint to apply to the element.</param>
         public void SetTint(Color color)
         {
             Internal_SetTint(mCachedPtr, color);
         }
 
         [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_CreateInstance(GUILabel instance, GUIContent content, string style, GUIOption[] options);
+        private static extern void Internal_CreateInstance(GUILabel instance, GUIContent content, string style, 
+            GUIOption[] options);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void Internal_SetContent(IntPtr nativeInstance, GUIContent content);

+ 119 - 2
MBansheeEngine/GUI/GUILayout.cs

@@ -4,14 +4,28 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// Base class for GUI layout implementations. GUI layouts serve as containers
+    /// for GUI elements that position and resize the elements automatically with
+    /// respect to layout rules set on the elements.
+    /// </summary>
     public abstract class GUILayout : GUIElement
     {
+        /// <summary>
+        /// Adds a new element to the layout after all existing elements.
+        /// </summary>
+        /// <param name="element">GUI element to add.</param>
         public void AddElement(GUIElement element)
         {
             if(element != null)
                 Internal_AddElement(mCachedPtr, element.mCachedPtr);
         }
 
+        /// <summary>
+        /// Inserts a GUI element before the element at the specified index.
+        /// </summary>
+        /// <param name="index">Index to insert the GUI element at. This must be in range [0, GetNumChildren()).</param>
+        /// <param name="element">GUI element to insert.</param>
         public void InsertElement(int index, GUIElement element)
         {
             if(index < 0 || index > GetNumChildren())
@@ -21,16 +35,30 @@ namespace BansheeEngine
                 Internal_InsertElement(mCachedPtr, index, element.mCachedPtr);
         }
 
+        /// <summary>
+        /// Returns number of child elements in the layout.
+        /// </summary>
+        /// <returns>Number of child elements in the layout.</returns>
         public int GetNumChildren()
         {
             return Internal_GetChildCount(mCachedPtr);
         }
 
+        /// <summary>
+        /// Gets a child elements at the specified index in the layout.
+        /// </summary>
+        /// <param name="index">Index of the element to retrieve. This must be in range [0, GetNumChildren()).</param>
+        /// <returns>GUI element at the specified index, or null if the index is invalid.</returns>
         public GUIElement GetChild(int index)
         {
             return Internal_GetChild(mCachedPtr, index);
         }
 
+        /// <summary>
+        /// Adds a new horizontal layout as a child of this layout. Layout is inserted after all existing elements.
+        /// </summary>
+        /// <param name="options">Options that allow you to control how is the layout positioned and sized.</param>
+        /// <returns>Newly created horizontal layout.</returns>
         public GUILayoutX AddLayoutX(params GUIOption[] options)
         {
             GUILayoutX layout = new GUILayoutX(options);
@@ -38,6 +66,11 @@ namespace BansheeEngine
             return layout;
         }
 
+        /// <summary>
+        /// Adds a new vertical layout as a child of this layout. Layout is inserted after all existing elements.
+        /// </summary>
+        /// <param name="options">Options that allow you to control how is the layout positioned and sized.</param>
+        /// <returns>Newly created vertical layout.</returns>
         public GUILayoutY AddLayoutY(params GUIOption[] options)
         {
             GUILayoutY layout = new GUILayoutY(options);
@@ -45,6 +78,11 @@ namespace BansheeEngine
             return layout;
         }
 
+        /// <summary>
+        /// Adds a new GUI panel as a child of this layout. Panel is inserted after all existing elements.
+        /// </summary>
+        /// <param name="options">Options that allow you to control how is the panel positioned and sized.</param>
+        /// <returns>Newly created GUI panel.</returns>
         public GUIPanel AddPanel(params GUIOption[] options)
         {
             GUIPanel layout = new GUIPanel(options);
@@ -52,13 +90,35 @@ namespace BansheeEngine
             return layout;
         }
 
-        public GUIPanel AddPanel(Int16 depth = 0, ushort depthRangeMin = ushort.MaxValue, ushort depthRangeMax = ushort.MaxValue, params GUIOption[] options)
+        /// <summary>
+        /// Adds a new GUI panel as a child of this layout. Panel is inserted after all existing elements.
+        /// </summary>
+        /// <param name="depth">Depth at which to position the panel. Panels with lower depth will be displayed in front of 
+        /// panels with higher depth. Provided depth is relative to the depth of the parent GUI panel. The depth value will
+        /// be clamped if outside of the depth range of the parent GUI panel.
+        /// </param>
+        /// <param name="depthRangeMin">Smallest depth offset allowed by any child GUI panels. If a child panel has a depth 
+        /// offset lower than this value it will be clamped.
+        /// </param>
+        /// <param name="depthRangeMax">Largest depth offset allowed by any child GUI panels. If a child panel has a depth 
+        /// offset higher than this value it will be clamped.
+        /// </param>
+        /// <param name="options">Options that allow you to control how is the panel positioned and sized. 
+        /// </param>
+        /// <returns>Newly created GUI panel.</returns>
+        public GUIPanel AddPanel(Int16 depth = 0, ushort depthRangeMin = ushort.MaxValue, 
+            ushort depthRangeMax = ushort.MaxValue, params GUIOption[] options)
         {
             GUIPanel layout = new GUIPanel(depth, depthRangeMin, depthRangeMax, options);
             AddElement(layout);
             return layout;
         }
 
+        /// <summary>
+        /// Adds a new flexible space as a child of this layout. Flexible space expands
+        /// to fill all available space in the layout. Space is inserted after all existing elements.
+        /// </summary>
+        /// <returns>Newly created flexible space.</returns>
         public GUIFlexibleSpace AddFlexibleSpace()
         {
             GUIFlexibleSpace space = new GUIFlexibleSpace();
@@ -66,6 +126,14 @@ namespace BansheeEngine
             return space;
         }
 
+        /// <summary>
+        /// Adds a new fixed space object. Fixed space inserts a blank space with specific
+        /// width or height (depending on layout type) in the layout. Space is inserted after all existing elements.
+        /// </summary>
+        /// <param name="size">Size of the space in pixels. This will represent either width or height depending whether the 
+        /// layout is vertical or horizontal.
+        /// </param>
+        /// <returns>Newly created fixed space.</returns>
         public GUIFixedSpace AddSpace(int size)
         {
             GUIFixedSpace space = new GUIFixedSpace(size);
@@ -73,6 +141,13 @@ namespace BansheeEngine
             return space;
         }
 
+        /// <summary>
+        /// Adds a new horizontal layout as a child of this layout. Layout is inserted
+        /// before the element at the specified index.
+        /// </summary>
+        /// <param name="idx">Index to insert the layout at. This must be in range [0, GetNumChildren()) </param>
+        /// <param name="options">Options that allow you to control how is the layout positioned and sized.</param>
+        /// <returns>Newly created horizontal layout.</returns>
         public GUILayoutX InsertLayoutX(int idx, params GUIOption[] options)
         {
             GUILayoutX layout = new GUILayoutX(options);
@@ -80,6 +155,13 @@ namespace BansheeEngine
             return layout;
         }
 
+        /// <summary>
+        /// Adds a new vertical layout as a child of this layout. Layout is inserted
+        /// before the element at the specified index.
+        /// </summary>
+        /// <param name="idx">Index to insert the layout at. This must be in range [0, GetNumChildren()).</param>
+        /// <param name="options">Options that allow you to control how is the layout positioned and sized.</param>
+        /// <returns>Newly created vertical layout.</returns>
         public GUILayoutY InsertLayoutY(int idx, params GUIOption[] options)
         {
             GUILayoutY layout = new GUILayoutY(options);
@@ -87,6 +169,12 @@ namespace BansheeEngine
             return layout;
         }
 
+        /// <summary>
+        /// Adds a new GUI panel as a child of this layout. Panel is inserted before the element at the specified index.
+        /// </summary>
+        /// <param name="idx">Index to insert the panel at. This must be in range [0, GetNumChildren()).</param>
+        /// <param name="options">Options that allow you to control how is the panel positioned and sized.</param>
+        /// <returns>Newly created GUI panel.</returns>
         public GUIPanel InsertPanel(int idx, params GUIOption[] options)
         {
             GUIPanel layout = new GUIPanel(options);
@@ -94,6 +182,22 @@ namespace BansheeEngine
             return layout;
         }
 
+        /// <summary>
+        /// Adds a new GUI panel as a child of this layout. Panel is inserted before the element at the specified index.
+        /// </summary>
+        /// <param name="depth">Depth at which to position the panel. Panels with lower depth will be displayed in front of 
+        /// panels with higher depth. Provided depth is relative to the depth of the parent GUI panel. The depth value will
+        /// be clamped if outside of the depth range of the parent GUI panel.
+        /// </param>
+        /// <param name="depthRangeMin">Smallest depth offset allowed by any child GUI panels. If a child panel has a depth 
+        /// offset lower than this value it will be clamped.
+        /// </param>
+        /// <param name="depthRangeMax">Largest depth offset allowed by any child GUI panels. If a child panel has a depth 
+        /// offset higher than this value it will be clamped.
+        /// </param>
+        /// <param name="options">Options that allow you to control how is the panel positioned and sized. 
+        /// </param>
+        /// <returns>Newly created GUI panel.</returns>
         public GUIPanel InsertPanel(int idx, Int16 depth = 0, ushort depthRangeMin = ushort.MaxValue, 
             ushort depthRangeMax = ushort.MaxValue, params GUIOption[] options)
         {
@@ -102,6 +206,11 @@ namespace BansheeEngine
             return layout;
         }
 
+        /// <summary>
+        /// Adds a new flexible space as a child of this layout. Flexible space expands to fill all available space in the 
+        /// layout. is inserted before the element at the specified index.
+        /// </summary>
+        /// <returns>Newly created flexible space.</returns>
         public GUIFlexibleSpace InsertFlexibleSpace(int idx)
         {
             GUIFlexibleSpace space = new GUIFlexibleSpace();
@@ -109,6 +218,13 @@ namespace BansheeEngine
             return space;
         }
 
+        /// <summary>
+        /// Adds a new fixed space object. Fixed space inserts a blank space with specific width or height (depending on 
+        /// layout type) in the layout. Space is inserted after all existing elements.
+        /// </summary>
+        /// <param name="size">Size of the space in pixels. This will represent either width or height depending whether the 
+        /// layout is vertical or horizontal.</param>
+        /// <returns>Newly created fixed space.</returns>
         public GUIFixedSpace InsertSpace(int idx, int size)
         {
             GUIFixedSpace space = new GUIFixedSpace(size);
@@ -126,7 +242,8 @@ namespace BansheeEngine
         protected static extern void Internal_CreateInstanceY(GUILayout instance, GUIOption[] options);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
-        protected static extern void Internal_CreateInstancePanel(GUILayout instance, Int16 depth, ushort depthRangeMin, ushort depthRangeMax, GUIOption[] options);
+        protected static extern void Internal_CreateInstancePanel(GUILayout instance, Int16 depth, ushort depthRangeMin, 
+            ushort depthRangeMax, GUIOption[] options);
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         protected static extern void Internal_AddElement(IntPtr instance, IntPtr element);

+ 19 - 0
MBansheeEngine/GUI/GUILayoutUtility.cs

@@ -6,8 +6,17 @@ using System.Text;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// Helper class that performs various operations related to
+    /// GUILayout and GUI element sizing/placement.
+    /// </summary>
     public class GUILayoutUtility
     {
+        /// <summary>
+        /// Calculates optimal size of a GUI element.
+        /// </summary>
+        /// <param name="element">GUI element to calculate the optimal size for.</param>
+        /// <returns>Size that allows the GUI element to properly display all of its content.</returns>
         public static Vector2I CalculateOptimalSize(GUIElement element)
         {
             Vector2I output;
@@ -15,6 +24,16 @@ namespace BansheeEngine
             return output;
         }
 
+        /// <summary>
+        /// Calculates the bounds of a GUI element. This is similar to <see cref="GUIElement.Bounds"/> but allows you to
+        /// returns bounds relative to a specific parent GUI panel.
+        /// </summary>
+        /// <param name="element">Elements to calculate the bounds for.
+        /// </param>
+        /// <param name="relativeTo">GUI panel the bounds will be relative to. If this is null or the provided panel is not
+        /// a parent of the provided GUI element, the returned bounds will be relative to the first GUI panel parent instead.
+        /// </param>
+        /// <returns>Bounds of a GUI element relative to the provided GUI panel.</returns>
         public static Rect2I CalculateBounds(GUIElement element, GUIPanel relativeTo = null)
         {
             IntPtr relativeToNative = IntPtr.Zero;

+ 7 - 0
MBansheeEngine/GUI/GUILayoutX.cs

@@ -3,8 +3,15 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// Horizontal layout that will position its child elements left to right.
+    /// </summary>
     public sealed class GUILayoutX : GUILayout
     {
+        /// <summary>
+        /// Constructs a new empty horizontal layout.
+        /// </summary>
+        /// <param name="options">Options that allow you to control how is the layout positioned and sized.</param>
         public GUILayoutX(params GUIOption[] options)
         {
             Internal_CreateInstanceX(this, options);

+ 11 - 0
MBansheeEngine/GUI/GUILayoutY.cs

@@ -3,13 +3,24 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// Vertical layout that will position its child elements top to bottom.
+    /// </summary>
     public sealed class GUILayoutY : GUILayout
     {
+        /// <summary>
+        /// Internal method used by the runtime. Initializes a managed version of the vertical layout that is referenced
+        /// by a native GUI scroll area element.
+        /// </summary>
+        /// <param name="parentArea">Scroll area of which we want to reference the layout of.</param>
         internal GUILayoutY(GUIScrollArea parentArea)
         {
             Internal_CreateInstanceYFromScrollArea(this, parentArea);
         }
 
+        /// <summary>
+        /// Vertical layout that will position its child elements left to right.
+        /// </summary>
         public GUILayoutY(params GUIOption[] options)
         {
             Internal_CreateInstanceY(this, options);

+ 41 - 0
MBansheeEngine/GUI/GUIListBox.cs

@@ -3,32 +3,73 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// List box GUI element which opens a drop down selection with provided elements when active.
+    /// </summary>
     public sealed class GUIListBox : GUIElement
     {
         public delegate void OnSelectionChangedDelegate(int index);
 
+        /// <summary>
+        /// Triggered whenever user selects a new element in the list box. Returned index maps to the element in the elements 
+        /// array that the list box was initialized with.
+        /// </summary>
         public event OnSelectionChangedDelegate OnSelectionChanged;
 
+        /// <summary>
+        /// Creates a new list box with the specified elements.
+        /// </summary>
+        /// <param name="elements">Array of elements to display in the list box. Elements will be displayed in the same order
+        /// as in the array.
+        /// </param>
+        /// <param name="style">Optional style to use for the element. Style controls the look of the element, as well as 
+        /// default layout options. Style will be retrieved from the active GUISkin. If not specified default element style 
+        /// is used.
+        /// </param>
+        /// <param name="options">Options that allow you to control how is the element positioned and sized. This will 
+        /// override any similar options set by style.
+        /// </param>
         public GUIListBox(LocString[] elements, string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, elements, style, options);
         }
 
+        /// <summary>
+        /// Creates a new list box with the specified elements.
+        /// </summary>
+        /// <param name="elements">Array of elements to display in the list box. Elements will be displayed in the same order
+        /// as in the array.
+        /// </param>
+        /// <param name="options">Options that allow you to control how is the element positioned and sized. This will 
+        /// override any similar options set by style.
+        /// </param>
         public GUIListBox(LocString[] elements, params GUIOption[] options)
         {
             Internal_CreateInstance(this, elements, "", options);
         }
 
+        /// <summary>
+        /// Updates the list box with a new set of elements.
+        /// </summary>
+        /// <param name="elements">Array of elements to display in the list box. Elements will be displayed in the same order
+        /// as in the array.</param>
         public void SetElements(LocString[] elements)
         {
             Internal_SetElements(mCachedPtr, elements);
         }
 
+        /// <summary>
+        /// Colors the element with a specific tint.
+        /// </summary>
+        /// <param name="color">Tint to apply to the element.</param>
         public void SetTint(Color color)
         {
             Internal_SetTint(mCachedPtr, color);
         }
 
+        /// <summary>
+        /// Triggered by the native interop object when a user selects an object in the list.
+        /// </summary>
         private void DoOnSelectionChanged(int index)
         {
             if (OnSelectionChanged != null)

+ 63 - 3
MBansheeEngine/GUI/GUIOption.cs

@@ -1,21 +1,53 @@
-using System.Runtime.InteropServices;
+using System;
+using System.Runtime.InteropServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// Controls GUI element layout options, possibly by overriding the default options specified in GUI element style. 
+    /// These options control GUI element placement and size in a GUI layout.
+    /// </summary>
     [StructLayout(LayoutKind.Sequential)]
-    public struct GUIOption
+    public struct GUIOption // Note: Structure of this type must match C++ class GUIOption
     {
+        /// <summary>
+        /// Type of GUI element option.
+        /// </summary>
         internal enum Type
         {
             FixedWidth,
             FlexibleWidth,
             FixedHeight,
-            FlexibleHeight
+            FlexibleHeight,
+            Position
         }
 
         internal int min, max;
         internal Type type;
 
+        /// <summary>
+        /// Constructs a GUI option notifying the GUI layout that this element should be positioned at this offset from the 
+        /// parent GUI panel. This option is ignored if element is part of a layout since it controls its placement.
+        /// </summary>
+        /// <param name="x">Horizontal offset from the parent GUI panel origin, in pixels.</param>
+        /// <param name="y">Vertical offset from the parent GUI panel origin, in pixels.</param>
+        /// <returns>New option object that can be used for initializing a GUI element.</returns>
+        public static GUIOption Position(int x, int y)
+        {
+            GUIOption option = new GUIOption();
+            option.min = x;
+            option.max = y;
+            option.type = Type.Position;
+
+            return option;
+        }
+
+        /// <summary>
+        /// Constructs a GUI option notifying the GUI layout that this element has a fixed width. This will override the width 
+        /// property set in element style.
+        /// </summary>
+        /// <param name="width">Width in pixels.</param>
+        /// <returns>New option object that can be used for initializing a GUI element.</returns>
         public static GUIOption FixedWidth(int width)
         {
             GUIOption option = new GUIOption();
@@ -25,6 +57,12 @@ namespace BansheeEngine
             return option;
         }
 
+        /// <summary>
+        /// Constructs a GUI option notifying the GUI layout that this element has a fixed height. This will override the height 
+        /// property set in element style.
+        /// </summary>
+        /// <param name="height">Height in pixels.</param>
+        /// <returns>New option object that can be used for initializing a GUI element.</returns>
         public static GUIOption FixedHeight(int height)
         {
             GUIOption option = new GUIOption();
@@ -34,6 +72,17 @@ namespace BansheeEngine
             return option;
         }
 
+        /// <summary>
+        /// Constructs a GUI option notifying the GUI layout that this element has a flexible width with optional min/max 
+        /// constraints. Element will be resized according to its contents and parent layout but will always stay within the 
+        /// provided range.
+        /// </summary>
+        /// <param name="minWidth">Minimum width in pixels. Element will never be smaller than this width.
+        /// </param>
+        /// <param name="maxWidth">Maximum width in pixels. Element will never be larger than this width. Specify zero for 
+        /// unlimited width.
+        /// </param>
+        /// <returns>New option object that can be used for initializing a GUI element.</returns>
         public static GUIOption FlexibleWidth(int minWidth = 0, int maxWidth = 0)
         {
             GUIOption option = new GUIOption();
@@ -44,6 +93,17 @@ namespace BansheeEngine
             return option;
         }
 
+        /// <summary>
+        /// Constructs a GUI option notifying the GUI layout that this element has a flexible height with optional min/max 
+        /// constraints. Element will be resized according to its contents and parent layout but will always stay within the 
+        /// provided range.
+        /// </summary>
+        /// <param name="minHeight">Minimum height in pixels. Element will never be smaller than this height.
+        /// </param>
+        /// <param name="maxHeight">Maximum height in pixels. Element will never be larger than this height. Specify zero for 
+        /// unlimited height.
+        /// </param>
+        /// <returns>New option object that can be used for initializing a GUI element.</returns>
         public static GUIOption FlexibleHeight(int minHeight = 0, int maxHeight = 0)
         {
             GUIOption option = new GUIOption();

+ 25 - 1
MBansheeEngine/GUI/GUIPanel.cs

@@ -3,16 +3,40 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// Represents a GUI panel that you can use for free placement of GUI elements within its bounds.
+    /// </summary>
     public sealed class GUIPanel : GUILayout
     {
         private GUIPanel()
         { }
 
-        public GUIPanel(Int16 depth = 0, ushort depthRangeMin = ushort.MaxValue, ushort depthRangeMax = ushort.MaxValue, params GUIOption[] options)
+        /// <summary>
+        /// Constructs a new GUI panel object.
+        /// </summary>
+        /// <param name="depth">Depth at which to position the panel. Panels with lower depth will be displayed in front of 
+        /// panels with higher depth. Provided depth is relative to the depth of the parent GUI panel. The depth value will
+        /// be clamped if outside of the depth range of the parent GUI panel.
+        /// </param>
+        /// <param name="depthRangeMin">Smallest depth offset allowed by any child GUI panels. If a child panel has a depth 
+        /// offset lower than this value it will be clamped.
+        /// </param>
+        /// <param name="depthRangeMax">Largest depth offset allowed by any child GUI panels. If a child panel has a depth 
+        /// offset higher than this value it will be clamped.
+        /// </param>
+        /// <param name="options">Options that allow you to control how is the panel positioned and sized. 
+        /// </param>
+        public GUIPanel(Int16 depth = 0, ushort depthRangeMin = ushort.MaxValue, ushort depthRangeMax = ushort.MaxValue, 
+            params GUIOption[] options)
         {
             Internal_CreateInstancePanel(this, depth, depthRangeMin, depthRangeMax, options);
         }
 
+        /// <summary>
+        /// Constructs a new GUI panel object.
+        /// </summary>
+        /// <param name="options">Options that allow you to control how is the panel positioned and sized. 
+        /// </param>
         public GUIPanel(params GUIOption[] options)
         {
             Internal_CreateInstancePanel(this, 0, ushort.MaxValue, ushort.MaxValue, options);

+ 28 - 0
MBansheeEngine/GUI/GUIProgressBar.cs

@@ -3,24 +3,52 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// GUI element containing a background image and a fill image that is scaled depending on the percentage set by the 
+    /// caller.
+    /// </summary>
     public sealed class GUIProgressBar : GUIElement
     {
+        /// <summary>
+        /// Value that controls the width of the progress bar fill image. Range [0, 1].
+        /// </summary>
         public float Percent
         {
             get { return Internal_GetPercent(mCachedPtr); }
             set { Internal_SetPercent(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Creates a new progress bar element.
+        /// </summary>
+        /// <param name="style">Optional style to use for the element. Style controls the look of the element, as well as 
+        /// default layout options. Style will be retrieved from the active GUISkin. If not specified default element style 
+        /// is used.
+        /// </param>
+        /// <param name="options">Options that allow you to control how is the element  positioned and sized. This will 
+        /// override any similar options set by style.
+        /// </param>
         public GUIProgressBar(string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, style, options);
         }
 
+        /// <summary>
+        /// Creates a new progress bar element.
+        /// </summary>
+        /// <param name="style">Optional style to use for the element. Style controls the look of the element, as well as 
+        /// default layout options. Style will be retrieved from the active GUISkin. If not specified default element style 
+        /// is used.
+        /// </param>
         public GUIProgressBar(string style = "")
         {
             Internal_CreateInstance(this, style, new GUIOption[0]);
         }
 
+        /// <summary>
+        /// Colors the element with a specific tint.
+        /// </summary>
+        /// <param name="color">Tint to apply to the element.</param>
         public void SetTint(Color color)
         {
             Internal_SetTint(mCachedPtr, color);

+ 29 - 0
MBansheeEngine/GUI/GUIRenderTexture.cs

@@ -3,10 +3,17 @@ using System.Runtime.CompilerServices;
 
 namespace BansheeEngine
 {
+    /// <summary>
+    /// Allows you to display a render texture in the GUI. Has the same functionality as GUITexture, but also forwards any 
+    /// input to underlying GUI elements being rendered on the provided render texture.
+    /// </summary>
     public sealed class GUIRenderTexture : GUIElement
     {
         private RenderTexture2D renderTexture;
 
+        /// <summary>
+        /// Render texture that is displayed on the GUI element.
+        /// </summary>
         public RenderTexture2D RenderTexture
         {
             get
@@ -25,6 +32,17 @@ namespace BansheeEngine
             }
         }
 
+        /// <summary>
+        /// Creates a new render texture element.
+        /// </summary>
+        /// <param name="texture">Render texture to display in the element.</param>
+        /// <param name="style">Optional style to use for the element. Style controls the look of the element, as well as 
+        /// default layout options. Style will be retrieved from the active GUISkin. If not specified default element style 
+        /// is used.
+        /// </param>
+        /// <param name="options">Options that allow you to control how is the element  positioned and sized. This will 
+        /// override any similar options set by style.
+        /// </param>
         public GUIRenderTexture(RenderTexture2D texture, string style, params GUIOption[] options)
         {
             IntPtr texturePtr = IntPtr.Zero;
@@ -34,6 +52,13 @@ namespace BansheeEngine
             Internal_CreateInstance(this, texturePtr, style, options);
         }
 
+        /// <summary>
+        /// Creates a new render texture element.
+        /// </summary>
+        /// <param name="texture">Render texture to display in the element.</param>
+        /// <param name="options">Options that allow you to control how is the element  positioned and sized. This will 
+        /// override any similar options set by style.
+        /// </param>
         public GUIRenderTexture(RenderTexture2D texture, params GUIOption[] options)
         {
             IntPtr texturePtr = IntPtr.Zero;
@@ -43,6 +68,10 @@ namespace BansheeEngine
             Internal_CreateInstance(this, texturePtr, "", options);
         }
 
+        /// <summary>
+        /// Colors the element with a specific tint.
+        /// </summary>
+        /// <param name="color">Tint to apply to the element.</param>
         public void SetTint(Color color)
         {
             Internal_SetTint(mCachedPtr, color);