Show / Hide Table of Contents

Class GUIStyle

Inheritance
Object
GUIStyle
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: UnityEngine
Assembly: UnityEngine.dll
Syntax
[Serializable]
public sealed class GUIStyle

Constructors

| Improve this Doc View Source

GUIStyle()

Declaration
public GUIStyle()
| Improve this Doc View Source

GUIStyle(GUIStyle)

Declaration
public GUIStyle(GUIStyle other)
Parameters
Type Name Description
GUIStyle other

Properties

| Improve this Doc View Source

active

Declaration
public GUIStyleState active { get; set; }
Property Value
Type Description
GUIStyleState

alignment

Declaration
public TextAnchor alignment { get; set; }
Property Value
Type Description
TextAnchor
| Improve this Doc View Source

border

Declaration
public RectOffset border { get; set; }
Property Value
Type Description
RectOffset

clipOffset

Declaration
[Obsolete("Don't use clipOffset - put things inside BeginGroup instead. This functionality will be removed in a later version.", false)]
public Vector2 clipOffset { get; set; }
Property Value
Type Description
Vector2

clipping

Declaration
public TextClipping clipping { get; set; }
Property Value
Type Description
TextClipping

contentOffset

Declaration
public Vector2 contentOffset { get; set; }
Property Value
Type Description
Vector2

fixedHeight

Declaration
public float fixedHeight { get; set; }
Property Value
Type Description
Single

fixedWidth

Declaration
public float fixedWidth { get; set; }
Property Value
Type Description
Single
| Improve this Doc View Source

focused

Declaration
public GUIStyleState focused { get; set; }
Property Value
Type Description
GUIStyleState

font

Declaration
public Font font { get; set; }
Property Value
Type Description
Font

fontSize

Declaration
public int fontSize { get; set; }
Property Value
Type Description
Int32

fontStyle

Declaration
public FontStyle fontStyle { get; set; }
Property Value
Type Description
FontStyle
| Improve this Doc View Source

hover

Declaration
public GUIStyleState hover { get; set; }
Property Value
Type Description
GUIStyleState

imagePosition

Declaration
public ImagePosition imagePosition { get; set; }
Property Value
Type Description
ImagePosition
| Improve this Doc View Source

isHeightDependantOnWidth

