BearishSun před 10 roky
rodič
revize
df84033adc

+ 8 - 0
BansheeEditor/Include/BsGUIFloatField.h

@@ -36,6 +36,12 @@ namespace BansheeEngine
 		 */
 		void setValue(float value);
 
+		/**
+		 * @brief	Sets a minimum and maximum allow values in the input field.
+		 *			Set to large negative/positive values if you don't require clamping.
+		 */
+		void setRange(float min, float max);
+
 		/**
 		 * @brief	Checks is the input field currently active.
 		 */
@@ -102,6 +108,8 @@ namespace BansheeEngine
 		GUIInputBox* mInputBox;
 		float mValue;
 		INT32 mLastDragPos;
+		float mMinValue;
+		float mMaxValue;
 		bool mIsDragging;
 		bool mHasInputFocus;
 	};

+ 9 - 2
BansheeEditor/Source/BsGUIFloatField.cpp

@@ -21,7 +21,8 @@ namespace BansheeEngine
 	GUIFloatField::GUIFloatField(const PrivatelyConstruct& dummy, const GUIContent& labelContent, UINT32 labelWidth, 
 		const String& style, const GUIDimensions& dimensions, bool withLabel)
 		:TGUIField(dummy, labelContent, labelWidth, style, dimensions, withLabel), mInputBox(nullptr), mIsDragging(false),
