Strokeclass
A stroke on a shape's path. Defaults to centered, with half its width on either side. Dimensions and dash phase are in drawing pixels. Defaults to no stroke.
Constructors2
Showing 2 constructors
No results match this filter.
Methods5
Showing 5 methods
public static Sandbox.Stroke Dashed(Sandbox.Fill fill, float width = 1, float dashLength = 8, float gap = 4, float offset = 0)
Creates a dashed stroke with butt caps and round joins. Dimensions are in drawing pixels.
| Parameter | Type | Description |
|---|---|---|
| fill | Fill | Color, gradient or image used to paint the dashes. |
| width = 1 | float | Centered stroke width. |
| dashLength = 8 | float | Length of each dash along the path's centerline. |
| gap = 4 | float | Gap between dash runs before extending their caps. |
| offset = 0 | float | Phase along the path, in drawing pixels. |
public static Sandbox.Stroke Dotted(Sandbox.Fill fill, float width = 1, float gap = 4, float offset = 0)
Creates round dots with diameter equal to the stroke width. Dimensions are in drawing pixels.
| Parameter | Type | Description |
|---|---|---|
| fill | Fill | Color, gradient or image used to paint the dots. |
| width = 1 | float | Diameter of each dot. |
| gap = 4 | float | Gap between dot edges. Closed paths fit whole dot periods around their perimeter. |
| offset = 0 | float | Phase along the path, in drawing pixels. |
public static Sandbox.Stroke Solid(Sandbox.Fill fill, float width = 1)
Creates a solid stroke with butt caps and round joins. Width is in drawing pixels.
| Parameter | Type | Description |
|---|---|---|
| fill | Fill | — |
| width = 1 | float | — |
public Sandbox.Stroke WithAlignment(Sandbox.Stroke.StrokeAlignment alignment)
Returns a copy with the specified placement on closed shapes.
| Parameter | Type | Description |
|---|---|---|
| alignment | StrokeAlignment | — |
No results match this filter.
Properties11
Showing 11 properties
public Sandbox.Stroke.StrokeAlignment Sandbox.Stroke.Alignment { get; set; }
Placement on closed shapes. Defaults to Center; ignored by open paths. Inside and outside strokes clip a double-width centered stroke to the selected side, including its dash caps and dots. Pattern distances follow the original boundary.
public Sandbox.Stroke.LineCap Sandbox.Stroke.Cap { get; set; }
Outward-facing caps at both ends of open paths and dash runs, without shortening heads on short runs. Closed paths have no endpoint caps; dots stay round.
public float Sandbox.Stroke.DashLength { get; set; }
Dash centerline length in drawing pixels. Nonpositive or non-finite values produce a solid stroke.
float—public Sandbox.Fill Sandbox.Stroke.Fill { get; set; }
Fill mapped across the whole undashed stroke's bounds, shared by all dashes and caps.
public float Sandbox.Stroke.Gap { get; set; }
Gap between dash runs or dot edges. Negative gaps become zero; non-finite gaps produce a solid stroke.
float—public float Sandbox.Stroke.MiterLimit { get; set; }
Maximum miter length divided by half the width, before falling back to bevel. Clamped to at least 1; non-finite values use 4.
float—public static Sandbox.Stroke Sandbox.Stroke.None { get; set; }
A disabled stroke. Equivalent to the default value.
public float Sandbox.Stroke.Offset { get; set; }
Phase along the path in drawing pixels. Wraps around the period; non-finite values become zero.
float—public Sandbox.BorderStyle Sandbox.Stroke.Style { get; set; }
Style and spacing along the path. Paths support solid, dashed and dotted strokes; decorative styles render on inside rectangles with solid-color paint and fall back to solid elsewhere. Two-point open lines evaluate patterns directly in the shader. Other paths generate geometry proportional to the number of dashes or dots and throw ArgumentOutOfRangeException when that geometry exceeds GPU buffer capacity.
public float Sandbox.Stroke.Width { get; set; }
Width in drawing pixels, placed according to Alignment. Nonpositive or non-finite widths disable the stroke.
float—No results match this filter.