Declaration
public bool isHeightDependantOnWidth { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

lineHeight

Declaration
public float lineHeight { get; }
Property Value
Type Description
Single
| Improve this Doc View Source

margin

Declaration
public RectOffset margin { get; set; }
Property Value
Type Description
RectOffset

name

Declaration
public string name { get; set; }
Property Value
Type Description
String
| Improve this Doc View Source

none

Declaration
public static GUIStyle none { get; }
Property Value
Type Description
GUIStyle
| Improve this Doc View Source

normal

Declaration
public GUIStyleState normal { get; set; }
Property Value
Type Description
GUIStyleState
| Improve this Doc View Source

onActive

Declaration
public GUIStyleState onActive { get; set; }
Property Value
Type Description
GUIStyleState
| Improve this Doc View Source

onFocused

Declaration
public GUIStyleState onFocused { get; set; }
Property Value
Type Description
GUIStyleState
| Improve this Doc View Source

onHover

Declaration
public GUIStyleState onHover { get; set; }
Property Value
Type Description
GUIStyleState
| Improve this Doc View Source

onNormal

Declaration
public GUIStyleState onNormal { get; set; }
Property Value
Type Description
GUIStyleState
| Improve this Doc View Source

overflow

Declaration
public RectOffset overflow { get; set; }
Property Value
Type Description
RectOffset
| Improve this Doc View Source

padding

Declaration
public RectOffset padding { get; set; }
Property Value
Type Description
RectOffset

richText

Declaration
public bool richText { get; set; }
Property Value
Type Description
Boolean

stretchHeight

Declaration
public bool stretchHeight { get; set; }
Property Value
Type Description
Boolean

stretchWidth

Declaration
public bool stretchWidth { get; set; }
Property Value
Type Description
Boolean

wordWrap

Declaration
public bool wordWrap { get; set; }
Property Value
Type Description
Boolean

Methods

| Improve this Doc View Source

CalcHeight(GUIContent, Single)

Declaration
public float CalcHeight(GUIContent content, float width)
Parameters
Type Name Description
GUIContent content
Single width
Returns
Type Description
Single
| Improve this Doc View Source

CalcMinMaxWidth(GUIContent, out Single, out Single)

Declaration
public void CalcMinMaxWidth(GUIContent content, out float minWidth, out float maxWidth)
Parameters
Type Name Description
GUIContent content
Single minWidth
Single maxWidth
| Improve this Doc View Source

CalcScreenSize(Vector2)

Declaration
public Vector2 CalcScreenSize(Vector2 contentSize)
Parameters
Type Name Description
Vector2 contentSize
Returns
Type Description
Vector2
| Improve this Doc View Source

CalcSize(GUIContent)

Declaration
public Vector2 CalcSize(GUIContent content)
Parameters
Type Name Description
GUIContent content
Returns
Type Description
Vector2
| Improve this Doc View Source

Draw(Rect, Boolean, Boolean, Boolean, Boolean)

Declaration
public void Draw(Rect position, bool isHover, bool isActive, bool on, bool hasKeyboardFocus)
Parameters
Type Name Description
Rect position
Boolean isHover
Boolean isActive
Boolean on
Boolean hasKeyboardFocus
| Improve this Doc View Source

Draw(Rect, String, Boolean, Boolean, Boolean, Boolean)

Declaration
public void Draw(Rect position, string text, bool isHover, bool isActive, bool on, bool hasKeyboardFocus)
Parameters
Type Name Description
Rect position
String text
Boolean isHover
Boolean isActive
Boolean on
Boolean hasKeyboardFocus
| Improve this Doc View Source

Draw(Rect, GUIContent, Boolean, Boolean, Boolean, Boolean)

Declaration
public void Draw(Rect position, GUIContent content, bool isHover, bool isActive, bool on, bool hasKeyboardFocus)
Parameters
Type Name Description
Rect position
GUIContent content
Boolean isHover
Boolean isActive
Boolean on
Boolean hasKeyboardFocus
| Improve this Doc View Source

Draw(Rect, GUIContent, Int32)

Declaration
public void Draw(Rect position, GUIContent content, int controlID)
Parameters
Type Name Description
Rect position
GUIContent content
Int32 controlID
| Improve this Doc View Source

Draw(Rect, GUIContent, Int32, Boolean)

Declaration
public void Draw(Rect position, GUIContent content, int controlID, bool on)
Parameters
Type Name Description
Rect position
GUIContent content
Int32 controlID
Boolean on
| Improve this Doc View Source

Draw(Rect, Texture, Boolean, Boolean, Boolean, Boolean)

Declaration
public void Draw(Rect position, Texture image, bool isHover, bool isActive, bool on, bool hasKeyboardFocus)
Parameters
Type Name Description
Rect position
Texture image
Boolean isHover
Boolean isActive
Boolean on
Boolean hasKeyboardFocus
| Improve this Doc View Source

DrawCursor(Rect, GUIContent, Int32, Int32)

Declaration
public void DrawCursor(Rect position, GUIContent content, int controlID, int character)
Parameters
Type Name Description
Rect position
GUIContent content
Int32 controlID
Int32 character
| Improve this Doc View Source

DrawWithTextSelection(Rect, GUIContent, Int32, Int32, Int32)

Declaration
public void DrawWithTextSelection(Rect position, GUIContent content, int controlID, int firstSelectedCharacter, int lastSelectedCharacter)
Parameters
Type Name Description
Rect position
GUIContent content
Int32 controlID
Int32 firstSelectedCharacter
Int32 lastSelectedCharacter
| Improve this Doc View Source

Finalize()

Declaration
protected void Finalize()
| Improve this Doc View Source

GetCursorPixelPosition(Rect, GUIContent, Int32)

Declaration
public Vector2 GetCursorPixelPosition(Rect position, GUIContent content, int cursorStringIndex)
Parameters
Type Name Description
Rect position
GUIContent content
Int32 cursorStringIndex
Returns
Type Description
Vector2
| Improve this Doc View Source

GetCursorStringIndex(Rect, GUIContent, Vector2)

Declaration
public int GetCursorStringIndex(Rect position, GUIContent content, Vector2 cursorPixelPosition)
Parameters
Type Name Description
Rect position
GUIContent content
Vector2 cursorPixelPosition
Returns
Type Description
Int32
| Improve this Doc View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
String
Overrides
Object.ToString()

Operators

| Improve this Doc View Source

Implicit(String to GUIStyle)

Declaration
public static implicit operator GUIStyle(string str)
Parameters
Type Name Description
String str
Returns
Type Description
GUIStyle

Extension Methods

MustExtensions.MustBeEqual<T>(T, T)
MustExtensions.MustBeEqual<T>(T, T, String)
MustExtensions.MustNotBeEqual<T>(T, T)
MustExtensions.MustNotBeEqual<T>(T, T, String)
MustExtensions.MustBeNull<T>(T)
MustExtensions.MustBeNull<T>(T, String)
MustExtensions.MustNotBeNull<T>(T)
MustExtensions.MustNotBeNull<T>(T, String)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX