functions Methods 32

Arc (center, radius, startAngle, sweepAngle)
Draws an arc using the current Sandbox.Painter.Stroke with angles in clockwise degrees from right. Negative sweeps run counterclockwise. Radius measures to the centerline in drawing pixels. Sweeps of at least 360 degrees form a closed ring.
Arrow (from, to, width, headSize)
Draws a shafted arrow as one polygon using Sandbox.Painter.Fill and Sandbox.Painter.Stroke. All dimensions are in drawing pixels. Zero-length arrows or nonpositive shaft/head sizes draw nothing.
BeginLayer (bounds, opacity, filter, mask)
LayerScope
Bezier (from, control, to)
Draws a quadratic Bezier using Sandbox.Painter.Stroke.
Capsule (from, to, fromRadius, toRadius)
Draws the convex hull of two discs using Fill and Stroke. Endpoint radii are in drawing pixels. Equal radii form a capsule; unequal radii taper along common tangents. A contained disc reduces to the larger circle.
Circle (center, radius)
Draws a circle using Sandbox.Painter.Fill and the current Sandbox.Painter.Stroke. Radius and width are in drawing pixels.
Clear (color)
Clears the destination, ignoring drawing state. Supported by texture and command-list painters, outside layers.
Clip (rect, corners)
Intersects subsequent drawing with a rectangle, optionally rounded like Painter.Rect. Captures the current Transform; later transform changes do not move this clip. Nested clips intersect with each other and the panel's CSS clip. Scope() restores the previous clip. Empty rectangles or a collapsed transform clip all drawing.
Crescent (center, radius, cutoutRadius, cutoutOffset)
Draws a circle minus an offset circular cutout using Fill and Stroke. Dimensions and offset are in drawing pixels. Moving the cutout changes the moon's phase and direction. Disjoint circles leave a disc; a covering cutout draws nothing.
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.
Dispose ()
Submits a destination-owned recording. Copies may be disposed more than once. Panel-supplied painters do not own their recording.
FilterBackdrop (rect, filter, corners)
Filter pixels already drawn behind a rectangle. Captures the current transform, clip, opacity and blend mode.
Heart (center, size)
Draws a heart with two round lobes and a pointed base, using Fill and Stroke. Size is the full width in drawing pixels; its proportions are fixed and its bounds are centered at center.
Line (points)
LineSmooth (points)
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.
Outline (rect, cornerRadius, offset)
Draws an outline using Sandbox.Painter.Stroke. At zero offset, its inner edge follows the rectangle. Positive offsets push the outline outward; negative offsets pull it inward. All dimensions are in drawing pixels.
Pie (center, radius, startAngle, sweepAngle)
Draws a pie sector using Sandbox.Painter.Fill and the current Sandbox.Painter.Stroke. Angles are clockwise degrees from right; negative sweeps are supported. A full sweep draws a circle without radial seams.
Polygon (points)
Quad (a, b, c, d)
Draws a quad using Sandbox.Painter.Fill and the current Sandbox.Painter.Stroke. Vertices follow the perimeter in drawing pixels.
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.
RectShadow (rect, corners, color, blur, spread, offset, inset)
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.
Rotate (degrees)
Rotates the drawing axes clockwise in degrees around their current origin.
Scale (scale)
Scales both drawing axes around their current origin, including stroke widths and text.
Scope ()
StateScope
Saves drawing state until the returned scope is disposed.
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.
Text (text, rect)
Draws text with the current TextStyle, opacity, transform and clip.
Texture (texture, rect, tint)
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.
Translate (offset)
Moves the drawing origin along its current axes.
Triangle (a, b, c)
Draws a triangle using Sandbox.Painter.Fill and the current Sandbox.Painter.Stroke, in drawing pixels.
people
Log in to reply
You can't reply if you're not logged in. That would be crazy.