-		mLastDragPos(0), mHasInputFocus(false), mValue(0.0f)
+		mLastDragPos(0), mHasInputFocus(false), mValue(0.0f), mMinValue(std::numeric_limits<float>::lowest()),
+		mMaxValue(std::numeric_limits<float>::max())
 	{
 		mInputBox = GUIInputBox::create(false, GUIOptions(GUIOption::flexibleWidth()), getSubStyleName(getInputStyleType()));
 		mInputBox->setFilter(&GUIFloatField::floatFilter);
@@ -126,7 +127,7 @@ namespace BansheeEngine
 
 	void GUIFloatField::setValue(float value)
 	{
-		mValue = value;
+		mValue = Math::clamp(value, mMinValue, mMaxValue);
 
 		// Only update with new value if it actually changed, otherwise
 		// problems can occur when user types in "0." and the field
@@ -136,6 +137,12 @@ namespace BansheeEngine
 			mInputBox->setText(toWString(mValue));
 	}
 
+	void GUIFloatField::setRange(float min, float max)
+	{
+		mMinValue = min;
+		mMaxValue = max;
+	}
+
 	void GUIFloatField::setTint(const Color& color)
 	{
 		if (mLabel != nullptr)

+ 39 - 0
MBansheeEditor/GUI/GUIColorField.cs

@@ -4,12 +4,22 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Editor GUI element that displays a color and an optional label. Allows the user to select a color using the color 
+    /// picker.
+    /// </summary>
     public sealed class GUIColorField : GUIElement
     {
         public delegate void OnChangedDelegate(Color newValue);
 
+        /// <summary>
+        /// Triggered when the color in the field changes.
+        /// </summary>
         public event OnChangedDelegate OnChanged;
 
+        /// <summary>
+        /// Color displayed by the field.
+        /// </summary>
         public Color Value
         {
             get
@@ -22,27 +32,56 @@ namespace BansheeEditor
             set { Internal_SetValue(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Creates a new color field element with a label.
+        /// </summary>
+        /// <param name="title">Content to display on the label.</param>
+        /// <param name="titleWidth">Width of the title label in pixels.</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 GUIColorField(GUIContent title, int titleWidth = 100, string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, title, titleWidth, style, options, true);
         }
 
+        /// <summary>
+        /// Creates a new color field element without a label.
+        /// </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 GUIColorField(string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, null, 0, style, options, false);
         }
 
+        /// <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 runtime when the value of the color field changes.
+        /// </summary>
+        /// <param name="newValue">New value of the color field.</param>
         private void DoOnChanged(Color newValue)
         {
             if (OnChanged != null)
                 OnChanged(newValue);
         }
 
+        /// <summary>
+        /// Triggered by the runtime when the user clicks on the color field.
+        /// </summary>
         private void DoOnClicked()
         {
             // TODO

+ 54 - 9
MBansheeEditor/GUI/GUIComponentFoldout.cs

@@ -4,47 +4,92 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// GUI element that displays a foldout button that can be expanded or collapsed.
+    /// </summary>
     public sealed class GUIComponentFoldout : GUIElement
     {
+        /// <summary>
+        /// Triggered when the foldout is expanded or collapsed.
+        /// </summary>
         public event Action<bool> OnToggled;
 
+        /// <summary>
+        /// Creates a new foldout element.
+        /// </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 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 GUIComponentFoldout(GUIContent content, string style, params GUIOption[] options)
         {
             Internal_CreateInstance(this, content, style, options);
         }
 
+        /// <summary>
+        /// Creates a new foldout element.
+        /// </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 element style is used.</param>
         public GUIComponentFoldout(GUIContent content, string style)
         {
             Internal_CreateInstance(this, content, style, new GUIOption[0]);
         }
 
+        /// <summary>
+        /// Creates a new foldout element.
+        /// </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>
         public GUIComponentFoldout(GUIContent content, params GUIOption[] options)
         {
             Internal_CreateInstance(this, content, "", options);
         }
 
+        /// <summary>
+        /// Changes the contents displayed on the button.
+        /// </summary>
+        /// <param name="content">Content to display on the button.</param>
         public void SetContent(GUIContent content)
         {
             Internal_SetContent(mCachedPtr, content);
         }
 
-        public bool IsExpanded()
+        /// <summary>
+        /// Determines is the foldout expanded or collapsed.
+        /// </summary>
+        public bool Expanded
         {
-            bool expanded;
-            Internal_IsExpanded(mCachedPtr, out expanded);
-            return expanded;
-        }
-
-        public void SetExpanded(bool expanded)
-        {
-            Internal_SetExpanded(mCachedPtr, expanded);
+            get
+            {
+                bool expanded;
+                Internal_IsExpanded(mCachedPtr, out expanded);
+                return expanded;
+            }
+            set
+            {
+                Internal_SetExpanded(mCachedPtr, value);
+            }
         }
 
+        /// <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 runtime when the foldout button is toggled.
+        /// </summary>
+        /// <param name="expanded">True if the foldout has been expanded, false if collapsed.</param>
         private void DoOnToggled(bool expanded)
         {
             if (OnToggled != null)

+ 54 - 0
MBansheeEditor/GUI/GUIFloatField.cs

@@ -4,12 +4,21 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Editor GUI element that displays a floating point input field and an optional label.
+    /// </summary>
     public sealed class GUIFloatField : GUIElement
     {
         public delegate void OnChangedDelegate(float newValue);
 
+        /// <summary>
+        /// Triggered when the value in the field changes.
+        /// </summary>
         public event OnChangedDelegate OnChanged;
 
+        /// <summary>
+        /// Value displayed by the field input box.
+        /// </summary>
         public float Value
         {
             get
@@ -22,16 +31,39 @@ namespace BansheeEditor
             set { Internal_SetValue(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Creates a new float field element with a label.
+        /// </summary>
+        /// <param name="title">Content to display on the label.</param>
+        /// <param name="titleWidth">Width of the title label in pixels.</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 GUIFloatField(GUIContent title, int titleWidth = 100, string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, title, titleWidth, style, options, true);
         }
 
+        /// <summary>
+        /// Creates a new float field element without a label.
+        /// </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 GUIFloatField(string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, null, 0, style, options, false);
         }
 
+        /// <summary>
+        /// Checks does the element currently has input focus. Input focus means the element has an input caret displayed
+        /// and will accept input from the keyboard.
+        /// </summary>
+        /// <returns>True if the element has input focus.</returns>
         public bool HasInputFocus()
         {
             bool value;
@@ -39,11 +71,30 @@ namespace BansheeEditor
             return value;
         }
 
+        /// <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>
+        /// Sets a range that will input field values will be clamped to. Set to large negative/positive values if clamping
+        /// is not required.
+        /// </summary>
+        /// <param name="min">Minimum boundary of the range to clamp values to.</param>
+        /// <param name="max">Maximum boundary of the range to clamp values to.</param>
+        public void SetRange(float min, float max)
+        {
+            Internal_SetRange(mCachedPtr, min, max);
+        }
+
+        /// <summary>
+        /// Triggered by the runtime when the value of the float field changes.
+        /// </summary>
+        /// <param name="newValue">New value of the float field.</param>
         private void DoOnChanged(float newValue)
         {
             if (OnChanged != null)
@@ -65,5 +116,8 @@ namespace BansheeEditor
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void Internal_SetTint(IntPtr nativeInstance, Color color);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_SetRange(IntPtr nativeInstance, float min, float max);
     }
 }

+ 38 - 0
MBansheeEditor/GUI/GUIGameObjectField.cs

@@ -4,12 +4,22 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Editor GUI element that displays a reference to a <see cref="GameObject"/> and an optional label. Game objects can
+    /// be dragged and dropped onto the field to update the reference.
+    /// </summary>
     public sealed class GUIGameObjectField : GUIElement
     {
         public delegate void OnChangedDelegate(GameObject newValue);
 
+        /// <summary>
+        /// Triggered when the value in the field changes.
+        /// </summary>
         public event OnChangedDelegate OnChanged;
 
+        /// <summary>
+        /// <see cref="GameObject"/> referenced by the field.
+        /// </summary>
         public GameObject Value
         {
             get
@@ -22,21 +32,49 @@ namespace BansheeEditor
             set { Internal_SetValue(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Creates a new game object field element with a label.
+        /// </summary>
+        /// <param name="type">Specific type of <see cref="GameObject"/> this field accepts.</param>
+        /// <param name="title">Content to display on the label.</param>
+        /// <param name="titleWidth">Width of the title label in pixels.</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 GUIGameObjectField(Type type, GUIContent title, int titleWidth = 100, string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, type, title, titleWidth, style, options, true);
         }
 
+        /// <summary>
+        /// Creates a new game object field element without a label.
+        /// </summary>
+        /// <param name="type">Specific type of <see cref="GameObject"/> this field accepts.</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 GUIGameObjectField(Type type, string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, type, null, 0, style, options, false);
         }
 
+        /// <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 runtime when the value of the field changes.
+        /// </summary>
+        /// <param name="newValue">New game object referenced by the field.</param>
         private void DoOnChanged(GameObject newValue)
         {
             if (OnChanged != null)

+ 46 - 0
MBansheeEditor/GUI/GUIIntField.cs

@@ -4,12 +4,21 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Editor GUI element that displays a integer input field and an optional label.
+    /// </summary>
     public sealed class GUIIntField : GUIElement
     {
         public delegate void OnChangedDelegate(int newValue);
 
+        /// <summary>
+        /// Triggered when the value in the field changes.
+        /// </summary>
         public event OnChangedDelegate OnChanged;
 
+        /// <summary>
+        /// Value displayed by the field input box.
+        /// </summary>
         public int Value
         {
             get
@@ -22,16 +31,39 @@ namespace BansheeEditor
             set { Internal_SetValue(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Creates a new integer field element with a label.
+        /// </summary>
+        /// <param name="title">Content to display on the label.</param>
+        /// <param name="titleWidth">Width of the title label in pixels.</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 GUIIntField(GUIContent title, int titleWidth = 100, string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, title, titleWidth, style, options, true);
         }
 
+        /// <summary>
+        /// Creates a new integer field element without a label.
+        /// </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 GUIIntField(string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, null, 0, style, options, false);
         }
 
+        /// <summary>
+        /// Checks does the element currently has input focus. Input focus means the element has an input caret displayed
+        /// and will accept input from the keyboard.
+        /// </summary>
+        /// <returns>True if the element has input focus.</returns>
         public bool HasInputFocus()
         {
             bool value;
@@ -39,16 +71,30 @@ namespace BansheeEditor
             return value;
         }
 
+        /// <summary>
+        /// Sets a range that will input field values will be clamped to. Set to large negative/positive values if clamping
+        /// is not required.
+        /// </summary>
+        /// <param name="min">Minimum boundary of the range to clamp values to.</param>
+        /// <param name="max">Maximum boundary of the range to clamp values to.</param>
         public void SetRange(int min, int max)
         {
             Internal_SetRange(mCachedPtr, min, max);
         }
 
+        /// <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 runtime when the value of the float field changes.
+        /// </summary>
+        /// <param name="newValue">New value of the float field.</param>
         private void DoOnChanged(int newValue)
         {
             if (OnChanged != null)

+ 38 - 0
MBansheeEditor/GUI/GUIResourceField.cs

@@ -4,12 +4,22 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Editor GUI element that displays a reference to a <see cref="Resource"/> and an optional label. Resources can
+    /// be dragged and dropped onto the field to update the reference.
+    /// </summary>
     public sealed class GUIResourceField : GUIElement
     {
         public delegate void OnChangedDelegate(Resource newValue);
 
+        /// <summary>
+        /// Triggered when the value in the field changes.
+        /// </summary>
         public event OnChangedDelegate OnChanged;
 
+        /// <summary>
+        /// <see cref="Resource"/> referenced by the field.
+        /// </summary>
         public Resource Value
         {
             get
@@ -22,21 +32,49 @@ namespace BansheeEditor
             set { Internal_SetValue(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Creates a new resource field element with a label.
+        /// </summary>
+        /// <param name="type">Specific type of <see cref="Resource"/> this field accepts.</param>
+        /// <param name="title">Content to display on the label.</param>
+        /// <param name="titleWidth">Width of the title label in pixels.</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 GUIResourceField(Type type, GUIContent title, int titleWidth = 100, string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, type, title, titleWidth, style, options, true);
         }
 
+        /// <summary>
+        /// Creates a new resource field element without a label.
+        /// </summary>
+        /// <param name="type">Specific type of <see cref="Resource"/> this field accepts.</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 GUIResourceField(Type type, string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, type, null, 0, style, options, false);
         }
 
+        /// <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 runtime when the value of the field changes.
+        /// </summary>
+        /// <param name="newValue">New resource referenced by the field.</param>
         private void DoOnChanged(Resource newValue)
         {
             if (OnChanged != null)

+ 19 - 0
MBansheeEditor/GUI/GUISceneTreeView.cs

@@ -4,18 +4,37 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// GUI element that displays all scene objects in the current scene as a tree view.
+    /// </summary>
     public sealed class GUISceneTreeView : GUIElement
     {
+        /// <summary>
+        /// Creates a new scene tree view 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 GUISceneTreeView(string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, style, options);
         }
 
+        /// <summary>
+        /// Creates a new scene tree view element.
+        /// </summary>
+        /// <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 GUISceneTreeView(params GUIOption[] options)
         {
             Internal_CreateInstance(this, "", options);
         }
 
+        /// <summary>
+        /// Updates the contents of the tree view with most recent scene data. Should be called once per frame.
+        /// </summary>
         public void Update()
         {
             Internal_Update(mCachedPtr);

+ 42 - 0
MBansheeEditor/GUI/GUITextField.cs

@@ -4,12 +4,21 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Editor GUI element that displays a textual input field and an optional label.
+    /// </summary>
     public sealed class GUITextField : GUIElement
     {
         public delegate void OnChangedDelegate(String newValue);
 
+        /// <summary>
+        /// Triggered when the value in the field changes.
+        /// </summary>
         public event OnChangedDelegate OnChanged;
 
+        /// <summary>
+        /// Value displayed by the field input box.
+        /// </summary>
         public String Value
         {
             get
@@ -22,16 +31,41 @@ namespace BansheeEditor
             set { Internal_SetValue(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Creates a new text field element with a label.
+        /// </summary>
+        /// <param name="title">Content to display on the label.</param>
+        /// <param name="titleWidth">Width of the title label in pixels.</param>
+        /// <param name="multiline">Determines should the input field accept multiple lines of text.</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 GUITextField(GUIContent title, int titleWidth = 100, bool multiline = false, string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, multiline, title, titleWidth, style, options, true);
         }
 
+        /// <summary>
+        /// Creates a new text field element without a label.
+        /// </summary>
+        /// <param name="multiline">Determines should the input field accept multiple lines of text.</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 GUITextField(bool multiline = false, string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, multiline, null, 0, style, options, false);
         }
 
+        /// <summary>
+        /// Checks does the element currently has input focus. Input focus means the element has an input caret displayed
+        /// and will accept input from the keyboard.
+        /// </summary>
+        /// <returns>True if the element has input focus.</returns>
         public bool HasInputFocus()
         {
             bool value;
@@ -39,11 +73,19 @@ namespace BansheeEditor
             return value;
         }
 
+        /// <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 runtime when the value of the text field changes.
+        /// </summary>
+        /// <param name="newValue">New value of the text field.</param>
         private void DoOnChanged(String newValue)
         {
             if (OnChanged != null)

+ 35 - 0
MBansheeEditor/GUI/GUIToggleField.cs

@@ -4,12 +4,21 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Editor GUI element that displays a toggle button and an optional label.
+    /// </summary>
     public sealed class GUIToggleField : GUIElement
     {
         public delegate void OnChangedDelegate(bool newValue);
 
+        /// <summary>
+        /// Triggered when the value in the field changes.
+        /// </summary>
         public event OnChangedDelegate OnChanged;
 
+        /// <summary>
+        /// Current state of the toggle button.
+        /// </summary>
         public bool Value
         {
             get
@@ -22,21 +31,47 @@ namespace BansheeEditor
             set { Internal_SetValue(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Creates a new toggle field element with a label.
+        /// </summary>
+        /// <param name="title">Content to display on the label.</param>
+        /// <param name="titleWidth">Width of the title label in pixels.</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 GUIToggleField(GUIContent title, int titleWidth = 100, string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, title, titleWidth, style, options, true);
         }
 
+        /// <summary>
+        /// Creates a new toggle field element without a label.
+        /// </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 GUIToggleField(string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, null, 0, style, options, false);
         }
 
+        /// <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 runtime when the toggle button is toggled.
+        /// </summary>
+        /// <param name="newValue">New value of the toggle button.</param>
         private void DoOnChanged(bool newValue)
         {
             if (OnChanged != null)

+ 40 - 0
MBansheeEditor/GUI/GUIVector2Field.cs

@@ -4,12 +4,21 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Editor GUI element that displays a 2D vector input field and an optional label.
+    /// </summary>
     public sealed class GUIVector2Field : GUIElement
     {
         public delegate void OnChangedDelegate(Vector2 newValue);
 
+        /// <summary>
+        /// Triggered when the value in the field changes.
+        /// </summary>
         public event OnChangedDelegate OnChanged;
 
+        /// <summary>
+        /// Value displayed by the field input box.
+        /// </summary>
         public Vector2 Value
         {
             get
@@ -22,16 +31,39 @@ namespace BansheeEditor
             set { Internal_SetValue(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Creates a new 2D vector field element with a label.
+        /// </summary>
+        /// <param name="title">Content to display on the label.</param>
+        /// <param name="titleWidth">Width of the title label in pixels.</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 GUIVector2Field(GUIContent title, int titleWidth = 100, string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, title, titleWidth, style, options, true);
         }
 
+        /// <summary>
+        /// Creates a new 2D vector field element without a label.
+        /// </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 GUIVector2Field(string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, null, 0, style, options, false);
         }
 
+        /// <summary>
+        /// Checks does the element currently has input focus. Input focus means the element has an input caret displayed
+        /// and will accept input from the keyboard.
+        /// </summary>
+        /// <returns>True if the element has input focus.</returns>
         public bool HasInputFocus()
         {
             bool value;
@@ -39,11 +71,19 @@ namespace BansheeEditor
             return value;
         }
 
+        /// <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 runtime when the value of the field changes.
+        /// </summary>
+        /// <param name="newValue">New value of the field.</param>
         private void DoOnChanged(Vector2 newValue)
         {
             if (OnChanged != null)

+ 40 - 0
MBansheeEditor/GUI/GUIVector3Field.cs

@@ -4,12 +4,21 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Editor GUI element that displays a 3D vector input field and an optional label.
+    /// </summary>
     public sealed class GUIVector3Field : GUIElement
     {
         public delegate void OnChangedDelegate(Vector3 newValue);
 
+        /// <summary>
+        /// Triggered when the value in the field changes.
+        /// </summary>
         public event OnChangedDelegate OnChanged;
 
+        /// <summary>
+        /// Value displayed by the field input box.
+        /// </summary>
         public Vector3 Value
         {
             get
@@ -22,16 +31,39 @@ namespace BansheeEditor
             set { Internal_SetValue(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Creates a new 3D vector field element with a label.
+        /// </summary>
+        /// <param name="title">Content to display on the label.</param>
+        /// <param name="titleWidth">Width of the title label in pixels.</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 GUIVector3Field(GUIContent title, int titleWidth = 100, string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, title, titleWidth, style, options, true);
         }
 
+        /// <summary>
+        /// Creates a new 3D vector field element without a label.
+        /// </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 GUIVector3Field(string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, null, 0, style, options, false);
         }
 
+        /// <summary>
+        /// Checks does the element currently has input focus. Input focus means the element has an input caret displayed
+        /// and will accept input from the keyboard.
+        /// </summary>
+        /// <returns>True if the element has input focus.</returns>
         public bool HasInputFocus()
         {
             bool value;
@@ -39,11 +71,19 @@ namespace BansheeEditor
             return value;
         }
 
+        /// <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 runtime when the value of the field changes.
+        /// </summary>
+        /// <param name="newValue">New value of the field.</param>
         private void DoOnChanged(Vector3 newValue)
         {
             if (OnChanged != null)

+ 40 - 0
MBansheeEditor/GUI/GUIVector4Field.cs

@@ -4,12 +4,21 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Editor GUI element that displays a 4D vector input field and an optional label.
+    /// </summary>
     public sealed class GUIVector4Field : GUIElement
     {
         public delegate void OnChangedDelegate(Vector4 newValue);
 
+        /// <summary>
+        /// Triggered when the value in the field changes.
+        /// </summary>
         public event OnChangedDelegate OnChanged;
 
+        /// <summary>
+        /// Value displayed by the field input box.
+        /// </summary>
         public Vector4 Value
         {
             get
@@ -22,16 +31,39 @@ namespace BansheeEditor
             set { Internal_SetValue(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Creates a new 4D vector field element with a label.
+        /// </summary>
+        /// <param name="title">Content to display on the label.</param>
+        /// <param name="titleWidth">Width of the title label in pixels.</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 GUIVector4Field(GUIContent title, int titleWidth = 100, string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, title, titleWidth, style, options, true);
         }
 
+        /// <summary>
+        /// Creates a new 4D vector field element without a label.
+        /// </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 GUIVector4Field(string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, null, 0, style, options, false);
         }
 
+        /// <summary>
+        /// Checks does the element currently has input focus. Input focus means the element has an input caret displayed
+        /// and will accept input from the keyboard.
+        /// </summary>
+        /// <returns>True if the element has input focus.</returns>
         public bool HasInputFocus()
         {
             bool value;
@@ -39,11 +71,19 @@ namespace BansheeEditor
             return value;
         }
 
+        /// <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 runtime when the value of the field changes.
+        /// </summary>
+        /// <param name="newValue">New value of the field.</param>
         private void DoOnChanged(Vector4 newValue)
         {
             if (OnChanged != null)

+ 37 - 0
MBansheeEditor/GUI/TextureField.cs

@@ -4,12 +4,23 @@ using BansheeEngine;
 
 namespace BansheeEditor
 {
+    /// <summary>
+    /// Editor GUI element that displays a reference to a <see cref="Texture"/> and an optional label. Textures can
+    /// be dragged and dropped onto the field to update the reference. This is similar to <see cref="GUIResourceField"/>
+    /// but the will display the texture contents and not only the name.
+    /// </summary>
     public sealed class GUITextureField : GUIElement
     {
         public delegate void OnChangedDelegate(Texture newValue);
 
+        /// <summary>
+        /// Triggered when the value in the field changes.
+        /// </summary>
         public event OnChangedDelegate OnChanged;
 
+        /// <summary>
+        /// <see cref="Texture"/> referenced by the field.
+        /// </summary>
         public Texture Value
         {
             get
@@ -22,21 +33,47 @@ namespace BansheeEditor
             set { Internal_SetValue(mCachedPtr, value); }
         }
 
+        /// <summary>
+        /// Creates a new texture field element with a label.
+        /// </summary>
+        /// <param name="title">Content to display on the label.</param>
+        /// <param name="titleWidth">Width of the title label in pixels.</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 GUITextureField(GUIContent title, int titleWidth = 100, string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, title, titleWidth, style, options, true);
         }
 
+        /// <summary>
+        /// Creates a new texture field element without a label.
+        /// </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 GUITextureField(string style = "", params GUIOption[] options)
         {
             Internal_CreateInstance(this, null, 0, style, options, false);
         }
 
+        /// <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 runtime when the value of the field changes.
+        /// </summary>
+        /// <param name="newValue">New resource referenced by the field.</param>
         private void Internal_DoOnChanged(Texture newValue)
         {
             if (OnChanged != null)

+ 1 - 0
SBansheeEditor/Include/BsScriptGUIFloatField.h

@@ -34,6 +34,7 @@ namespace BansheeEngine
 		static void internal_setValue(ScriptGUIFloatField* nativeInstance, float value);
 		static void internal_hasInputFocus(ScriptGUIFloatField* nativeInstance, bool* output);
 		static void internal_setTint(ScriptGUIFloatField* nativeInstance, Color color);
+		static void internal_setRange(ScriptGUIFloatField* nativeInstance, float min, float max);
 
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, float, MonoException**);
 

+ 7 - 0
SBansheeEditor/Source/BsScriptGUIFloatField.cpp

@@ -34,6 +34,7 @@ namespace BansheeEngine
 		metaData.scriptClass->addInternalCall("Internal_SetValue", &ScriptGUIFloatField::internal_setValue);
 		metaData.scriptClass->addInternalCall("Internal_HasInputFocus", &ScriptGUIFloatField::internal_hasInputFocus);
 		metaData.scriptClass->addInternalCall("Internal_SetTint", &ScriptGUIFloatField::internal_setTint);
+		metaData.scriptClass->addInternalCall("Internal_SetRange", &ScriptGUIFloatField::internal_setRange);
 
 		onChangedThunk = (OnChangedThunkDef)metaData.scriptClass->getMethod("DoOnChanged", 1)->getThunk();
 	}
@@ -89,6 +90,12 @@ namespace BansheeEngine
 		floatField->setTint(color);
 	}
 
+	void ScriptGUIFloatField::internal_setRange(ScriptGUIFloatField* nativeInstance, float min, float max)
+	{
+		GUIFloatField* intField = static_cast<GUIFloatField*>(nativeInstance->getGUIElement());
+		intField->setRange(min, max);
+	}
+
 	void ScriptGUIFloatField::onChanged(MonoObject* instance, float newValue)
 	{
 		MonoUtil::invokeThunk(onChangedThunk, instance, newValue);