API ReferenceEditor
Paintclass
object→Paint
Methods47
Showing 47 methods
public static void ClearBrush()
Returns:
void—public static void ClearPen()
Returns:
void—public static void DrawArc(Vector2 center, Vector2 radius, float angle, float angleSize)
Draws an arc (line). Angles are clockwise, 0 is north.
| Parameter | Type | Description |
|---|---|---|
| center | Vector2 | The center of the circle |
| radius | Vector2 | The radius of the circle |
| angle | float | The center of the arc, in degrees |
| angleSize | float | The size of the arc, in degrees |
Returns:
void—public static void DrawArrow(Vector2 p1, Vector2 p2, float width)
| Parameter | Type | Description |
|---|---|---|
| p1 | Vector2 | — |
| p2 | Vector2 | — |
| width | float | — |
Returns:
void—public static Sandbox.Rect DrawIcon(Sandbox.Rect rect, string iconName, float pixelHeight, Sandbox.TextFlag alignment = 132)
| Parameter | Type | Description |
|---|---|---|
| rect | Rect | — |
| iconName | string | — |
| pixelHeight | float | — |
| alignment = 132 | TextFlag | — |
public static void DrawPie(Vector2 center, Vector2 radius, float angle, float angleSize)
Draws a pie. Angles are clockwise, 0 is north.
| Parameter | Type | Description |
|---|---|---|
| center | Vector2 | The center of the circle |
| radius | Vector2 | The radius of the circle |
| angle | float | The center of the pie, in degrees |
| angleSize | float | The size of the pie, in degrees |
Returns:
void—public static void DrawPoints(System.Collections.Generic.IEnumerable`1<Vector2> points)
| Parameter | Type | Description |
|---|---|---|
| points | IEnumerable<Vector2> | — |
Returns:
void—public static void DrawSquare(Vector2 position, Vector2 scale)
| Parameter | Type | Description |
|---|---|---|
| position | Vector2 | — |
| scale | Vector2 | — |
Returns:
void—public static Sandbox.Rect DrawTextBox(Sandbox.Rect position, string text, Color textColor, Sandbox.UI.Margin padding, float borderRadius, Sandbox.TextFlag flag)
| Parameter | Type | Description |
|---|---|---|
| position | Rect | — |
| text | string | — |
| textColor | Color | — |
| padding | Margin | — |
| borderRadius | float | — |
| flag | TextFlag | — |
public static string GetElidedText(string text, float width, Editor.ElideMode mode = 1, Sandbox.TextFlag flags = 132)
Adds required ellipses to a string if it doesn't fit within the width
| Parameter | Type | Description |
|---|---|---|
| text | string | — |
| width | float | — |
| mode = 1 | ElideMode | — |
| flags = 132 | TextFlag | — |
Returns:
string—public static void Rect(Sandbox.UI.Styles styles, Sandbox.Rect rect)
Draw a rectangle using the background of a style
| Parameter | Type | Description |
|---|---|---|
| styles | Styles | — |
| rect | Rect | — |
Returns:
void—public static void ResetTransform()
Returns:
void—public static void Scale(float x, float y)
| Parameter | Type | Description |
|---|---|---|
| x | float | — |
| y | float | — |
Returns:
void—public static void SetBrushLinear(Vector2 a_pos, Vector2 b_pos, Color a_color, Color b_color)
| Parameter | Type | Description |
|---|---|---|
| a_pos | Vector2 | — |
| b_pos | Vector2 | — |
| a_color | Color | — |
| b_color | Color | — |
Returns:
void—public static void SetDefaultFont(float size = 8, int weight = 400, bool italic = False, bool sizeInPixels = False)
| Parameter | Type | Description |
|---|---|---|
| size = 8 | float | — |
| weight = 400 | int | — |
| italic = False | bool | — |
| sizeInPixels = False | bool | — |
Returns:
void—public static void SetFlags(bool selected, bool mouseOver, bool pressed, bool focused, bool enabled)
| Parameter | Type | Description |
|---|---|---|
| selected | bool | — |
| mouseOver | bool | — |
| pressed | bool | — |
| focused | bool | — |
| enabled | bool | — |
Returns:
void—public static void SetHeadingFont(float size = 15, int weight = 400, bool italic = False, bool sizeInPixels = False)
| Parameter | Type | Description |
|---|---|---|
| size = 15 | float | — |
| weight = 400 | int | — |
| italic = False | bool | — |
| sizeInPixels = False | bool | — |
Returns:
void—public static void SetPen(Color color, float size = 0, Editor.PenStyle style = 1)
| Parameter | Type | Description |
|---|---|---|
| color | Color | — |
| size = 0 | float | — |
| style = 1 | PenStyle | — |
Returns:
void—No results match this filter.
Properties13
Showing 13 properties
public static bool Editor.Paint.Antialiasing { get; set; }
Returns:
bool—public static bool Editor.Paint.BilinearFiltering { get; set; }
Returns:
bool—public static bool Editor.Paint.HasEnabled { get; set; }
Returns:
bool—public static bool Editor.Paint.HasFocus { get; set; }
Returns:
bool—public static bool Editor.Paint.HasMouseOver { get; set; }
Returns:
bool—public static bool Editor.Paint.HasPressed { get; set; }
Returns:
bool—public static bool Editor.Paint.HasSelected { get; set; }
Returns:
bool—public static float Editor.Paint.PenSize { get; set; }
Returns:
float—public static Editor.RenderMode Editor.Paint.RenderMode { get; set; }
public static bool Editor.Paint.TextAntialiasing { get; set; }
Returns:
bool—No results match this filter.