PixelCrushers.DialogueSystem.UnityGUI.UnityGUITools Class Reference

Static utility class that provides methods for drawing Unity GUI controls. More...

Static Public Member Functions

static void DrawText (Rect rect, string text, GUIStyle guiStyle, TextStyle textStyle=TextStyle.None)
 Draws a text label using a specified GUI style and text style. More...
 
static void DrawText (Rect rect, string text, GUIStyle guiStyle, TextStyle textStyle, Color textStyleColor)
 Draws a text label using a specified GUI style and text style. More...
 
static GUISkin GetValidGUISkin (GUISkin guiSkin)
 Gets the most applicable GUI skin. More...
 
static GUISkin GetDialogueManagerGUISkin ()
 Gets the GUI skin on the DialogueManager's UnityDialogueUI. More...
 
static GUIStyle GetGUIStyle (string guiStyleName, GUIStyle defaultGUIStyle)
 Using the current skin, gets a named GUI style. More...
 
static Color ColorWithAlpha (Color color, float alpha)
 Sets the alpha value of a color. More...
 
static FontStyle ApplyBold (FontStyle fontStyle)
 Returns a font style that has bold applied. More...
 
static FontStyle ApplyItalic (FontStyle fontStyle)
 Returns a font style that has italics applied. More...
 
static GUIStyle ApplyFormatting (FormattedText formattingToApply, GUIStyle guiStyle)
 Applies the formatting specified in a FormattedText to a GUI style. More...
 

Detailed Description

Static utility class that provides methods for drawing Unity GUI controls.

Member Function Documentation

◆ ApplyBold()

static FontStyle PixelCrushers.DialogueSystem.UnityGUI.UnityGUITools.ApplyBold ( FontStyle  fontStyle)
static

Returns a font style that has bold applied.

If the font already has italics, the returned style will have bold and italics.

Returns
The font style with bold.
Parameters
fontStyleThe original font style.

◆ ApplyFormatting()

static GUIStyle PixelCrushers.DialogueSystem.UnityGUI.UnityGUITools.ApplyFormatting ( FormattedText  formattingToApply,
GUIStyle  guiStyle 
)
static

Applies the formatting specified in a FormattedText to a GUI style.

If the formatting contains any emphases, currently only applies the first emphasis.

Returns
The same GUI style (not a copy) with formatting applied.
Parameters
formattingToApplyFormatting to apply.
guiStyleGUI style.

◆ ApplyItalic()

static FontStyle PixelCrushers.DialogueSystem.UnityGUI.UnityGUITools.ApplyItalic ( FontStyle  fontStyle)
static

Returns a font style that has italics applied.

If the font already has bold, the returned style will have bold and italics.

Returns
The font style with italics.
Parameters
fontStyleThe original font style.

◆ ColorWithAlpha()

static Color PixelCrushers.DialogueSystem.UnityGUI.UnityGUITools.ColorWithAlpha ( Color  color,
float  alpha 
)
static

Sets the alpha value of a color.

Returns
The specified color, with the alpha value set to the specified alpha.
Parameters
colorColor.
alphaAlpha.

◆ DrawText() [1/2]

static void PixelCrushers.DialogueSystem.UnityGUI.UnityGUITools.DrawText ( Rect  rect,
string  text,
GUIStyle  guiStyle,
TextStyle  textStyle,
Color  textStyleColor 
)
static

Draws a text label using a specified GUI style and text style.

Parameters
rectRect where the label will be drawn.
textText to draw.
guiStyleGUI style.
textStyleText style.
textStyleColorText style color used for outlines and drop shadows.

◆ DrawText() [2/2]

static void PixelCrushers.DialogueSystem.UnityGUI.UnityGUITools.DrawText ( Rect  rect,
string  text,
GUIStyle  guiStyle,
TextStyle  textStyle = TextStyle.None 
)
static

Draws a text label using a specified GUI style and text style.

Parameters
rectRect where the label will be drawn.
textText to draw.
guiStyleGUI style.
textStyleText style.

◆ GetDialogueManagerGUISkin()

static GUISkin PixelCrushers.DialogueSystem.UnityGUI.UnityGUITools.GetDialogueManagerGUISkin ( )
static

Gets the GUI skin on the DialogueManager's UnityDialogueUI.

Returns
The GUI skin on the DialogueManager's UnityDialogueUI, or null if it doesn't exist.

◆ GetGUIStyle()

static GUIStyle PixelCrushers.DialogueSystem.UnityGUI.UnityGUITools.GetGUIStyle ( string  guiStyleName,
GUIStyle  defaultGUIStyle 
)
static

Using the current skin, gets a named GUI style.

Returns
A copy of the GUI style named by guiStyleName, or defaultGUIStyle if the named style doesn't exist in the current skin. Since this is a copy, you can modify it without affecting the original.
Parameters
guiStyleNameGUI style name.
defaultGUIStyleDefault GUI style to use if the named style doesn't exist.

◆ GetValidGUISkin()

static GUISkin PixelCrushers.DialogueSystem.UnityGUI.UnityGUITools.GetValidGUISkin ( GUISkin  guiSkin)
static

Gets the most applicable GUI skin.

It first tries the specified guiSkin, then the DialogueManager's UnityDialogueUI's skin if applicable, then the default skin.

Returns
A valid (non-null) GUI skin.
Parameters
guiSkinThe first GUI skin to try.

The documentation for this class was generated from the following file: