UnityEngine.GUIStyle.Draw C# (CSharp) Method

Draw() public method

Draw the GUIStyle with text and an image inside. If the image is too large to fit within the content area of the style it is scaled down.

public Draw ( Rect position, GUIContent content, bool isHover, bool isActive, bool on, bool hasKeyboardFocus ) : void
position Rect
content GUIContent
isHover bool
isActive bool
on bool
hasKeyboardFocus bool
return void
        public void Draw(Rect position, GUIContent content, bool isHover, bool isActive, bool on, bool hasKeyboardFocus)
        {
            if (Event.current.type != EventType.Repaint)
            {
                Debug.LogError("Style.Draw may not be called if it is not a repaint event");
            }
            else
            {
                Internal_Draw(this.m_Ptr, position, content, isHover, isActive, on, hasKeyboardFocus);
            }
        }

Same methods

GUIStyle::Draw ( Rect position, GUIContent content, int controlID ) : void
GUIStyle::Draw ( Rect position, GUIContent content, int controlID, bool on ) : void
GUIStyle::Draw ( Rect position, Texture image, bool isHover, bool isActive, bool on, bool hasKeyboardFocus ) : void
GUIStyle::Draw ( Rect position, bool isHover, bool isActive, bool on, bool hasKeyboardFocus ) : void
GUIStyle::Draw ( Rect position, string text, bool isHover, bool isActive, bool on, bool hasKeyboardFocus ) : void

Usage Example

コード例 #1
0
		public virtual void OnPreviewGUI(Rect r, GUIStyle background)
		{
			if (Event.current.type == EventType.Repaint)
			{
				background.Draw(r, false, false, false, false);
			}
		}
All Usage Examples Of UnityEngine.GUIStyle::Draw