Paintclass

objectPaint
Namespace
Editor
Assembly
Sandbox.Tools
Declaration
public static abstract sealed class Editor.Paint

Methods47

Showing 47 methods

public static void ClearBrush()PUBLICSTATIC

Returns:void

public static void ClearPen()PUBLICSTATIC

Returns:void

public static void DrawArc(Vector2 center, Vector2 radius, float angle, float angleSize)PUBLICSTATIC

Draws an arc (line). Angles are clockwise, 0 is north.

ParameterTypeDescription
centerVector2The center of the circle
radiusVector2The radius of the circle
anglefloatThe center of the arc, in degrees
angleSizefloatThe size of the arc, in degrees
Returns:void

public static void DrawArrow(Vector2 p1, Vector2 p2, float width)PUBLICSTATIC

ParameterTypeDescription
p1Vector2
p2Vector2
widthfloat
Returns:void

public static Sandbox.Rect DrawIcon(Sandbox.Rect rect, string iconName, float pixelHeight, Sandbox.TextFlag alignment = 132)PUBLICSTATIC

ParameterTypeDescription
rectRect
iconNamestring
pixelHeightfloat
alignment = 132TextFlag
Returns:Rect

public static void DrawPie(Vector2 center, Vector2 radius, float angle, float angleSize)PUBLICSTATIC

Draws a pie. Angles are clockwise, 0 is north.

ParameterTypeDescription
centerVector2The center of the circle
radiusVector2The radius of the circle
anglefloatThe center of the pie, in degrees
angleSizefloatThe size of the pie, in degrees
Returns:void

public static void DrawPoints(System.Collections.Generic.IEnumerable`1<Vector2> points)PUBLICSTATIC

ParameterTypeDescription
pointsIEnumerable<Vector2>
Returns:void

public static void DrawSquare(Vector2 position, Vector2 scale)PUBLICSTATIC

ParameterTypeDescription
positionVector2
scaleVector2
Returns:void

public static Sandbox.Rect DrawTextBox(Sandbox.Rect position, string text, Color textColor, Sandbox.UI.Margin padding, float borderRadius, Sandbox.TextFlag flag)PUBLICSTATIC

ParameterTypeDescription
positionRect
textstring
textColorColor
paddingMargin
borderRadiusfloat
flagTextFlag
Returns:Rect

public static string GetElidedText(string text, float width, Editor.ElideMode mode = 1, Sandbox.TextFlag flags = 132)PUBLICSTATIC

Adds required ellipses to a string if it doesn't fit within the width

ParameterTypeDescription
textstring
widthfloat
mode = 1ElideMode
flags = 132TextFlag
Returns:string

public static void Rect(Sandbox.UI.Styles styles, Sandbox.Rect rect)PUBLICSTATIC

Draw a rectangle using the background of a style

ParameterTypeDescription
stylesStyles
rectRect
Returns:void

public static void ResetTransform()PUBLICSTATIC

Returns:void

public static void Scale(float x, float y)PUBLICSTATIC

ParameterTypeDescription
xfloat
yfloat
Returns:void

public static void SetDefaultFont(float size = 8, int weight = 400, bool italic = False, bool sizeInPixels = False)PUBLICSTATIC

ParameterTypeDescription
size = 8float
weight = 400int
italic = Falsebool
sizeInPixels = Falsebool
Returns:void

public static void SetFlags(bool selected, bool mouseOver, bool pressed, bool focused, bool enabled)PUBLICSTATIC

ParameterTypeDescription
selectedbool
mouseOverbool
pressedbool
focusedbool
enabledbool
Returns:void

public static void SetHeadingFont(float size = 15, int weight = 400, bool italic = False, bool sizeInPixels = False)PUBLICSTATIC

ParameterTypeDescription
size = 15float
weight = 400int
italic = Falsebool
sizeInPixels = Falsebool
Returns:void

public static void SetPen(Color color, float size = 0, Editor.PenStyle style = 1)PUBLICSTATIC

ParameterTypeDescription
colorColor
size = 0float
style = 1PenStyle
Returns:void

public static System.IDisposable ToPixmap(Editor.Pixmap pixmap)PUBLICSTATIC

ParameterTypeDescription
pixmapPixmap
Returns:IDisposable

public static void Translate(Vector2 tx)PUBLICSTATIC

ParameterTypeDescription
txVector2
Returns:void

Properties13

Showing 13 properties

public static bool Editor.Paint.Antialiasing { get; set; }PUBLICSTATICGETSET

Returns:bool

public static bool Editor.Paint.BilinearFiltering { get; set; }PUBLICSTATICGETSET

Returns:bool

public static bool Editor.Paint.HasEnabled { get; set; }PUBLICSTATICGETSET

Returns:bool

public static bool Editor.Paint.HasFocus { get; set; }PUBLICSTATICGETSET

Returns:bool

public static bool Editor.Paint.HasMouseOver { get; set; }PUBLICSTATICGETSET

Returns:bool

public static bool Editor.Paint.HasPressed { get; set; }PUBLICSTATICGETSET

Returns:bool

public static bool Editor.Paint.HasSelected { get; set; }PUBLICSTATICGETSET

Returns:bool

public static Sandbox.Rect Editor.Paint.LocalRect { get; set; }PUBLICSTATICGETSET

Returns:Rect

public static Color Editor.Paint.Pen { get; set; }PUBLICSTATICGETSET

Returns:Color

public static float Editor.Paint.PenSize { get; set; }PUBLICSTATICGETSET

Returns:float

public static bool Editor.Paint.TextAntialiasing { get; set; }PUBLICSTATICGETSET

Returns:bool

On this page

Methodspublic static System.Void ClearBrush()public static System.Void ClearPen()public static System.Void Draw(Sandbox.Rect r, Editor.Pixmap pixmap, System.Single alpha = 1, System.Single borderRadius = 0)public static System.Void Draw(Sandbox.Rect r, System.String image, System.Single alpha = 1, System.Single borderRadius = 0)public static System.Void DrawArc(Vector2 center, Vector2 radius, System.Single angle, System.Single angleSize)public static System.Void DrawArrow(Vector2 p1, Vector2 p2, System.Single width)public static System.Void DrawCircle(Sandbox.Rect rect)public static System.Void DrawCircle(Vector2 position, Vector2 scale)public static Sandbox.Rect DrawIcon(Sandbox.Rect rect, System.String iconName, System.Single pixelHeight, Sandbox.TextFlag alignment = 132)public static System.Void DrawLine(System.Collections.Generic.IEnumerable`1<Vector2> points)public static System.Void DrawLine(Vector2 from, Vector2 to)public static System.Void DrawPie(Vector2 center, Vector2 radius, System.Single angle, System.Single angleSize)public static System.Void DrawPoints(System.Collections.Generic.IEnumerable`1<Vector2> points)public static System.Void DrawPolygon(System.Collections.Generic.IEnumerable`1<Vector2> points)public static System.Void DrawPolygon(Vector2[] points)public static System.Void DrawRect(Sandbox.Rect rect, System.Single borderRadius)public static System.Void DrawRect(Sandbox.Rect rect)public static System.Void DrawSquare(Vector2 position, Vector2 scale)public static Sandbox.Rect DrawText(Sandbox.Rect position, System.String text, Sandbox.TextFlag flags = 132)public static Sandbox.Rect DrawText(Vector2 position, System.String text)public static Sandbox.Rect DrawTextBox(Sandbox.Rect position, System.String text, Color textColor, Sandbox.UI.Margin padding, System.Single borderRadius, Sandbox.TextFlag flag)public static System.String GetElidedText(System.String text, System.Single width, Editor.ElideMode mode = 1, Sandbox.TextFlag flags = 132)public static Editor.Pixmap LoadImage(System.String filename, System.Int32 x, System.Int32 y)public static Editor.Pixmap LoadImage(System.String filename)public static Sandbox.Rect MeasureText(Sandbox.Rect position, System.String text, Sandbox.TextFlag flags = 132)public static Vector2 MeasureText(System.String text)public static System.Void Rect(Sandbox.UI.Styles styles, Sandbox.Rect rect)public static System.Void ResetTransform()public static System.Void Rotate(System.Single scale, Vector2 center)public static System.Void Rotate(System.Single scale)public static System.Void Scale(System.Single x, System.Single y)public static System.Void SetBrush(Color color)public static System.Void SetBrush(Editor.Pixmap pixmap)public static System.Void SetBrush(System.String image)public static System.Void SetBrushAndPen(Color brushColor, Color penColor, System.Single penSize = 1, Editor.PenStyle style = 1)public static System.Void SetBrushAndPen(Color brushColor)public static System.Void SetBrushLinear(Vector2 a_pos, Vector2 b_pos, Color a_color, Color b_color)public static System.Void SetBrushRadial(Vector2 center, System.Single radius, Color a_color, Color b_color)public static System.Void SetBrushRadial(Vector2 center, System.Single radius, System.Single a, Color a_color, System.Single b, Color b_color)public static System.Void SetDefaultFont(System.Single size = 8, System.Int32 weight = 400, System.Boolean italic = False, System.Boolean sizeInPixels = False)public static System.Void SetFlags(System.Boolean selected, System.Boolean mouseOver, System.Boolean pressed, System.Boolean focused, System.Boolean enabled)public static System.Void SetFont(Sandbox.UI.Styles style)public static System.Void SetFont(System.String name, System.Single size = 8, System.Int32 weight = 400, System.Boolean italic = False, System.Boolean sizeInPixels = False)public static System.Void SetHeadingFont(System.Single size = 15, System.Int32 weight = 400, System.Boolean italic = False, System.Boolean sizeInPixels = False)public static System.Void SetPen(Color color, System.Single size = 0, Editor.PenStyle style = 1)public static System.IDisposable ToPixmap(Editor.Pixmap pixmap)public static System.Void Translate(Vector2 tx)Propertiespublic static System.Boolean Editor.Paint.Antialiasing { get; set; }public static System.Boolean Editor.Paint.BilinearFiltering { get; set; }public static System.Boolean Editor.Paint.HasEnabled { get; set; }public static System.Boolean Editor.Paint.HasFocus { get; set; }public static System.Boolean Editor.Paint.HasMouseOver { get; set; }public static System.Boolean Editor.Paint.HasPressed { get; set; }public static System.Boolean Editor.Paint.HasSelected { get; set; }public static Sandbox.Rect Editor.Paint.LocalRect { get; set; }public static Color Editor.Paint.Pen { get; set; }public static System.Single Editor.Paint.PenSize { get; set; }public static Editor.PenStyle Editor.Paint.PenStyle { get; set; }public static Editor.RenderMode Editor.Paint.RenderMode { get; set; }public static System.Boolean Editor.Paint.TextAntialiasing { get; set; }Metadata