DrawGUI.Style

Pre-configured GUIStyle constants for consistent editor appearance across the Paragon framework. All styles are public static readonly and initialized from GUI.skin and EditorStyles with fluent Odin extension methods.

Definition

Namespace: Paragon.Editor Assembly: Paragon.Editor.dll

public static partial class DrawGUI
{
    public static class Style
}

Remarks

DrawGUI.Style provides a central library of GUIStyle presets that are used throughout the Paragon Editor. Rather than creating ad-hoc styles in each drawer or editor, all code references these shared constants.

Construction Pattern

Styles are built using Odin Inspector's fluent GUIStyle extension methods:

public static readonly GUIStyle LabelBold = Label.WithFontStyle(FontStyle.Bold);

These methods (WithAlignment, WithFontStyle, WithFontSize, WithBackground, WithStretchHeight, WithPadding, WithBorder) return new GUIStyle instances — they do not mutate the original.

SettingsAreaStyle

The SettingsAreaStyle is loaded via reflection from Unity's internal SettingsGUIStyles class. This provides the exact style used by Unity's own settings panels for visual consistency.

Quick Lookup

Goal
Style

No styling

Style.None

Fill height

Style.Fill

Left-aligned label

Style.Label

Centered label

Style.LabelCentered

Bold label

Style.LabelBold

Bold centered label

Style.LabelCenteredBold

Standard button

Style.Button

Pressed button

Style.ButtonPressed

Text input

Style.TextField

Centered text input

Style.TextFieldCentered

Help box container

Style.Box

Horizontal slider line

Style.Line

Selection highlight

Style.SelectionArea

Window panel

Style.Window

Settings panel area

Style.SettingsAreaStyle

Fields

Field
Type
Base
Description

None

GUIStyle

GUIStyle.none

Empty style — no visuals

Fill

GUIStyle

None

Stretches to fill available height

Label

GUIStyle

GUI.skin.label

Middle-left aligned label

LabelCentered

GUIStyle

GUI.skin.label

Middle-center aligned label

LabelBold

GUIStyle

Label

Bold variant of Label

LabelCenteredBold

GUIStyle

LabelCentered

Bold variant of LabelCentered

Button

GUIStyle

GUI.skin.button

Standard Unity button

ButtonPressed

GUIStyle

Button

Button with gray background (pressed state)

TextField

GUIStyle

EditorStyles.textField

Standard text input field

TextFieldCentered

GUIStyle

TextField

Center-aligned text input

Box

GUIStyle

EditorStyles.helpBox

Help box container (rounded border)

Line

GUIStyle

GUI.skin.horizontalSlider

Horizontal slider style (used as line)

SelectionArea

GUIStyle

"selectionRect"

Unity's selection rectangle highlight

Window

GUIStyle

GUI.skin.window

Window panel style with 5px padding, no stretch

SettingsAreaStyle

GUIStyle

Reflected from Unity

Unity's internal settings panel area style

Modifying Styles at Draw Time

Styles are readonly references, but GUIStyle objects are mutable. The Odin extension methods (WithFontSize, WithPadding, etc.) create new GUIStyle instances, so they are safe to use inline:

circle-exclamation

Common Pitfalls

circle-exclamation
circle-exclamation

Examples

Using Styles with DrawGUI

Using Styles with Layout Scopes

Button Styles

See Also

Last updated