Cross
(center, width, length)
Draws a plus-shaped cross as one contour using Fill and Stroke, without overlapping bars.
Width is the thickness of each bar; length is the full tip-to-tip span on both axes, in drawing pixels.
Nonpositive, non-finite dimensions or a width greater than length draw nothing.
MeasureText
(text, maxSize)
Vector2
Measures text with the current TextStyle, including glyph overhang, in the same coordinates as Painter.Text.
maxSize supplies the same layout bounds as a drawing rectangle; default uses Painter.Text's unconstrained bounds.
The result includes ScaleToScreen but excludes Painter.Transform, clipping and opacity. Empty text returns zero.
Prepares cached layout without recording a draw or allocating a bitmap or GPU texture. A later draw reuses the layout.
Rect
(rect, borderWidths, colorLeft, colorTop, colorRight, colorBottom, corners)
Draws a filled rectangle with independent inside border widths and colors, ordered left, top, right, bottom.
Uses Fill for the background and Stroke.Style for the border, with CSS corner joins and dash/dot spacing.
Stroke.Width, Stroke.Fill, Alignment, Cap and Join do not affect these explicit borders.
Border widths must be finite and non-negative. Corners follow the same rules as Rect.
Ring
(center, innerRadius, outerRadius)
Draws the band between inner and outer radii using Sandbox.Painter.Fill, with the current
Sandbox.Painter.Stroke on both circular edges. Inside/outside alignment is relative to the band.
Radii are in drawing pixels.
A zero inner radius draws a circle. Negative, non-finite, equal or reversed radii draw nothing.
Star
(center, bodyRadius, spikeLength, points, rotation)
Draws a star using Fill and Stroke. Body radius measures to the valleys; spike length
extends beyond it to the tips, in drawing pixels. Rotation is clockwise degrees from right.
At least three points and a positive body radius are required. Zero spike length draws a regular polygon.
Tick
(center, width, length)
Draws a check mark as one filled contour using Fill and Stroke. Width is the arm thickness;
length is the horizontal span of its centerline in drawing pixels. The long arm rises to the right.
Nonpositive, non-finite dimensions or a width greater than half the length draw nothing.