RaptorStyle
Drawing helpers, colours and fonts shared by RAPTOR's browsers.
| Namespace | Assembly | Kind | Stability |
|---|---|---|---|
Raptor.EditorTools | Raptor.Editor | class | preview, since 0.1.0 |
public static class RaptorStyleFields
AccentComponent
public static readonly Color AccentComponent;The accent of component rows.
AccentCyan
public static readonly Color AccentCyan;The secondary accent.
AccentGreen
public static readonly Color AccentGreen;The active accent.
ControlDisabled
public static readonly Color ControlDisabled;A disabled control's fill.
ControlFill
public static readonly Color ControlFill;A resting control's fill.
ControlHover
public static readonly Color ControlHover;A hovered control's fill.
CornerRadius
public const float CornerRadius;A tile's corner radius.
FaintBorder
public static readonly Color FaintBorder;A faint border.
GlowExtent
public const float GlowExtent;How far the active-tile glow extends past the tile edge, in pixels. It does not exceed PanelPad, the tiles' inset, so the panel does not clip the glow.
GlyphZone
public const float GlyphZone;The width reserved for the glyph in a watermark header.
HoverFill
public static readonly Color HoverFill;A hovered row's fill.
HoverTint
public static readonly Color HoverTint;The hover tint.
IconSize
public const float IconSize;A tile icon's size.
PanelColor
public static readonly Color PanelColor;A panel's fill.
PanelPad
public const float PanelPad;A panel's padding.
RecessFill
public static readonly Color RecessFill;A recessed field's fill.
SelectFill
public static readonly Color SelectFill;A selected control's fill.
SelectFillHover
public static readonly Color SelectFillHover;A hovered selected control's fill.
SelectTint
public static readonly Color SelectTint;The selection tint.
TextMuted
public static readonly Color TextMuted;Muted text.
TextPrimary
public static readonly Color TextPrimary;Primary text.
TextSecondary
public static readonly Color TextSecondary;Secondary text.
TileColor
public static readonly Color TileColor;A tile's fill.
TileGap
public const float TileGap;The gap between tiles.
WindowBg
public static readonly Color WindowBg;A window's background.
Properties
DisplayFace
public static Font DisplayFace { get; }The display font, Geist Medium. It is loaded once and shared with the scene tool.
Mono
public static Font Mono { get; }The bundled monospace font, medium weight.
MonoRegular
public static Font MonoRegular { get; }The bundled monospace font, regular weight.
Methods
DrawFrame
public static void DrawFrame(Rect r, Color color, float thickness)Draws a square-cornered outline.
| Parameter | Type | Description |
|---|---|---|
| r | Rect | The rect in GUI coordinates of the current view. |
color | Color | The colour. |
thickness | float | The stroke width, in points. |
DrawGlyphHeaderPanel
public static void DrawGlyphHeaderPanel(Rect r, Texture glyph, string eyebrow, string name, float glyphOpacity = 0.4f)Draws the tool-header watermark behind the context bar's controls. The tool's glyph fades in from the left, with the uppercase eyebrow and the tool name right-aligned. Pass the context bar's full-height header area as r. Only the left corners are rounded. Draws on Repaint only.
| Parameter | Type | Default | Description |
|---|---|---|---|
| r | Rect | The rect in GUI coordinates of the current view. | |
glyph | Texture | The glyph texture. | |
eyebrow | string | The small label above the name. | |
name | string | The name. | |
glyphOpacity | float | 0.4f | The glyph's opacity. |
DrawMaterialPreviewPanel
public static void DrawMaterialPreviewPanel(Rect r, Material active)Draws a material preview panel for the active paint slot, as in the scene tool's Surfaces material panel. The texture fades in from the left, with a MATERIAL eyebrow and the material name right-aligned.
| Parameter | Type | Description |
|---|---|---|
| r | Rect | The rect in GUI coordinates of the current view. |
active | Material | The material shown. |
DrawMaterialPreviewPanel
public static void DrawMaterialPreviewPanel(Rect r, Material subject, string eyebrow, string[] metaLines)Draws a material preview panel with a custom eyebrow, such as PAINTING or INSPECTING, and optional meta lines stacked right-aligned under the name.
| Parameter | Type | Description |
|---|---|---|
| r | Rect | The rect in GUI coordinates of the current view. |
subject | Material | The material shown. |
eyebrow | string | The small label above the name. |
metaLines | string[] | Lines under the name, or null. |
DrawMaterialPreviewPanel
public static void DrawMaterialPreviewPanel(Rect r, Material subject, string eyebrow, string[] metaLines, string footerLine, bool strongFirstMeta, Vector2? previewPan = null)Draws a material preview panel with a footer line, such as the asset's folder path, pinned to the bottom. strongFirstMeta draws the first meta line, such as "PACK ยท 512x512", in primary text above the muted lines.
| Parameter | Type | Default | Description |
|---|---|---|---|
| r | Rect | The rect in GUI coordinates of the current view. | |
subject | Material | The material shown. | |
eyebrow | string | The small label above the name. | |
metaLines | string[] | Lines under the name, or null. | |
footerLine | string | A line pinned to the bottom, or null. | |
strongFirstMeta | bool | Whether to draw the first meta line in primary text. | |
previewPan | Vector2? | null | The texture pan, or null. |
DrawPreviewPanel
public static void DrawPreviewPanel(Rect r, Texture preview, string eyebrow, string name, string[] metaLines, string footerLine = null, bool strongFirstMeta = false, Vector2? previewPan = null)Draws the shared preview panel for any thumbnail Texture, as used by the Material Browser and prefab browsers. The thumbnail fades in from the left, with the uppercase eyebrow, the name and any meta lines right-aligned.
| Parameter | Type | Default | Description |
|---|---|---|---|
| r | Rect | The rect in GUI coordinates of the current view. | |
preview | Texture | The thumbnail. | |
eyebrow | string | The small label above the name. | |
name | string | The name. | |
metaLines | string[] | Lines under the name, or null. | |
footerLine | string | null | A line pinned to the bottom, or null. |
strongFirstMeta | bool | false | Whether to draw the first meta line in primary text. |
previewPan | Vector2? | null | The texture pan, or null. |
DrawRoundedPanel
public static void DrawRoundedPanel(Rect r)Draws a rounded panel background with a 1 px dark edge and the panel fill, at the tile corner radius. Draw it before the panel's content.
| Parameter | Type | Description |
|---|---|---|
| r | Rect | The rect in GUI coordinates of the current view. |
DrawRoundedPanel
public static void DrawRoundedPanel(Rect r, Color fill)Draws a rounded panel background with a 1 px dark edge and the given fill. Draw it before the panel's content.
| Parameter | Type | Description |
|---|---|---|
| r | Rect | The rect in GUI coordinates of the current view. |
fill | Color | The fill colour. |
DrawTileGlow
public static void DrawTileGlow(Rect tileRect, Color color)Draws a soft accent glow around an active tile. Call it after drawing the tile. The glow is hollow, so it does not cover the glyph.
| Parameter | Type | Description |
|---|---|---|
tileRect | Rect | The tile's rect. |
color | Color | The glow colour. Its alpha scales the glow's strength. |
GlyphHeaderWidth
public static float GlyphHeaderWidth(string eyebrow, string name)Returns the width the watermark header needs, made up of GlyphZone, the wider of the eyebrow and name, and right padding. RaptorDrawTool.HeaderWidth uses it to size the context bar.
| Parameter | Type | Description |
|---|---|---|
eyebrow | string | The small label above the name. |
name | string | The name. |
Returns: The header width.
MaterialPreview
public static Texture MaterialPreview(Material m)Returns the material's albedo texture (URP, glTF or built-in), or its asset thumbnail if it has none.
| Parameter | Type | Description |
|---|---|---|
| m | Material | The material. |
Returns: The texture.
RoundedFill
public static void RoundedFill(Rect r, Color color, float radius)Draws a filled rounded rectangle.
| Parameter | Type | Description |
|---|---|---|
| r | Rect | The rect in GUI coordinates of the current view. |
color | Color | The colour. |
radius | float | The corner radius, in points. |
RoundedRing
public static void RoundedRing(Rect r, Color color, float thickness, float radius)Draws a rounded outline with the given stroke width.
| Parameter | Type | Description |
|---|---|---|
| r | Rect | The rect in GUI coordinates of the current view. |
color | Color | The colour. |
thickness | float | The stroke width, in points. |
radius | float | The corner radius, in points. |
SolidTex
public static Texture2D SolidTex(ref Texture2D cache, Color color)Returns a 1x1 texture of one colour, cached in the caller's field.
| Parameter | Type | Description |
|---|---|---|
cache | ref Texture2D | The caller's cache field. |
color | Color | The colour. |
Returns: The texture.