/// <summary> /// Use this method to draw a text field /// </summary> /// <remarks> /// Use this method to draw a text field. To get the new text inside the control use the return value of this method. /// </remarks> /// <param name="theText">the current text of the textbox</param> /// <param name="theStyleTextField">the style of the text field</param> /// <param name="theLayout">GUILayout options</param> /// <returns>returns the new text inside the control</returns> public static string TextField(string theText, eStyleTextField theStyleTextField, params GUILayoutOption[] theLayout) { Init(); if(itsSkinIndex == -1) { return GUILayout.TextField(theText, theLayout); } else { return GUILayout.TextField(theText, GetStyleTextField(theStyleTextField), theLayout); } }
/// <summary> /// returns the guistyle for a textfield /// </summary> /// <param name="theStyleTextField">the type of textfield style</param> /// <returns>returns the requested textfield style. Returns the default textfield style if no custom style was found.</returns> public static GUIStyle GetStyleTextField(eStyleTextField theStyleTextField) { if(itsSkinIndex == -1) return GUI.skin.textField; Init(); if(theStyleTextField == eStyleTextField.eTextField && itsStyleTextField[itsSkinIndex] != null) { return itsStyleTextField[itsSkinIndex]; } else if(theStyleTextField == eStyleTextField.eTextFieldLeft && itsStyleTextFieldLeft[itsSkinIndex] != null) { return itsStyleTextFieldLeft[itsSkinIndex]; } else if(theStyleTextField == eStyleTextField.eTextFieldRight && itsStyleTextFieldRight[itsSkinIndex] != null) { return itsStyleTextFieldRight[itsSkinIndex]; } return GUI.skin.textField; }