DrawGUI.Icon.Sirenix.SDF

Static icon accessor that provides ~1500 cached Texture2D properties for Odin Inspector's SDF (Signed Distance Field) icon set. SDF icons are scalable vector icons that can be rendered at any size with custom colors and padding. Cached via IconCache<Cache, SdfIconType>.

Definition

Namespace: Paragon.Editor Assembly: Editor assembly

public static partial class DrawGUI
{
    public static partial class Icon
    {
        public static partial class Sirenix
        {
            public static class SDF

Nesting: DrawGUIIconSirenixSDF Dependencies: Sirenix.OdinInspector (SdfIconType, SdfIcons)

Quick Lookup

Goal
Code

Get default cached icon

DrawGUI.Icon.Sirenix.SDF.Alarm

Custom color and size

DrawGUI.Icon.Sirenix.SDF.Create(SdfIconType.Alarm, Color.blue, 32, 32)

Custom with padding

DrawGUI.Icon.Sirenix.SDF.Create(SdfIconType.Alarm, Color.blue, 32, 32, 4)

Methods

Create

Creates a new SDF icon texture with custom color, dimensions, and optional padding. Not cached — creates a fresh Texture2D each call via SdfIcons.CreateTransparentIconTexture.

Parameter
Type
Default
Description

iconType

SdfIconType

The SDF icon to render

color

Color

Icon tint color

width

int

Output texture width in pixels

height

int

Output texture height in pixels

padding

int

0

Padding in pixels around the icon within the texture

Returns: A new Texture2D with the SDF icon rendered at the specified parameters.

Properties (Icon Accessors)

All ~1500 properties return Texture2D and follow the pattern Cache.Get(SdfIconType.EnumValue). The default cached version uses GUI.contentColor as the tint and 64×64 size.

The SDF icon set includes the full Bootstrap Icons library. Categories include:

Alarms & Time: Alarm, AlarmFill, Clock, ClockFill, ClockHistory, Hourglass, HourglassSplit, Stopwatch, StopwatchFill

Arrows: Arrow90degDown/Left/Right/Up, ArrowBarDown/Left/Right/Up, ArrowClockwise, ArrowCounterclockwise, ArrowDown/Left/Right/Up + Circle/Square/Short variants

Files & Folders: File, FileFill, FileEarmark, Folder, FolderFill, Folder2, Folder2Open, FolderCheck, FolderPlus, FolderMinus, FolderX

Media: Play, PlayFill, Pause, PauseFill, Stop, StopFill, SkipBackward, SkipForward, VolumeUp, VolumeMute, Mic, MicFill, Camera, CameraVideo

People: Person, PersonFill, PersonCircle, People, PeopleFill

Devices: Phone, Laptop, Display, Printer, Router, Ssd, UsbDrive, UsbMicro, UsbMini, DeviceHdd, DeviceSsd

UI Elements: Grid, List, Table, CardList, LayoutSidebar, Window, App, Pip

Shapes: Circle, CircleFill, Square, SquareFill, Triangle, TriangleFill, Diamond, DiamondFill, Heart, HeartFill, Star, StarFill

Weather: Clouds, CloudsFill, CloudHaze2, Sun, SunFill, Moon, MoonFill, Snow, Thermometer, Wind

And many more — the full Odin SdfIconType enum contains ~1500 icons covering virtually every common UI concept.

Internal Cache

The private Cache class extends IconCache and creates textures via:

circle-info

The default cached icons use GUI.contentColor as their tint, which adapts to Unity's Pro (dark) and Personal (light) editor skins. This means cached icons automatically match the current editor theme.

Common Pitfalls

circle-exclamation
circle-exclamation
circle-exclamation

Examples

Using a cached SDF icon

Creating a custom-sized SDF icon

See Also

Last updated