Api Editor Paint
class

Paint

public static abstract sealed class Paint

Properties

Name Type Description
LocalRect static Rect
Antialiasing static Boolean
TextAntialiasing static Boolean
BilinearFiltering static Boolean
Pen static Color
PenSize static Single
PenStyle static PenStyle
HasSelected static Boolean
HasMouseOver static Boolean
HasPressed static Boolean
HasFocus static Boolean
HasEnabled static Boolean
RenderMode static RenderMode

Methods

static Void Translate(Vector2 tx)
static Void Scale(Single x, Single y)
static Void Rotate(Single scale)
static Void Rotate(Single scale, Vector2 center)
static Void ResetTransform()
static Void DrawRect(Rect rect, Single borderRadius)
static Void DrawRect(Rect rect)
static Void DrawCircle(Rect rect)
static Void DrawCircle(Vector2 position, Vector2 scale)
static Void DrawArc(Vector2 center, Vector2 radius, Single angle, Single angleSize)

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

center — The center of the circle
radius — The radius of the circle
angle — The center of the arc, in degrees
angleSize — The size of the arc, in degrees
static Void DrawPie(Vector2 center, Vector2 radius, Single angle, Single angleSize)

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

center — The center of the circle
radius — The radius of the circle
angle — The center of the pie, in degrees
angleSize — The size of the pie, in degrees
static Void DrawSquare(Vector2 position, Vector2 scale)
static Void DrawPolygon(IEnumerable<Vector2> points)
static Void DrawLine(IEnumerable<Vector2> points)
static Void DrawPoints(IEnumerable<Vector2> points)
static Void DrawPolygon(Vector2[] points)
static Void DrawArrow(Vector2 p1, Vector2 p2, Single width)
static Rect DrawText(Vector2 position, String text)
static Void DrawLine(Vector2 from, Vector2 to)
static Rect DrawText(Rect position, String text, TextFlag flags = 132)
static String GetElidedText(String text, Single width, ElideMode mode = 1, TextFlag flags = 132)

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

static Rect MeasureText(Rect position, String text, TextFlag flags = 132)
static Vector2 MeasureText(String text)
static Void SetFont(String name, Single size = 8, Int32 weight = 400, Boolean italic = False, Boolean sizeInPixels = False)
static Void SetDefaultFont(Single size = 8, Int32 weight = 400, Boolean italic = False, Boolean sizeInPixels = False)
static Void SetHeadingFont(Single size = 15, Int32 weight = 400, Boolean italic = False, Boolean sizeInPixels = False)
static Void ClearPen()
static Void ClearBrush()
static Void SetFont(Styles style)

Set the pen and font style from a style

static Void Rect(Styles styles, Rect rect)

Draw a rectangle using the background of a style

static Void SetPen(Color color, Single size = 0, PenStyle style = 1)
static Void SetBrush(Color color)
static Void SetBrushAndPen(Color brushColor, Color penColor, Single penSize = 1, PenStyle style = 1)
static Void SetBrushAndPen(Color brushColor)
static Void SetBrushLinear(Vector2 a_pos, Vector2 b_pos, Color a_color, Color b_color)
static Void SetBrushRadial(Vector2 center, Single radius, Color a_color, Color b_color)
static Void SetBrushRadial(Vector2 center, Single radius, Single a, Color a_color, Single b, Color b_color)
static Pixmap LoadImage(String filename)
static Pixmap LoadImage(String filename, Int32 x, Int32 y)
static Void SetBrush(String image)
static Void SetBrush(Pixmap pixmap)
static Void SetFlags(Boolean selected, Boolean mouseOver, Boolean pressed, Boolean focused, Boolean enabled)
static Rect DrawIcon(Rect rect, String iconName, Single pixelHeight, TextFlag alignment = 132)
static Void Draw(Rect r, Pixmap pixmap, Single alpha = 1, Single borderRadius = 0)
static Void Draw(Rect r, String image, Single alpha = 1, Single borderRadius = 0)
static IDisposable ToPixmap(Pixmap pixmap)
static Rect DrawTextBox(Rect position, String text, Color textColor, Margin padding, Single borderRadius, TextFlag flag)
Assembly: Sandbox.Tools Namespace: Editor Full Name: Editor.Paint